How 78-artilleryman/lily-server works
Main System Components
a) API Layer
• Entry point (main.ts)
• Controllers (app.controller, auth.controller)
• Guards (JWT, Roles)
b) Service Layer
• Application services (app.service, auth.service, user.service)
• Business logic implementation
c) Database Layer
• Prisma ORM integration
• Database migrations
• Schema definitions
d) Authentication System
• Multiple OAuth providers (Google, Kakao, Naver)
• JWT implementation
• Strategy patterns
┌─────────────────────────────────────────────────────────┐
• Client Requests │
• ┘
• ↓
┌─────────────────────────────────────────────────────────┐
• Nginx Reverse Proxy │
• ┘
• ↓
┌─────────────────────────────────────────────────────────┐
• NestJS Application │
• ┌───────────────┐ ┌───────────────┐ ┌────────────┐ │
• Controllers │ │ Guards │ │ Modules │ │
• ┘ └───────────────┘ └────────────┘ │
• ↓ ↓ ↓ │
• ┌───────────────┐ ┌───────────────┐ ┌────────────┐ │
• Services │ │ Strategies │ │ Prisma │ │
• ┘ └───────────────┘ └────────────┘ │
• ┘
• ↓
┌─────────────────────────────────────────────────────────┐
• Database │
• ┘
Component Relationships
Interactions:
• Database interactions through Prisma
• Request flow through guards and controllers
• Service dependencies
Important Details
a) Authentication Flow:
• OAuth2 providers (Google, Kakao, Naver)
• JWT token flow
• Role-based access control
b) Database Schema:
• Prisma models
• Migration patterns
• Relationship between entities
c) API Structure:
• Route hierarchies
• Middleware chain
• Guard implementation
Infrastructure Elements
Include:
• Docker container boundaries
• Nginx configuration
• AWS deployment setup (referenced in appspec.yml)
Development/Production Environments
Highlight:
• Development setup
• Production deployment flow
• Testing infrastructure
Remember to:
• Clear boundaries between components
• Notes for important configuration details
• Document all external service integrations