Skip to content
spring-onion-loversPublic

About

Backend services powered by Nest.js

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

TrendCart Backend

Powered by Nest.js and Prisma. The most typesafe backend you'll ever see.

Postman Collection

The Postman collections includes sample responses. Run In Postman

Important

For login, you can pick a random email from the users table (by using Prisma Studio or PGAdmin) and use random letters as the password to login and receive the token. Then, use the token in your Requests by changing the "Authorization" to Bearer and the token to the response.

Development

1. Setup

Installs the dependencies.

$ yarn

2. Docker (Optional) – For database setup.

If you're not using Docker, you can skip this step and setup your database manually. Mind that we're using PostgreSQL.

# start the container
$ docker-compose up -d
# Database URL: postgresql://postgres:postgres@localhost:5434/?schema=public

3. Fill the .env file

Yeah, it's important. Trust me. Also, avoid port 3000.

Note

If you're using docker (as shown in the previous step, you can use the following URL):

DATABASE_URL=postgresql://postgres:postgres@localhost:5434/?schema=public

4. Sync Prisma to database and seed the db

This will create the tables and seed the database with some data.

$ yarn prisma db push # Syncs the Prisma schema to the database
$ yarn prisma db seed # Seeds the database (see seed.ts)

5. Start Prisma Studio

This will open a web interface to interact with the database. Think of it as a lightweight PGAdmin.

$ yarn prisma studio

5. Run the server

# watch mode
$ yarn run start:dev

About

Backend services powered by Nest.js

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages