A small full-stack starter for building MVPs quickly with a NestJS API, React frontend, and PostgreSQL 18.
- Backend: NestJS, TypeORM, PostgreSQL, class-validator
- Frontend: React, Vite, Tailwind CSS
- Tooling: TypeScript, Jest, ESLint, npm workspaces, Docker Compose
apps/backend- NestJS API with health checks, message endpoints, TypeORM migrations, and seed dataapps/frontend- React + Vite app wired to the backend throughVITE_API_BASE_URLdocker-compose.yml- PostgreSQL 18 and backend services for local development
npm install
cp apps/backend/.env.example apps/backend/.env
cp apps/frontend/.env.example apps/frontend/.env
docker compose up -d postgres
npm run --workspace @template/backend db:setup
npm run devDefault URLs:
- Frontend:
http://localhost:5173 - Backend API:
http://localhost:3000 - Health check:
http://localhost:3000/health/ready
This template targets PostgreSQL 18 and uses UUID v7 primary keys for time-orderable IDs.
# run migrations and seed data
npm run --workspace @template/backend db:setup
# create database if missing (safe to run multiple times)
npm run --workspace @template/backend db:ensure
# run only migrations
npm run --workspace @template/backend migration:run
# seed default data
npm run --workspace @template/backend db:seed
# rollback last migration
npm run --workspace @template/backend migration:revertDefault database settings are in apps/backend/.env.example.
Seeds are registered in apps/backend/src/database/seed.ts. For new entities, add a seed file under apps/backend/src/database/seeds and use seedRecords(...) to define batch records with an idempotency where clause and insert data.
# backend + frontend
npm run dev
# backend only
npm run dev:backend
# frontend only
npm run dev:frontend
# build all workspaces
npm run build
# run backend tests
npm run test
# run lint
npm run lint# start PostgreSQL and backend
npm run docker:up
# follow backend logs
npm run docker:logs
# stop services
npm run docker:downDocker exposes PostgreSQL on localhost:5432 using database template_app, user postgres, and password postgres.