How git-denial/admin_dashboard works
Main System Components
a) Frontend Layer:
• Subdivide into two main routes:
• Authenticated Routes (/cardiologists, /consultations, /users, /settings)
• Unauthenticated Routes (/login)
b) API Layer:
• Main API modules visible in /src/app/api:
• AdminAPI
• CardiologistAPI
• ChatAPI
• ConsultationAPI
• UserAPI
c) Server Actions Layer:
• Four main actions:
• Admin Actions
• Cardiologist Actions
• Consultation Actions
• User Actions
d) Database Layer:
• Prisma ORM
• Database (likely PostgreSQL based on prisma/schema.prisma)
Component Relationships
• Client → API Services (REST/HTTP)
• API Services → Server Actions
• Server Actions → Prisma ORM
• Prisma ORM → Database
Authentication Flow
• Auth Provider (visible in src/lib/auth.ts)
• Authentication flow between client and server
• Protected route middleware (src/middleware.ts)
UI Component Library
• Relationship to main application
• Major components like:
• Data Tables
• Forms
• Dialogs
• Common UI Elements
Additional Elements
• Testing infrastructure (E2E and Unit tests)
• Utility services (src/utils)
• Configuration (environment, build tools)
Specific Implementation Details
Notes for:
• Next.js 13+ App Router architecture
• Server/Client component separation
• API route structure
• Database schema relationships
• → Synchronous data flow
• ⇢ Asynchronous data flow
• 🔒 Protected routes/actions
• 📡 API endpoints
• 💾 Data persistence
• 🔄 State management
Remember to highlight the real-time aspects of the consultation system, especially in the chat functionality, as indicated by the chatBox components in the consultations section.