Angular + NestJS User Management
A monorepo demonstrating user management with Angular frontend, NestJS backend, Better Auth authentication, and PostgreSQL database.
Prerequisites
Setup
1. Start PostgreSQL
Make sure Docker is running, then start the database:
bun run db:up2. Install dependencies
bun install3. Set up environment variables
Copy the example environment file in the API package:
cp packages/api/.env.example packages/api/.envEdit packages/api/.env with your configuration (the defaults work for local development).
4. Initialize the database
Run migrations and seed the database with test users:
bun -C packages/api db:reset
bun -C packages/api db:seed5. Start development servers
Run both the API and UI in development mode:
bun run devOr run them separately:
# Terminal 1 - API (runs on http://localhost:3000)
bun -C packages/api dev
# Terminal 2 - UI (runs on http://localhost:4200)
bun -C packages/ui devSeeded Users
After running the seed command, you can log in with:
| Password | Role | |
|---|---|---|
| admin@example.com | password123 | ADMIN |
| user@example.com | password123 | USER |
Available Scripts
Root
| Script | Description |
|---|---|
bun run dev |
Start both API and UI in dev mode |
bun run lint |
Run Biome linter |
bun run lint:fix |
Fix linting issues |
bun run typecheck |
Type check all packages |
bun run db:up |
Start PostgreSQL container |
bun run db:down |
Stop PostgreSQL container |
bun run db:reset |
Reset PostgreSQL (destroys data) |
API (packages/api)
| Script | Description |
|---|---|
bun run dev |
Start NestJS in watch mode |
bun run build |
Build for production |
bun run db:migrate |
Run Prisma migrations |
bun run db:seed |
Seed the database |
bun run db:reset |
Reset and re-run migrations |
bun run db:studio |
Open Prisma Studio |
bun run hurl |
Run Hurl integration tests |
UI (packages/ui)
| Script | Description |
|---|---|
bun run dev |
Start Angular dev server |
bun run build |
Build for production |
Running Tests
API Integration Tests (Hurl)
The API has integration tests written in Hurl. Install Hurl first:
# macOS
brew install hurl
# Or see https://hurl.dev/docs/installation.html for other platformsThen run the tests (with the API server running):
bun -C packages/api hurlProject Structure
angular-user-mgmt/
├── packages/
│ ├── api/ # NestJS backend
│ │ ├── prisma/ # Database schema and migrations
│ │ ├── src/ # Source code
│ │ └── tests/ # Hurl integration tests
│ └── ui/ # Angular frontend
│ └── src/ # Source code
├── docker-compose.yml
└── biome.json
Tech Stack
- Frontend: Angular 20, PrimeNG, NgRx
- Backend: NestJS, GraphQL Yoga, Prisma
- Auth: Better Auth (email/password, sessions)
- Database: PostgreSQL
- Email: Resend + React Email
On this page
Languages
TypeScript94.7%JavaScript5.1%HTML0.1%SCSS0.1%
Contributors
Created January 5, 2026
Updated January 7, 2026