
An AI "Student Operating System" for South African students, study planning, NSFAS budgeting, wellness and careers around an AI chief-of-staff, Nova.
View the product pageThe problem
Brilliant students arrive at university without the tutor/advisor/mentor networks privileged students take for granted, and must operate on prepaid budget Android devices, expensive data, and Stage-8 load shedding. VarsityOS is built as resilient, low-data, offline-capable infrastructure for that student.
.jpg&w=3840&q=75)
Architecture
A container-level view of the real system, the boundaries, the trust edges, and where intelligence and money actually flow.
Standard CRUD writes go client→Supabase with RLS as the auth boundary; AI paths route through rate-limited /api handlers with an atomic quota RPC. Subscriptions are verified by an internal hub and forwarded to a hub-authenticated webhook, this app never holds a Paystack secret.
.jpg&w=3840&q=75)
By the numbers
149
tables · all under RLS
391
RLS policies · 220 indexes
132
API route handlers
11
SA languages
Stack
Intelligence
Nova runs on Anthropic Claude (claude-sonnet-4-6) with two-block prompt caching, an ~8k-token SA / NSFAS / crisis knowledge base cached ephemeral, plus a small live-student block. A 10-substring crisis keyword prefilter (detectCrisis) runs before any API call, and Claude vision handles image analysis on the same route (max_tokens raised to 2048 when an image is attached).
Data model
149 tables · 391 RLS policies · 220 indexes · 88 migrations
Key decisions
Architecture Decision Records, the trade-offs made deliberately, in the open.
.jpg&w=3840&q=75)
The hard parts, solved
try_use_nova_message(user, month_key, limit) does SELECT … FOR UPDATE so concurrent requests queue instead of racing, closing the gap where two requests both pass the cap and both call Anthropic. The monthly reset happens inside the same lock (if the stored YYYY-MM ≠ current, reset to 1), so the limit self-heals with zero scheduled job.
Eight-plus Inngest cron functions, every one pinned to Africa/Johannesburg and tuned to a student’s day, exam reminders 07:00, a morning brief 07:30, an NSFAS late-payment alert 09:00, a study-gap nudge 10:00, an attendance alert 18:00, a wellness nudge 19:00, a budget alert 20:00, and a weekly digest Sunday 20:00.
Before each Nova call the route assembles a live student context from ~11 parallel Supabase queries (tasks, exams, budget, a 7-day wellness trend, XP, grades, saved bursaries), runs detectHeavyTopic() over the last 14 messages against 14 subject keyword sets, and injects tiered usage guidance that caps power-user answers (<130 words) and redirects to free SA resources, protecting margin without a hard cutoff.
Sourced from campus-compass, README (v2), BUILD_JOURNEY_VARSITYOS, supabase/migrations (86), src/app/api/nova, src/lib/inngest.
.jpg&w=3840&q=75)
Keep exploring