How ruangustavo/ifrncalc works
Main Components
a. Client-Side Layer:
• Next.js frontend components structure
• Main pages (/dashboard, root page)
• UI components library
• State management using the store
b. Authentication Layer:
• NextAuth.js integration
• SUAP OAuth2 connection
• Session management
c. Server-Side Layer:
• API routes
• Server actions
• Grade calculation logic
d. External Services:
• SUAP API integration
[Client Layer]
• ↑↓
[Server Layer]
• ↑↓
[External Services]
Detailed Component Breakdown
Client Layer:
• Main pages: /(root), /dashboard
• Components structure:
• UI components (from /components/ui)
• Dashboard components
• Theme components
• Zustand store (grades.ts)
Server Layer:
• API routes (/api/auth/[...nextauth])
• Server actions (get-grades.ts)
• Grade calculation utilities
Authentication Flow:
• NextAuth.js configuration
• SUAP OAuth2 flow
• Session management
Key Relationships to Highlight
• How the authentication flow connects the client to SUAP
• Demonstrate data flow from SUAP API through server actions to the client
• State management flow with the grades store
• Theme provider context flow
Additional Elements
• Environment configuration section
• Build/deployment flow
• Error handling paths
• Caching mechanisms if any
Specific Architectural Patterns to Highlight
• Next.js App Router structure
• Server Components vs Client Components
• OAuth2 flow with NextAuth.js
• State management with Zustand
• Component types
• Flow direction conventions
• Any special symbols used
This will help other developers understand the system architecture at a glance while providing enough detail for implementation and maintenance.