This app is made for learning the Nest.js framework.
- First, you need to install the packages
npm i
# or with yarn
yarn
-
Create an
.env
file with theDATABASE_URL
variable. Make sure you include your database url -
You can use with Prisma DBMS like MySQL/MariaDB, PosgreSQL, MongoDB, CockroachDB, etc. If you want to use something other than MongoDB, you can edit the
prisma/scema.prisma
file like this
...
datasource db {
provider = "postgesql"
// provider = "mongodb"
url = env("DATABASE_URL")
}
...
- Now you need to push the Prisma scheme into database. To do this you need to run it in your terminal:
yarn prisma db push
- Okay, you have done the first 3 steps. You can run some tests of database connection and manipulations (creating tests in progress, but some basic tests already done)
yarn test
- Now you're ready to launch the application.
- To run the application in development mode, execute the command
yarn run start:dev
- To build the application, run
yarn run build
After building you can launch app using
yarn run start:prod