How hovog83/nestjs_api works
This is a NestJS API for authentication and managing users, albums, and products. The main workflow is an HTTP request entering through a controller, passing applicable guards, reaching a service, and reading or changing PostgreSQL-backed records. Authentication also issues JWTs and sends a verification email through SendGrid. The README describes a generic Nest starter rather than these application capabilities; the graph follows the sampled source and tree, so unsampled module wiring and guard behavior are shown only where explicitly supported.
Main entry points: app.module.ts App configuration · auth.service.ts Authentication · user.controller.ts User routes · albom.controller.ts Album routes
Components 21
Application runtime
- HTTP bootstrap
src/main.ts - App configuration
src/app.module.ts - Request validation
src/helpers/validation.pipe.ts
Identity and access
- Auth routes
src/auth/auth.controller.ts - Authentication
src/auth/auth.service.ts - Auth guard
src/auth/auth-guard.ts - Admin guard
src/helpers/admin-guard.ts
User and catalog
- User routes
src/user/user.controller.ts - User operations
src/user/user.service.ts - User model
src/user/user.model.ts - Album routes
src/albom/albom.controller.ts - Album operations
src/albom/albom.service.ts - Album model
src/albom/albom.model.ts - Product routes
src/product/product.controller.ts - Product operations
src/product/product.service.ts - Product model
src/product/product.model.ts
Persistence and messaging
- PostgreSQL
- JWT service
- Verification mail
src/helpers/mailer.service.ts - SendGrid
Other components
- API client
Connections 28
- HTTP bootstrap → App configuration: creates app
- HTTP bootstrap → Request validation: installs pipe
- API client → Auth routes: sends requests
- API client → User routes: sends requests
- API client → Album routes: sends requests
- API client → Product routes: sends requests
- Auth routes → Authentication: calls
- Authentication → User model: queries and creates
- Authentication → JWT service: signs token
- Authentication → Verification mail: sends verification
- Verification mail → SendGrid: sends email
- User routes → Auth guard: guards routes
- User routes → Admin guard: guards admin routes
- Album routes → Auth guard: guards routes
- Album routes → Admin guard: guards admin route
- User routes → User operations: calls
- User operations → User model: queries and updates
- Album routes → Album operations: calls
- Album operations → Album model: queries and updates
- Product routes → Product operations: calls
- Product operations → Product model: queries and creates
- App configuration → PostgreSQL: configures connection
- App configuration → User model: registers model
- App configuration → Album model: registers model
- App configuration → Product model: registers model
- User model → PostgreSQL: maps records
- Album model → PostgreSQL: maps records
- Product model → PostgreSQL: maps records