Skip to content

JD1927/nest-teslo-shop

Repository files navigation

Nest Logo

Used Stack

  • Postgres
  • NestJS

First steps

$ pnpm add -g @nestjs/cli

Description

Nest framework TypeScript starter repository.

Project setup

Must have cloned the repo!

$ pnpm install

Environment Variables

Clone file .env.template to .env to run things smoothly.

DB_NAME=teslo_db
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=postgres
DB_PASSWORD=MyS3cr3tPassword
PORT=3000

Must have installed docker with Postgres

# In ./ run to create the Database:
$ docker-compose up -d

Production Build

  1. Must have file .env.prod created
  2. Set environment variables for PROD file
  3. Create a new image (containing app and database) -> Will take some time ⏳
# Windows
docker-compose -f docker-compose.prod.yaml --env-file .env.prod up --build
# Linux
sudo docker compose -f docker-compose.prod.yaml --env-file .env.prod up --build

Once you've created the build image you can now execute this command in order to avoid having the process in the console.

# Windows
docker-compose -f docker-compose.prod.yaml --env-file .env.prod up -d
# Linux
sudo docker compose -f docker-compose.prod.yaml --env-file .env.prod up -d

Compile and run the project

# development
$ pnpm run start

# watch mode
$ pnpm run start:dev

# production mode
$ pnpm run start:prod

Execute SEED endpoint

# Call this endpoint in Postman or curl and that would populate the database. Host means localhost and the port
{{host}}/api/seed

Resources

Check out a few resources that may come in handy when working with NestJS:

  • Visit the NestJS Documentation to learn more about the framework.
  • For questions and support, please visit our Discord channel.
  • To dive deeper and get more hands-on experience, check out our official video courses.
  • Deploy your application to AWS with the help of NestJS Mau in just a few clicks.
  • Visualize your application graph and interact with the NestJS application in real-time using NestJS Devtools.
  • Need help with your project (part-time to full-time)? Check out our official enterprise support.
  • To stay in the loop and get updates, follow us on X and LinkedIn.
  • Looking for a job, or have a job to offer? Check out our official Jobs board.

About

A repo following a NestJS course

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published