Scalable, typed and monitored NestJS API with PostgreSQL, CI/CD, testing, and observability.
- β Fully-typed REST API built with NestJS
- π PostgreSQL container via Docker
- βοΈ GitHub Actions for CI/CD
- π§ͺ Unit, E2E & mutation testing (Jest + Stryker)
- π Code coverage via Codecov
- π¬ Code quality enforcement via SonarCloud
- π¦ Commit hooks with Lefthook, Commitlint, and Biome
- π§ Error tracking and profiling with Sentry
- π Swagger documentation at
/docs/
git clone https://github.com/garatortiz/kime-api.git
cd kime-api
cp .env.example .env
npm install
docker compose up -d
This will start PostgreSQL 15 with user
kime_user
, passwordkime_password
, and DBkime_db
npm run start:dev
# Run all unit and e2e tests
npm test
# Run E2E only
npm run test:e2e
# Watch mode
npm run test:watch
# Coverage
npm run test:cov
# Mutation testing (Stryker)
npm run test:mutation
# Run linter
npm run lint
# Format with Biome
npm run format
# Type check
npm run typecheck
Commit hooks are managed via Lefthook, using Commitlint + Biome.
Once the app is running, Swagger docs are available at:
π http://localhost:3000/docs/
Includes examples for each endpoint and automatic linking between operations.
This project is instrumented with @sentry/nestjs
+ @sentry/profiling-node
.
To enable Sentry:
- Create a project in Sentry.io
- Add your DSN in
.env
:
SENTRY_DSN=https://your_dsn@o12345.ingest.sentry.io/projectid
- Sourcemaps are uploaded via:
npm run build
This runs sentry-cli sourcemaps inject
+ upload
on your /dist
folder.
Vercel or any Node-compatible host works. Example:
vercel --prod
Or deploy using Docker:
docker build -t kime-api .
docker run -p 3000:3000 --env-file .env kime-api
βββ src/
β βββ main.ts # Entry point
β βββ instrument.ts # Sentry instrumentation
β βββ users/ # Users module
β βββ auth/ # Auth module
β βββ filters/ # Global exception filter
βββ test/ # E2E and unit tests
βββ Dockerfile
βββ docker-compose.yml
βββ ...
PRs welcome! Please follow the conventional commit spec (npm run commit
) and make sure all checks pass locally:
npm run lint && npm test && npm run typecheck && npm run format
MIT Β© MatΓas Garat Ortiz