Tiny Store is a Rest API for a simple store. It uses Nest framework.
Nest framework TypeScript starter repository.
# Install the dependencies
$ yarn install
# Install Docker and Postgres
$ docker pull postgres:14.3
# change .env file with the data about your dataBase
$ .env.template --> .env
# build docker image
$ docker compose up -d
# build the database tables with prisma command
$ npx prisma migrate dev --name "name_of_your_migration"
# if you need to reset the database
$ npx prisma migrate reset
# if you need to seed the database
$ npx prisma db seed
# if you need to generate types
$ npx prisma generate
# if you need to deploy the database
$ npx prisma migrate deploy
# development
$ yarn run start
# watch mode
$ yarn run start:dev
# production mode
$ yarn run start:prod
DB_PASSWORD
: Database passwordPOSTGRES_DB
: Database namePOSTGRES_USER
: Database userDATABASE_URL
: Database URLJWT_SECRET
: JWT secret keyFIREBASE_PRIVATE_KEY
: Firebase private keyFIREBASE_PROJECT_ID
: Firebase project IDFIREBASE_CLIENT_EMAIL
: Firebase client emailFIREBASE_STORAGE_BUCKET
: Firebase storage bucket
# unit tests
$ yarn run test
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
- Author - Daniel Echegaray
- GitHub - https://github.com/danqwas
- Authentication using JWT Strategy, Guards & Custom Decorators
- Authorization based on RBAC with two roles: CUSTOMER & MANAGER
- Clean folder structure, commented code & API documentation with Swagger
- Managers can create, read, update & delete Products. Clients can read visible products, buy products, and check their cart
- Prisma Global Module, Singletons for Firebase Upload Service & various utilities