- Notifications
You must be signed in to change notification settings - Fork12
NestJS example app + Prisma + PostgreSQL
License
Ismaestro/nestjs-example-app
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Example app with NestJS + Prisma + Postgres
👏👏🎉🎉🎉🎉👏👏
Base project made with much ❤️. Contains CRUD, advanced patterns and much more!
DEMO:Angular Example App using this project
- Example CRUD: create, read, update and delete users!
- Authentication with JWT tokens
- More logical directory structure
- Examples of NestJS controllers, services, repositories, guards, interceptors, etc
- Env file included with al the environment variables that are mandatory already prepared
- Usage of Prisma (An ORM) :)
- A Postgres DB to store the users
- Bruno collection ready to import
- App deployed into Fy.io.
Install dependencies first
npm i
Create a file with this content and call it .env
ENVIRONMENT=localhost# POSTGRESPOSTGRES_HOST=localhostPOSTGRES_PORT=5433POSTGRES_USERNAME=postgresPOSTGRES_PASSWORD=postgresPOSTGRES_DATABASE=postgres# Prisma database connectionDATABASE_URL=postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DATABASE}# NestPORT=3000# SecurityJWT_ACCESS_SECRET=a8e9f3b6d4c2h7j8k5n1o3p2q9r6s4t0v5w7x8z1y3m6n2k8j9l4h5g7f1e2c3b9a0JWT_ACCESS_EXPIRES_IN=1dJWT_REFRESH_SECRET=f4g5h6j7k8l9m0n1p3o5q7r2s6t8v1w9x4z3y2k5j8h7g9f2e4c6b8a0o1m2n7p9q5JWT_REFRESH_EXPIRES_IN=7d
And from now on, you can just go with the one time command that does everything for you:
npm run setup
Or go step by step. As you wish ;)
Create the postgres database
npm run docker:db
Generate the prisma schema
npm run prisma:generate
Run migrations to create necessary tables in the DB
npm run prisma:migrate:dev
Seed the database with the first user
npm run prisma:seed
Start the application
npm start
Have a bug or a feature request? Please first read the issue guidelines and search for existing andclosed issues. If your problem or idea is not addressed yet,please open a new issue.
Ismael Ramos
Thanks to all contributors and their support.
If you have an idea or you want to do something, tell me or just do it! I'm always happy to hearyour feedback!
Code and documentation copyright 2021 the authors. Code released under theMIT License.
Enjoy 🤘
About
NestJS example app + Prisma + PostgreSQL
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.