Inspiration

Our campus ran on a patchwork of apps. Teachers tracked attendance in spreadsheets, students hunted for announcements in chat threads, and course materials lived in yet another portal. Meanwhile, campus rivalries, achievements, and reputation happened entirely offline — invisible and unverifiable.

We started Technoviz Summer of Code with one question: Can we build an open-source campus operating system that is not just administrative, but alive?

What we built

gecX is a unified, role-based campus platform built on Next.js, TypeScript, Prisma, and PostgreSQL. It serves four roles:

  • Admin — manage users, classes, courses, seasons, support tickets, and economy rules
  • Teacher — track attendance, build courses, manage assignments, and judge academic wars
  • Student — view schedules, enroll in courses, earn karma and GecX, compete in wars, and customize profiles
  • Parent — see linked children's schedules, attendance, and academic updates

The platform is wrapped as a PWA and scaffolded for Android/iOS through Capacitor.

What makes it different

Most edtech tools stop at attendance and results. gecX adds a reputation and competition layer called Student Wars. It includes:

  1. Knowledge Duel — synchronous MCQ and open-answer showdowns
  2. Karma Sprint — race to earn karma by helping classmates
  3. Attendance Siege — discipline-driven attendance battle
  4. Creative Clash — community-judged explanations and diagrams
  5. Speed Round — fast-reaction MCQ drops
  6. Silent War — attendance-only ego challenge
  7. Reputation War — neutral third-party votes only
  8. Wildcard — random mode reveal at go-time

Each mode has explicit anti-gaming rules, ally roles, duration limits, and fallback logic, making campus competition fair, dramatic, and measurable.

How we built it

  • Framework: Next.js 14 App Router with Server Components and Server Actions
  • Language: TypeScript
  • Database: PostgreSQL + Prisma ORM
  • Auth: Clerk with custom role claims
  • Real-time: Ably for messaging
  • Media: Cloudinary for uploads
  • AI: Google Gemini for campus insights
  • UI: Tailwind CSS, shadcn/ui, Radix UI, Framer Motion, Lucide icons
  • Forms & state: react-hook-form, Zod
  • Charts & calendar: Recharts, react-big-calendar
  • Installability: next-pwa + Capacitor
  • Deployment: Docker, docker-compose, Node.js 18

We modeled the war system in a dedicated design document, translated it into Prisma schema and server actions, and hardened multi-step flows with Prisma $transaction blocks.

Challenges we faced

  1. Role-aware routing — Clerk public metadata had to be exposed as custom session claims and consumed in middleware, server components, and server actions. Stale tokens caused redirect bugs, so we enforced explicit sign-out-and-back-in flows and added debug snippets.

  2. Atomic war state transitions — Approving a rivalry required creating a server, channels, members, and updating rivalry status across multiple writes. We refactored these into atomic transactions to prevent orphan records and race conditions.

  3. Anti-gaming design — Karma Sprint and Reputation War had to exclude votes from friends, allies, and branchmates. We defined strict neutrality rules and audit flows before writing scoring logic.

  4. Latency fairness in Speed Round — We designed client timestamp normalization over WebSockets so slower internet does not disadvantage a faster correct answer.

  5. Mobile readiness — We scaffolded a Capacitor build and PWA configuration early so the web app could behave like a native campus app.

What we learned

  • Transactions are non-negotiable. Multi-step UI flows are fragile without atomic commits and idempotency guards.
  • Gamification needs governance. Points without anti-gaming rules become popularity contests.
  • Open-source practice matters. Clean commits, clear documentation, and reproducible Docker setup make a project usable by others long after the program ends.
  • Campus software is deeply social. Modeling real-world campus dynamics (CRs, teachers, rival branches) into fair, transparent rules was harder than the code itself.

Future scope

  • Full AI assistant for attendance risk alerts and automated reports
  • Ably real-time war rooms with live scoreboards
  • Complete Capacitor iOS/Android app with push notifications
  • Payment integration for GecX marketplace and campus fees
  • Offline-first PWA features for low-connectivity campuses
  • SSO and deeper LMS integrations

Built With

Share this project:

Updates

Submission history