https://github.com/seaguntech/seaguntech-node-api-template
☁️ NestJS REST API template with TypeScript, Prisma, Redis auth, OpenAPI/Swagger, and Vitest testing. Production-ready with CI/CD, Docker, and modular architecture.
https://github.com/seaguntech/seaguntech-node-api-template
clean-architecture docker nestjs nodejs openapi prisma redis swagger-ui template
Last synced: 3 months ago
JSON representation
☁️ NestJS REST API template with TypeScript, Prisma, Redis auth, OpenAPI/Swagger, and Vitest testing. Production-ready with CI/CD, Docker, and modular architecture.
- Host: GitHub
- URL: https://github.com/seaguntech/seaguntech-node-api-template
- Owner: seaguntech
- Created: 2026-03-11T04:53:01.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-03-11T10:29:34.000Z (4 months ago)
- Last Synced: 2026-03-11T13:05:51.169Z (4 months ago)
- Topics: clean-architecture, docker, nestjs, nodejs, openapi, prisma, redis, swagger-ui, template
- Language: TypeScript
- Homepage: https://seaguntech-node-api-template-production.up.railway.app/api/docs
- Size: 137 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Security: SECURITY.md
Awesome Lists containing this project
README

# SeagunTech Node API Template
NestJS-based REST API template with OpenAPI, Prisma-ready architecture, Redis-ready auth session design, and Vitest test baseline.
## Tech Baseline
- NestJS
- REST + OpenAPI
- class-validator + class-transformer
- Vitest (unit and e2e)
## Quick Start
1. Install dependencies:
```bash
pnpm install
```
2. Create environment file:
```bash
cp .env.example .env
```
3. Start local infrastructure (PostgreSQL + Redis):
```bash
docker compose up -d
```
4. Generate Prisma client:
```bash
pnpm run prisma:generate
```
5. Start app:
```bash
pnpm run start:dev
```
## Endpoints
- Liveness: `GET /api/v1/health/live`
- Readiness: `GET /api/v1/health/ready`
- System info: `GET /api/v1/system/info`
- Auth register: `POST /api/v1/auth/register`
- Auth login: `POST /api/v1/auth/login`
- Auth refresh: `POST /api/v1/auth/refresh`
- Auth logout: `POST /api/v1/auth/logout`
- Auth profile: `GET /api/v1/auth/profile`
- Users create: `POST /api/v1/users`
- Users list (pagination): `GET /api/v1/users?page=1&limit=20`
- Users detail: `GET /api/v1/users/:userId`
- Users update: `PATCH /api/v1/users/:userId`
- Users delete: `DELETE /api/v1/users/:userId`
- Swagger: `GET /api/v1/docs`
## Swagger Basic Auth (optional)
- Set `DOCS_BASIC_AUTH_ENABLED=true` to protect `/api/docs` with basic auth.
- Set `DOCS_USERNAME` and `DOCS_PASSWORD` when enabling it.
## Test Commands
- Unit: `pnpm run test:unit`
- Integration: `pnpm run test:int`
- E2E: `pnpm run test:e2e`
- Unit coverage: `pnpm run test:cov:unit`
- All: `pnpm run test`
## CI Workflows
- Lint + typecheck: `.github/workflows/lint-typecheck.yml`
- Unit tests + coverage: `.github/workflows/unit-test.yml`
- Integration + e2e: `.github/workflows/integration-e2e.yml`
- Build: `.github/workflows/build.yml`
## Delivery Process
- PR template: `.github/pull_request_template.md`
- Release checklist: `docs/10-RELEASE-CHECKLIST.md`
- Branch protection guide: `docs/06-DEVOPS-CICD.md`
## Prisma Commands
- Generate client: `pnpm run prisma:generate`
- Run migration locally: `pnpm run prisma:migrate:dev`
- Deploy migration: `pnpm run prisma:migrate:deploy`
- Open Prisma Studio: `pnpm run prisma:studio`
## OpenAPI Client Generation
- Export OpenAPI spec: `pnpm run openapi:export`
- Clean generated client: `pnpm run gen:client:clean`
- Generate TypeScript client: `pnpm run gen:client`
- Verify spec/client synced (CI-friendly): `pnpm run openapi:check`
- Generator config: `openapi-config.yaml`
- Exported spec: `openapi/openapi.json`
- Generated SDK output: `generated/openapi-client`