NestJS REST API for Ecommerce project
git clone --depth 1 https://github.com/robavelii/nestjs-starter.git my-app
cd my-app/
cp env-example .env
docker compose up -d
For check status run
docker compose logs
git clone --depth 1 https://github.com/robavelii/nest-ecommerce.git my-app
cd my-app/
cp env-example .env
Change DATABASE_HOST=postgres
to DATABASE_HOST=localhost
Change MAIL_HOST=maildev
to MAIL_HOST=localhost
Run additional container:
docker compose up -d postgres adminer maildev
npm install
npm run migration:run
npm run seed:run
npm run start:dev
- Swagger: http://localhost:3000/docs
- Adminer (client for DB): http://localhost:8080
- Maildev: http://localhost:1080
If you want to automatically update dependencies, you can connect Renovate for your project.
Generate migration
npm run migration:generate -- src/database/migrations/CreateNameTable
Run migration
npm run migration:run
Revert migration
npm run migration:revert
Drop all tables in database
npm run schema:drop
Run seed
npm run seed:run
# unit tests
npm run test
# e2e tests
npm run test:e2e
docker compose -f docker-compose.ci.yaml --env-file env-example -p ci up --build --exit-code-from api && docker compose -p ci rm -svf
docker run --rm jordi/ab -n 100 -c 100 -T application/json -H "Authorization: Bearer USER_TOKEN" -v 2 http://<server_ip>:3000/api/v1/users