How affan-devs/capstone-project works
This is a NestJS backend for a lesson-booking marketplace, with learner/instructor accounts, bookings, instruction records, communications, administration, and payment processing. The primary evidenced flow is authenticated HTTP requests into feature controllers and services, with services accessing Prisma persistence; authentication also issues tokens and notifications, while refund orchestration resolves payment attempts and invokes refund-state handling. The README is an untouched NestJS starter description, so product capabilities are inferred from the source tree. Edges are limited to relationships shown in supplied excerpts or SOURCE INDEX references; unsampled internals are represented conservatively.
Main entry points: auth.service.ts User authentication · prisma.service.ts Relational persistence · refund-execution-orchestration.service.ts Refund orchestration · upload.controller.ts Document uploads
Components 32
Identity and access
- User authentication
src/auth/auth.service.ts - Login throttling
src/auth/account-login-throttle.service.ts - Admin authentication
src/admin-auth/admin-auth.service.ts - JWT and role guards
src/common/guards - Current-user decorator
src/common/decorators/current-user.decorator.ts - Role metadata
src/common/decorators/roles.decorator.ts
Lesson marketplace
- Learners and profiles
src/users/users.service.ts - Instructor profiles
src/instructors/instructors.service.ts - Document uploads
src/instructors/upload.controller.ts - Lesson bookings
src/bookings/bookings.service.ts - Cancellation slots
src/cancellation-slots - Learner-instructor chat
src/chat/chat.service.ts - Learning records
src/learner-records - Lesson summaries
src/lesson-summaries - Learner progress
src/progress - Reviews
src/reviews/reviews.service.ts - Admin operations
src/admin/admin.service.ts
Payments and finance
- Refund orchestration
src/payments/charges/refund-execution-orchestration.service.ts - Refund attempt state
src/payments/charges/refund-attempt-state.service.ts - Payment attempt resolution
src/payments/charges/booking-charge-payment-attempt-resolver.service.ts - Student payments
src/payments/student - Stripe webhooks
src/payments/webhooks - Payment disputes
src/payments/disputes - Instructor payment accounts
src/payments/connect
Shared platform
- Notifications
src/notifications/notification-publisher.ts - Email delivery
src/common/email.service.ts - Document redaction
src/instructors/redaction.utils.ts - Logging utilities
src/common/utils/logging.utils.ts - Relational persistence
src/prisma/prisma.service.ts - Supabase storage
src/common/supabase/supabase.service.ts
Other components
- API client
- Stripe
Connections 32
- API client → User authentication: authenticates via
- User authentication → Relational persistence: reads and writes
src/auth/auth.service.ts - User authentication → Login throttling: checks throttling
src/auth/auth.service.ts - User authentication → Email delivery: sends email
src/auth/auth.service.ts - User authentication → Notifications: publishes events
src/auth/auth.service.ts - API client → Admin authentication: authenticates via
- Admin authentication → Relational persistence: reads and writes
src/admin-auth/admin-auth.service.ts - Admin authentication → Login throttling: checks throttling
src/admin-auth/admin-auth.service.ts - API client → Lesson bookings: requests lessons
- API client → Learner-instructor chat: sends messages
- API client → Instructor profiles: manages profile
- Document uploads → Relational persistence: reads and writes
src/instructors/upload.controller.ts - Document uploads → Supabase storage: stores documents
src/instructors/upload.controller.ts - Document uploads → Document redaction: sanitizes names
src/instructors/upload.controller.ts - API client → Admin operations: manages marketplace
- Admin operations → Document redaction: redacts documents
src/admin/admin.controller.ts - API client → Student payments: manages payment setup
src/payments/student/student-payments.controller.ts - Refund orchestration → Payment attempt resolution: resolves payment
src/payments/charges/refund-execution-orchestration.service.ts - Refund orchestration → Refund attempt state: updates attempt state
src/payments/charges/refund-execution-orchestration.service.ts - Refund orchestration → Relational persistence: reads booking
src/payments/charges/refund-execution-orchestration.service.ts - Refund orchestration → Notifications: publishes refund events
src/payments/charges/refund-execution-orchestration.service.ts - Reviews → Relational persistence: reads and writes
src/reviews/reviews.service.ts - Reviews → Document redaction: redacts content
src/reviews/reviews.service.ts - JWT and role guards → Role metadata: checks role metadata
src/common/guards/roles.guard.ts - API client → Learning records: uses learning features
- API client → Lesson summaries: uses learning features
- API client → Learner progress: tracks progress
- API client → Cancellation slots: manages availability
- API client → Student payments: pays for lessons
- Stripe webhooks → Stripe: receives events
- Payment disputes → Stripe: handles disputes
- Instructor payment accounts → Stripe: connects accounts