How davidespinozaromero/deer-nestjs-base works
Project type and purpose
• This is a NestJS‐based backend REST API (no separate frontend directory).
• Its core features are user authentication (signup/login with JWT), role-based guards, and a “seed” endpoint to populate initial data into a Postgres DB.
• It uses Docker Compose to spin up Postgres, environment variables for configuration, and Jest for tests.
File structure
• Top-level configuration: .env.template, docker-compose.yaml, nest-cli.json, tsconfig*.json, package.json, ESLint/Prettier and Gitignore files.
• src/main.ts → boots the Nest application.
• src/app.module.ts → root module importing sub-modules.
• src/modules/auth → authentication module (controllers, services, DTOs, entities, guards, decorators, JWT strategy).
• src/modules/seed → seed module (controller + service to insert initial data).
• src/modules/common → shared logic (e.g., pagination DTO).
• Tests under src/modules/*/*.spec.ts and test/app.e2e-spec.ts.
README for additional insights
• Stack: NestJS + Postgres.
• Deployment: Docker Compose spins up the database.
• Environment variables configure DB connection, JWT secrets, and other Nest settings.
Elements
• From Client → Controllers
• Controllers → Services
• Services → Repositories → DB
• Services ↔ JWT Strategy / Guards