How cassperrr/nestjs-project works
This NestJS monorepo provides a financial and account backend through a gateway and seven cooperating services. The principal path is a client request through the gateway to identity/account or transaction operations, with balance changes coordinated across services; related branches handle avatar storage, scheduled balance resets, email OTPs, and real-time transaction notifications. The graph also shows service-owned persistence and external integrations. Service capabilities and several cross-service links are documented in the README; the sampled source confirms gateway routing, OTP email dispatch, and file upload behavior, but does not expose every service implementation.
Main entry points: user-service.module.ts User service · gateway.module.ts Gateway API · transaction-service.module.ts Transaction service · auth.service.ts Auth workflows
Components 22
Request entry
- Gateway API
apps/gateway/src/gateway.module.ts
Identity and accounts
- User service
apps/user-service/src/user-service.module.ts - Auth workflows
apps/user-service/src/feat/auth/auth.service.ts - Account and profiles
apps/user-service/src/feat/account/account.service.ts - Balance management
apps/user-service/src/feat/balance/balance.service.ts - User database
apps/user-service/src/infra/prisma/prisma.module.ts - Redis state
apps/user-service/src/infra/redis/redis.module.ts
Financial operations
- Transaction service
apps/transaction-service/src/transaction-service.module.ts - Transaction database
apps/transaction-service/src/infra/prisma/prisma.module.ts
Supporting services
- File service
apps/file-service/src/file.module.ts - S3 avatar storage
apps/file-service/src/infra/storage/s3/s3-stream.storage.ts - Job service
apps/job-service/src/job.module.ts - Balance reset queue
apps/job-service/src/core/queue/queue.service.ts - Mail service
apps/mail-service/src/mail.controller.ts - Notification service
apps/notification-service/src/notification-service.module.ts - Notification history
apps/notification-service/src/infra/mongo/mongo.module.ts
Shared infrastructure
- Service contracts
contracts - gRPC integration
libs/grpc
Other components
- Client
- Yookassa
- SMTP mail transport
- WebSocket clients
Connections 25
- Client → Gateway API: sends requests
- Gateway API → User service: routes gRPC
- Gateway API → Transaction service: routes gRPC
- Gateway API → File service: proxies files
- User service → Auth workflows: handles identity
- User service → Account and profiles: handles accounts
- User service → Balance management: handles balances
- Auth workflows → User database: reads and writes
- Auth workflows → Redis state: stores sessions and OTPs
- User service → User database: persists user data
- User service → Redis state: caches user data
- User service → Mail service: sends OTP events
- Mail service → SMTP mail transport: sends email
- User service → Notification service: publishes events
- Notification service → Notification history: stores history
- Notification service → WebSocket clients: pushes notifications
- User service → Job service: requests jobs
- Job service → Balance reset queue: schedules resets
- Job service → Balance management: requests balance reset
- Transaction service → Transaction database: records transactions
- Transaction service → Yookassa: integrates payments
- User service → Transaction service: exchanges saga events
- File service → S3 avatar storage: streams avatar files
- Gateway API → gRPC integration: uses clients
- Gateway API → Service contracts: uses service contracts