How simplon-alt-dist-p7/teamly-api works
Teamly is a NestJS API for account access and restaurant-team operations. The principal workflow is an owner authenticating, creating a restaurant, then managing its employees; employee creation also provisions an employee account. The tree shows additional shift scheduling and task-list capabilities, including CQRS-style handlers. Source excerpts establish the auth, restaurant, employee and task request paths; several shift/task handler internals and provider bindings were not sampled, so those links are shown only where evidenced or marked unverified.
Main entry points: app.module.ts Nest app · employee.service.ts Employee service · auth.service.ts Auth service · auth.controller.ts Auth endpoints
Components 23
API entry
- Nest app
src/app.module.ts
Identity
- Auth endpoints
src/auth/auth.controller.ts - Auth service
src/auth/auth.service.ts - JWT guard
src/auth/auth.guard.ts - Prisma service
prisma/prisma.service.ts - Email sender
src/email/email-sender.ts
Restaurant operations
- Restaurant endpoints
src/restaurant/restaurant.controller.ts - Restaurant service
src/restaurant/restaurant.service.ts - Restaurant repository
src/restaurant/data-access/restaurants.repository.ts - Restaurant adapters
src/restaurant/data-access/adapters - Employee endpoints
src/employee/employee.controller.ts - Employee service
src/employee/employee.service.ts - Employee repository
src/employee/data-access/employees.repository.ts - Employee adapters
src/employee/data-access/adapters
Shift scheduling
- Shift endpoints
src/shift/presentation/controller - Shift use cases
src/shift/applications/use-cases - Shift rules
src/shift/domain/models/shift.entity.ts - Shift persistence
src/shift/data-access
Task management
- Task endpoints
src/task/presentation/controller - Task use cases
src/task/applications/use-cases - Task models
src/task/domain/models/task-list.entity.ts - Task-list persistence
src/task/data-access
Other components
- API caller
Connections 27
- API caller → Auth endpoints: requests
src/auth/auth.controller.ts - API caller → Restaurant endpoints: requests
- API caller → Employee endpoints: requests
- API caller → Shift endpoints: requests
- API caller → Task endpoints: requests
- Nest app → Auth endpoints: registers
src/app.module.ts - Nest app → Restaurant endpoints: registers
src/app.module.ts - Nest app → Employee endpoints: registers
src/app.module.ts - Nest app → Shift endpoints: registers
src/app.module.ts - Nest app → Task endpoints: registers
src/app.module.ts - Auth endpoints → Auth service: calls
src/auth/auth.controller.ts - Auth service → Prisma service: queries
src/auth/auth.service.ts - Auth service → Email sender: sends email
src/auth/auth.service.ts - Restaurant endpoints → Restaurant service: calls
src/restaurant/restaurant.controller.ts - Restaurant service → Restaurant repository: uses
src/restaurant/restaurant.service.ts - Restaurant repository → Restaurant adapters: implemented by
src/restaurant/data-access/adapters/restaurants-in-memory.repository.ts - Employee endpoints → Employee service: calls
src/employee/employee.controller.ts - Employee service → Restaurant repository: checks owner
src/employee/employee.service.ts - Employee service → Auth service: creates account
src/employee/employee.service.ts - Employee service → Employee repository: reads writes
src/employee/employee.service.ts - Employee repository → Employee adapters: implemented by
src/employee/data-access/adapters/employees-prisma.repository.ts - Shift endpoints → Shift use cases: dispatches
src/shift/presentation/controller/shift.controller.ts - Shift use cases → Shift persistence: persists
- Shift persistence → Shift rules: maps entities
src/shift/data-access/adapters/shifts-prisma.repository.ts - Task endpoints → Task use cases: dispatches
src/task/presentation/controller/task-list.controller.ts - Task use cases → Task-list persistence: persists
- Task-list persistence → Task models: maps models
src/task/data-access/adapters/task-lists-prisma.repository.ts