How nayzflux/avermate works
High-Level Architecture Overview
The system follows a modern full-stack architecture with these main components:
a) Frontend Layer (Next.js Application):
• Sub-components:
• Authentication Module
• Dashboard Module
• Grade Management
• Profile Management
• Landing Pages
• Settings Management
b) Backend Layer (Hono API):
• Sub-components:
• Auth Routes
• Grade Routes
• Subject Routes
• Period Routes
• User Routes
• Average Calculation Service
c) Database Layer:
• With Drizzle ORM layer
Component Relationships
• Client → API (REST calls)
• API → Database (via Drizzle ORM)
• Auth Flow (including social authentication)
• File Upload Flow (for avatars/images)
Key Technical Elements
Specific components:
Frontend:
• React Query for state management
• shadcn/ui + magic ui for UI components
• TailwindCSS for styling
• Custom hooks layer
• Type definitions layer
Backend:
• Rate limiting middleware
• Session management
• Email service (Resend)
• Upload handling (UploadThing)
Specific Implementation Details
a) Authentication Flow:
• Social auth providers
• Email verification
• Password reset flow
b) Grade Management Flow:
• Grade calculation pipeline
• Period management
• Subject organization
c) Data Flow:
• How data moves from user input to storage
• Average calculation process
• Data aggregation for dashboard
Important Notes
• Microservices-like structure with apps/api and apps/client
• Clear separation between frontend routes and API endpoints
• Real-time calculation features
• Planned integration points for future ED (external data) sync