Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

NestJS example app + Prisma + PostgreSQL

License

NotificationsYou must be signed in to change notification settings

Ismaestro/nestjs-example-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

What's included

  • 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.

Setup

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

Bugs and feature requests

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.

Creators

Ismael Ramos

Thanks

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!

Copyright and license

Code and documentation copyright 2021 the authors. Code released under theMIT License.

Enjoy 🤘


[8]ページ先頭

©2009-2025 Movatter.jp