How pedakihq/pedaki-community works
Main System Components
a) Frontend Layer:
• Next.js Application (app directory structure)
• Client-side Components
• Server Components
• Authentication UI
• Internationalization System
b) API Layer:
• tRPC API Routes
• NextAuth Authentication
• File Upload Handlers
• Health Check Endpoints
c) Service Layer:
• Academic Year Service
• Class Management Service
• Student Management Service
• Teacher Management Service
• File Storage Service
• Email Service
d) Data Layer:
• Prisma ORM
• Database
• File Storage (S3/Local)
• Cache System
Key Architectural Patterns to Highlight
Specific architectural elements:
a) Authentication Flow:
• NextAuth.js integration
• Session management
• Protected routes
b) Data Flow:
• tRPC router structure
• API endpoints
• Service layer interactions
• Database operations
c) Feature Modules:
• Class Generation Algorithm
• Student Import System
• User Management
• Settings Management
┌─ Client Layer ─────────────────────┐
• Next.js Pages/Components │
• React Components │
• Store Management │
• ┬───────────────────┘
• ↓
┌─ API Layer ────────────────────────┐
• tRPC Routes │
• NextAuth Endpoints │
• Upload Handlers │
• ┬───────────────────┘
• ↓
┌─ Service Layer ─────────────────────┐
• Business Logic │
• Data Processing │
• External Service Integration │
• ┬───────────────────┘
• ↓
┌─ Data Layer ───────────────────────┐
• Prisma ORM │
• Database │
• File Storage │
• ┘
Important Connections
Key interactions:
• Authentication flow between frontend and NextAuth
• API requests through tRPC
• File upload paths
• Database operations through Prisma
• External service connections (Resend for email)
Deployment Architecture
Deployment structure:
• Docker containers
• Production vs Development environments
• Required external services
Remember to highlight the modular nature of the system, especially the packages structure which includes separate modules for algorithms, API, authentication, database, and services.
This will provide a comprehensive view of the system while maintaining clarity about how different components interact with each other.