Files
trackgo-be/.cursor/rules/nestjs.mdc
T
shancheas d01fd6e2ef Set up PostgreSQL database configuration and enhance application structure
- Added .env.example with database connection details and JWT configuration.
- Introduced docker-compose.yml for PostgreSQL service setup with health checks.
- Created drizzle.config.ts for database schema and migration management.
- Updated nest-cli.json to include Swagger plugin configuration for API documentation.
- Enhanced package.json with new database-related scripts and dependencies.
- Implemented initial database migrations for user and token management.
- Configured application bootstrap process to load environment variables and set up Swagger.
- Added shared application configuration in configure-app.ts for consistent setup.
- Included unit tests for application configuration and Swagger setup.
2026-08-21 15:00:19 +07:00

30 lines
914 B
Plaintext

---
description: NestJS modular TDD structure with Drizzle and PostgreSQL
globs: "**/*.{ts,js}"
alwaysApply: false
---
# NestJS Project Conventions
Stack: NestJS + PostgreSQL + Drizzle ORM. Follow `.agents/skills/nestjs-best-practices` and `.agents/skills/project-guidelines-example`.
## Modules
- One feature folder under `src/modules/`
- Each feature has `*.module.ts`, `*.controller.ts`, `*.service.ts`, `dto/`
- Share cross-cutting code via `src/common/` (filters, guards, pipes, interceptors)
- Document HTTP endpoints per `.cursor/rules/nestjs-swagger.mdc`
## Tests
- Unit tests colocated as `*.spec.ts`
- E2E tests in `test/*.e2e-spec.ts` with Supertest
- Write tests first (RED → GREEN → REFACTOR)
- Mock Drizzle and external services, not Nest internals
## Database
- Schema and SQL migrations in `drizzle/`
- Config in `drizzle.config.ts`
- Never mutate production schema without a migration