To install the project, you need to have Node.js installed on your machine. You can download it from here. Then you need to clone the repository and run the following command in the root of the project:
$ npm installAfter that you need to create a .env file in the root of the project and add the following variables:
PORT=3000
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER="your_username"
POSTGRES_PASSWORD="your_password"
POSTGRES_DATABASE="your_database_name"
MODE=DEV
RUN_MIGRATIONS=trueThat is all you need to do to install the project.
To run the app you need to run the following command in the root of the project:
# development
$ npm run startOr you can run the following command to run the app in watch mode (development mode):
# watch mode
$ npm run start:devThe project is structured in the following way:
random_project
├── src
│ ├── config
│ │ ├── config.service.ts (Configuration service)
│ ├── migration
│ ├── model
│ │ ├── product.entity.ts (Product entity)
│ ├── product
│ │ ├── dto
│ │ │ ├── create-product.dto.ts (Create product DTO)
│ │ │ ├── update-product.dto.ts (Update product DTO)
│ │ ├── product.controller.ts (Product controller)
│ │ ├── product.service.ts (Product service)
│ │ ├── product.module.ts (Product module)
│ ├── app.module.ts (Main module)
│ ├── app.controller.ts (Main controller)
│ ├── app.service.ts (Main service)
├ ├── main.ts (Main file)
├ ├── scripts
│ ├── shared (Shared module)
│ │ ├── pipes (Validation pipes)
│ │ │ ├── constants.ts (Validation pipe)
│ │ │ ├── paginationPipe.pipe.ts (Validation pipe)
This project is a simple example of a NestJS project. It is not meant to be used in production. It is meant to be used as a learning resource. If you want to use it in production, you need to add more features and tests to it.