How lucianosants/atomnyy-api works
Atomnyy API is a NestJS backend for a supermarket shopping-list app. Its main workflow accepts authenticated list operations over HTTP, dispatches them to use cases, and persists user-owned lists; public registration and login issue the authentication workflow. The graph reflects documented PostgreSQL/TypeORM support and the sampled controller/use-case/repository wiring. Several use cases and modules are indexed but not excerpted, so their internal calls are not asserted.
Main entry points: shopping-list.controller.ts List endpoints · app.module.ts Application modules · typeorm-user.repository.ts User repository · type-orm-shopping-list.repository.ts List repository
Components 22
HTTP API
- Nest bootstrap
src/main.ts - Application modules
src/app.module.ts - Health endpoint
src/app.controller.ts - Greeting service
src/app.service.ts
Identity and Access
- Auth endpoints
src/auth/auth.controller.ts - JWT guard
src/auth/auth.guard.ts - User registration
src/auth/use-cases/register-user.use-case.ts - User login
src/auth/use-cases/login-user.use-case.ts
Shopping Lists
- List endpoints
src/shopping-list/shopping-list.controller.ts - Create list
src/shopping-list/use-cases/create-shopping-list.use-case.ts - List queries
src/shopping-list/use-cases/find-all-shopping-lists.use-case.ts - Find list
src/shopping-list/use-cases/find-shopping-list-by-id.use-case.ts - Remove list
src/shopping-list/use-cases/remove-shopping-list.use-case.ts - Rename list
src/shopping-list/use-cases/rename-shopping-list.use-case.ts - Expiry date helper
src/utils/set-expiration-date-shopping-list.ts
Persistence
- User module
src/users/users.module.ts - User repository
src/users/repositories/typeorm-user.repository.ts - User records
src/users/entities/user.entity.ts - PostgreSQL / TypeORM
src/database/database.module.ts - List repository
src/shopping-list/repositories/type-orm-shopping-list.repository.ts - Shopping lists
src/shopping-list/entities/shopping-list.entity.ts
Other components
- API client
Connections 31
- API client → Nest bootstrap: sends requests
- Nest bootstrap → Application modules: starts app
src/main.ts - Application modules → Health endpoint: registers
src/app.module.ts - Application modules → Auth endpoints: registers
- Application modules → JWT guard: configures
src/app.module.ts - Application modules → List endpoints: registers
src/app.module.ts - Application modules → PostgreSQL / TypeORM: imports
src/app.module.ts - Health endpoint → Greeting service: calls
src/app.controller.ts - Auth endpoints → User registration: executes
src/auth/auth.controller.ts - Auth endpoints → User login: executes
src/auth/auth.controller.ts - User registration → User repository: uses
src/auth/use-cases/register-user.use-case.ts - User login → User repository: uses
src/auth/use-cases/login-user.use-case.ts - User module → User repository: provides
src/users/users.module.ts - User repository → User records: reads/writes
src/users/repositories/typeorm-user.repository.ts - PostgreSQL / TypeORM → User records: maps
src/database/database.module.ts - PostgreSQL / TypeORM → Shopping lists: maps
src/database/database.module.ts - API client → Auth endpoints: registers or logs in
- API client → List endpoints: manages lists
- List endpoints → Create list: executes
src/shopping-list/shopping-list.controller.ts - List endpoints → List queries: executes
src/shopping-list/shopping-list.controller.ts - List endpoints → Find list: executes
src/shopping-list/shopping-list.controller.ts - List endpoints → Remove list: executes
src/shopping-list/shopping-list.controller.ts - List endpoints → Rename list: executes
src/shopping-list/shopping-list.controller.ts - Create list → List repository: uses
src/shopping-list/use-cases/create-shopping-list.use-case.ts - Create list → User repository: uses
src/shopping-list/use-cases/create-shopping-list.use-case.ts - Create list → Expiry date helper: calculates expiry
src/shopping-list/use-cases/create-shopping-list.use-case.ts - List queries → List repository: uses
src/shopping-list/use-cases/find-all-shopping-lists.use-case.ts - List queries → User repository: uses
src/shopping-list/use-cases/find-all-shopping-lists.use-case.ts - Rename list → List repository: uses
src/shopping-list/use-cases/rename-shopping-list.use-case.ts - List repository → Shopping lists: reads/writes
src/shopping-list/repositories/type-orm-shopping-list.repository.ts - List repository → PostgreSQL / TypeORM: persists via