How aayushdura/visitor-management-np_nestjs works
This NestJS boilerplate exposes REST endpoints for account registration, JWT login/refresh, password recovery and changes, protected resources, and user profile/record management. The main workflow is an API request routed through an auth or users controller to its service, with user persistence behind a repository; authentication also relies on password hashing and token handling. Registration documents confirmation email, and the README describes MySQL-backed storage. The graph follows sampled controller/repository calls and documented capabilities; service internals not sampled are represented only where paths are present.
Main entry points: login.service.ts Login service · register.service.ts Registration service · users.typeorm.repository.ts Users repository · users.service.ts Users service
Components 20
Identity and access
- Login controller
src/iam/login/login.controller.ts - Registration controller
src/iam/register/register.controller.ts - Login service
src/iam/login/login.service.ts - Registration service
src/iam/register/register.service.ts - Token guards
src/iam/login/guards/access-token/access-token.guard.ts - JWT configuration
src/iam/login/config/jwt.config.ts
User management
- Users controller
src/users/users.controller.ts - Users service
src/users/users.service.ts - Users repository
src/users/repositories/implementations/users.typeorm.repository.ts - Repository provider
src/users/repositories/users.repository.provider.ts - User model
src/users/models/users.model.ts
Shared services
- Password hashing
src/common/hashing/argon2.service.ts - Email service
src/common/mailer/mailer.service.ts
Application runtime
- Nest bootstrap
src/main.ts - App module
src/app.module.ts - Resource controller
src/app.controller.ts - Resource service
src/app.service.ts
Other components
- API client
- MySQL database
- SMTP service
Connections 24
- API client → Nest bootstrap: sends requests
- Nest bootstrap → App module: creates app
- API client → Login controller: calls auth routes
- Login controller → Login service: invokes auth
- API client → Registration controller: registers account
- Registration controller → Registration service: invokes registration
- Login service → Users service: uses accounts
- Registration service → Users service: creates user
- Login service → Password hashing: checks passwords
- Registration service → Password hashing: hashes password
- Login service → JWT configuration: uses settings
- Login controller → Token guards: secured refresh
- API client → Users controller: calls user routes
- Users controller → Token guards: requires bearer token
- Users controller → Users service: invokes operations
- Users service → Users repository: delegates data
- Repository provider → Users repository: provides implementation
- Repository provider → Password hashing: injects hashing
- Users repository → User model: persists records
- Users repository → MySQL database: reads and writes
- Registration service → Email service: sends confirmation
- Email service → SMTP service: sends email
- API client → Resource controller: requests resource
- Resource controller → Resource service: invokes resource