A minimal IAM (Identity and Access Management) REST API built with NestJS, TypeORM, and PostgreSQL, supporting:
- User registration & authentication
- Role-based access control (RBAC)
- Appointment scheduling with user associations
- Secure JWT-based auth
- Node.js (TypeScript)
- NestJS
- PostgreSQL
- TypeORM
- class-validator
- Passport + JWT
- Register
- Login (JWT-based)
- Role assignment (default: user)
- User management (CRUD)
- JWT guard for protected routes
- Role-based guard for admin-only routes
- Users can create and view their own appointments
- Admins can view all appointments or filter by user
- Node.js (v18 or later)
- PostgreSQL
# Clone the repo
git clone https://github.com/abdulloooh/iam_service
cd iam_service
# Install dependencies
npm install
# Copy and update environment config
cp .env.example .env
# Fill in values
# Generate migrations after entity changes
npm run migration:generate -name=migration_name
# Run pending migrations
npm run migration:run
npm run start:dev
# Run unit tests
npm run test
# Run e2e tests
npm run test:e2e
An Entity-Relationship Diagram is available under docs/erd.png
.
API documentation is available via Postman: 👉 Postman Collection
This includes all endpoints for authentication, user management, role-based access control, and appointment handling.
A brief design document is available at docs/design.md
.