How indogegewepe/skripsiku works
Project Type and Purpose
This is a full-stack, web-based academic scheduling system (“UAD Course Scheduler”) that exposes a Nuxt.js 3 frontend for administrators to define constraints and view schedules, a FastAPI backend running the Grey Wolf Optimizer (GWO) algorithm to compute timetables, and Supabase (PostgreSQL + RLS) as the persistence layer. It supports dynamic constraint management, real-time validation, analytics, and PDF/Excel export.
File Structure Analysis
• Top-level:
– backend/ (FastAPI endpoints, GWO code, models, schemas, scripts, Dockerfile)
– frontend/ (Nuxt.js app with pages, components, composables, config, Dockerfile)
– docker-compose.yml (orchestrates services locally)
– test/ (sample data, notebooks)
• frontend/app: subdivided into pages (CRUD UIs, scheduling, export), components (forms, tables), composables (useApi.ts).
• backend: modules like models.py, schemas.py, routers (inferred), gwo-related scripts (process.py, get_statistics.py), main.py.
• Config: .env templates, Dockerfiles in both frontend & backend, Vercel/Railway JSON.
README Insights
• Tech stack:
– Frontend: Nuxt.js 3, Tailwind CSS, Pinia
– Backend: FastAPI, Python 3.11, Uvicorn
– Database: Supabase (PostgreSQL + Row Level Security)
– Optimization: numpy, pandas, custom GWO
– Deploy: Vercel (frontend), Railway (backend)
• Directory hints at supabase/ SQL migrations (triggers, functions).
Diagramming the Architecture
a. Main Components
• Client / Presentation Layer: Browser (Vue/Nuxt.js pages, components, Pinia state)
• API Layer: Nuxt server (SSR), useApi composable → HTTP(s)
• Application / Backend Layer: FastAPI app with routers (optimize, get statistics, CRUD), GWO engine module
• Database Layer: Supabase PostgreSQL + RLS + stored functions/triggers
• External Services / Deployment: Vercel (frontend host), Railway (backend host), Docker (local), CI/CD.
b. Relationships & Data Flow
1. User interacts with Nuxt.js UI → HTTP requests via useApi.
2. Requests hit FastAPI endpoints (uvicorn).
3. FastAPI loads dynamic constraints from Supabase (via async client).
4. GWO engine executes (async + parallel), reads/writes intermediate data → persists schedule to Supabase.
5. Backend returns results to frontend; UI renders timetables/heatmaps.
6. Export endpoints generate PDF/Excel on demand (backend → file → client).
c. Architectural Patterns & Principles
• Layered Architecture (presentation, API, business logic, data)
• Single-page app with SSR (Nuxt)
• API-driven micro-layer (FastAPI routers)
• Eventual consistency / async optimization engine
• Infrastructure as code (Docker, docker-compose)
• Separation of concerns: “composables” for data logic, “routers” for endpoints, “gwo” for algorithm.
d. Key Technologies & Libraries
• Vue/Nuxt.js 3 + Tailwind + Pinia
• FastAPI + Uvicorn + Pydantic (schemas)
• PostgreSQL via Supabase (Row Level Security, RPC)
• numpy, pandas for compute
• Docker, docker-compose, Vercel, Railway.
– Browser / UI (Nuxt.js)
– API Layer (FastAPI + routers)
– GWO Engine (async scheduler)
– Supabase DB
– Export Service
– Deployment (Vercel, Railway)
– Solid for sync calls (HTTP)
– Green for Frontend, Blue for Backend, Orange for Database, Gray for Infrastructure
– Rectangles for services/components
Detail and Precision
You capture:
– All major endpoints (optimize, get-stats, CRUD)
– The flow of constraint fetching and schedule persistence
– The separation of SSR vs. client-side logic in Nuxt
– Dev vs. prod differences (docker-compose vs. Vercel/Railway)