How amarm0t/diu-cgpa-calculator works
DIU Student Portal is a full-stack transcript lookup and CGPA platform. A student submits portal credentials in the Next.js app; FastAPI manages the streamed lookup, queue and scraper, which retrieves transcript data, calculates results and caches them for display. The admin panel provides Google-authenticated oversight of records, cache and queue activity, with an alternate password sign-in path. The README documents capabilities such as CAPTCHA relay and progressive semester streaming; some implementation details are unsampled, so the graph limits those links to documented or indexed relationships.
Main entry points: app.py FastAPI endpoints · scraper.py Portal scraper · page.tsx Lookup interface · db.py Result cache
Components 20
Student frontend
- Lookup interface
frontend/src/app/page.tsx - Transcript display
frontend/src/lib/transcript.ts - Session wrapper
frontend/src/components/SessionWrapper.tsx
Lookup service
- FastAPI endpoints
backend/app.py - Scrape queue
backend/queue_manager.py - Portal scraper
backend/scraper.py - Browser pool
backend/browser_pool.py - CAPTCHA relay
backend/scraper.py - CGPA calculator
backend/cgpa_calculator.py
Administration
- Admin panel
frontend/src/app/admin/page.tsx - Google OAuth
frontend/src/app/api/auth/[...nextauth]/route.ts - Admin token checks
backend/auth.py - Admin password auth
backend/admin_auth.py
Data storage
- Result cache
backend/db.py - Task history
backend/task_history.py - Supabase
- SQLite fallback
- History SQLite
Other components
- Student
- Google identity
Connections 21
- Student → Lookup interface: submits credentials
README.md - Lookup interface → FastAPI endpoints: requests streamed lookup
README.md - FastAPI endpoints → Scrape queue: allocates slots
backend/app.py - FastAPI endpoints → Portal scraper: starts lookup
backend/app.py - Portal scraper → Browser pool: uses browsers
backend/scraper.py - Portal scraper → CAPTCHA relay: relays clicks
backend/scraper.py - FastAPI endpoints → CAPTCHA relay: dispatches clicks
backend/app.py - Portal scraper → CGPA calculator: calculates GPA
backend/scraper.py - Portal scraper → Result cache: reads and caches
backend/scraper.py - FastAPI endpoints → Result cache: checks settings
backend/app.py - FastAPI endpoints → Task history: records task outcomes
backend/app.py - FastAPI endpoints → Admin token checks: checks admin identity
backend/app.py - FastAPI endpoints → Admin password auth: handles password sign-in
backend/app.py - Admin panel → FastAPI endpoints: requests admin actions
README.md - Google OAuth → Google identity: authenticates and refreshes
frontend/src/app/api/auth/[...nextauth]/route.ts - Session wrapper → Google OAuth: uses sessions
- Lookup interface → Transcript display: renders results
- Portal scraper → Lookup interface: streams semester results
README.md - Result cache → Supabase: uses cloud database
README.md - Result cache → SQLite fallback: falls back locally
README.md - Task history → History SQLite: stores task records
backend/task_history.py