DEV Community

Cover image for TutorLoop: A Local-First, FERPA-Compliant AI Session Closer for Student Tutors
Ranbeer Singh
Ranbeer Singh

Posted on AI-assisted

TutorLoop: A Local-First, FERPA-Compliant AI Session Closer for Student Tutors

Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle Submission πŸ’Έ

#hf26challenge #devchallenge #render #ai #opensource

Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle Submission πŸ’Έ

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle.


🎯 What I Built

Student tutorsβ€”high school upperclassmen and university students tutoring K-12 peers in math, chemistry, SAT prep, and codingβ€”run a real, thriving side hustle. They already earn $25–$50 per hour. They genuinely love teaching, but they face a brutal post-session administrative bottleneck.

After an exhausting 60- or 90-minute tutoring session, the last thing a tired student tutor wants to do is spend 30 to 45 minutes of unpaid time on tedious administrative chores:

  1. The Diplomatic Parent Recap: Parents expect an encouraging, professional update explaining what their child mastered. But tutors struggle with copywriter's block and fear framing mistakes too harshly, which could cause parental anxiety.

  2. The Homework Assignment: Turning chaotic whiteboard scribbles and notebook scratch paper into structured, bite-sized practice problems.

  3. The Invoice & Ledger: Calculating hours Γ— hourly rate, generating invoice numbers, tracking who has paid, and asking for money.

When student tutors turn to generic cloud AI tools like ChatGPT, they run into two massive dealbreakers:

  1. The FERPA & Minor Privacy Hazard (Cloud Leak Risk): Tutoring notes contain deeply sensitive minor data: a 14-year-old child's full name, grades, schools, parent phone numbers, and sensitive behavioral/learning notes ("struggled with vertex formula due to ADHD focus lapse"). Sending children's confidential records to third-party commercial cloud APIs with unpredictable data retention policies violates student privacy ethics (and student privacy laws like FERPA and COPPA).
  2. SaaS Subscription Fatigue & Negative Unit Economics: Student tutors operate on tight margins. Paying $20–$40/month for SaaS wrappers or per-token API charges takes a painful 5%–10% bite out of their hard-earned tutoring income.

Enter TutorLoop πŸš€

TutorLoop is a privacy-first, local AI session closer engineered specifically for student tutors, peer educators, and freelance instructors.

In under 10 seconds, TutorLoop turns messy post-class scribbles or a whiteboard photo into:

  • πŸ’¬ Parent-Facing Recap: Warm, encouraging, pedagogical progress update ready for WhatsApp or Email in 1 click.

Parent-Facing Recap

  • πŸ“ Next-Week Homework Checklist: Clean, numbered action items formatted for Discord or SMS.

Next-Week Homework Checklist

  • 🧾 Instant Calculated Invoice: Hours Γ— hourly rate, due dates, payment instructions (Venmo, Zelle, CashApp, UPI), and a 1-click printable PDF receipt.

Instant Calculated Invoice

  • πŸ›‘οΈ Zero Cloud Leak Guarantee: Powered by open-weight Google Gemma 2 (gemma2:2b) running 100% locally via Ollama with local SQLite persistence. Zero bytes ever leave the tutor's laptop.

Zero Cloud Leak Guarantee


πŸ’Ό Who Would Pay For It?

  • High School & University Student Tutors: Willing to pay $5–$10/month (or a one-time $29 desktop utility purchase) to eliminate the dread of post-class admin and get paid 3x faster with instant professional invoices.
  • Independent Tutoring Collectives & Music/Language Instructors: Managing 10+ students locally from a single workstation without incurring recurring token fees or violating student data privacy.

🌐 Live Demo & Interactive Sandbox

Experience the live interactive build hosted on Render:
πŸ”— Live Application: https://tutorloop.onrender.com/

(The hosted Render sandbox includes pre-seeded demo students, past session ledgers, and one-click presets for Math, Chemistry, and SAT Prep. For daily tutoring, tutors run TutorLoop locally on their laptop so student data never leaves their machine).

Core Interfaces in TutorLoop:

  1. The Session Closer Studio: Instant note input with 1-click presets (AP Calculus, Chemistry Stoichiometry, SAT Reading), whiteboard photo drop zone, duration selector, and one-click Gemma generation.
  2. Parent Communication Hub: Clean editable recap cards with 1-click Copy for WhatsApp and pre-populated Open in Email (mailto:) links.
  3. Printable Invoice & Receipt Modal: Official receipt layout with @media print CSS for instant PDF downloading or printing.
  4. Financial Dashboard & Session Ledger: Lifetime revenue tracking, collected earnings, unpaid balances, and session history with status toggles.
  5. Student Roster Manager: Full directory storing custom hourly rates, parent phone numbers, preferred communication channels, and learning notes in local SQLite.
  6. Local AI Engine Diagnostics: Live ping monitor verifying local Ollama connectivity, model status, and terminal cheat sheet (ollama run gemma2:2b).

Code

The complete source code is published on GitHub under the MIT License:

πŸŽ“ TutorLoop β€” Local-First Session Closer for Student Tutors

Built for Hacktoberfest 2026: Open-Source AI "Side Hustle" Challenge
Transform post-lesson scribbles into parent recaps, student homework, and invoices in seconds β€” powered by open-weight Google Gemma 2, running 100% offline.

License: MIT Framework: Next.js Model: Google Gemma 2 Database: SQLite Deployed on: Render Privacy: FERPA Compliant


πŸ’‘ The Problem: The $30/hr Hustle with a 45-Minute Post-Class Hangover

Student tutors (high school and university students teaching K-12 peers in Math, Science, and Coding) already get paid $25–$50/hour. They love teaching, but dread the unpaid 30–45 minutes of tedious administrative work after every single lesson:

  1. The Parent Recap: Parents want an encouraging, professional update explaining what their child mastered, but students struggle with how to frame struggles diplomatically without sounding alarming.
  2. The Homework Assignment: Turning chaotic whiteboard formulas into clean, numbered action items for next week.
  3. The Invoice: Multiplying hours Γ— hourly rate, tracking unpaid balances, and generating receipts.

Because this admin work is tedious and unpaid, tutors…

Project Structure

tutorloop/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”‚   β”œβ”€β”€ generate/route.ts       # AI Session generation endpoint (Gemma 2)
β”‚   β”‚   β”‚   β”œβ”€β”€ ollama/status/route.ts  # Local Ollama connection & model diagnostics
β”‚   β”‚   β”‚   β”œβ”€β”€ sessions/route.ts       # Session ledger REST API (CRUD + status toggle)
β”‚   β”‚   β”‚   β”œβ”€β”€ settings/route.ts       # Tutor profile & payment preferences
β”‚   β”‚   β”‚   └── students/route.ts       # Student roster & rate management
β”‚   β”‚   β”œβ”€β”€ globals.css                 # Tailwind v4 styles + print stylesheet
β”‚   β”‚   β”œβ”€β”€ layout.tsx                  # Root metadata and font configuration
β”‚   β”‚   └── page.tsx                    # Main app tab router (Closer, Ledger, Roster, Settings)
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ DashboardView.tsx           # Financial analytics & session history ledger
β”‚   β”‚   β”œβ”€β”€ InvoiceModal.tsx            # Printable invoice receipt with PDF print styles
β”‚   β”‚   β”œβ”€β”€ Navbar.tsx                  # Navigation bar with live Gemma AI status pill
β”‚   β”‚   β”œβ”€β”€ SessionCloser.tsx           # The core AI closer studio & preset runner
β”‚   β”‚   β”œβ”€β”€ SettingsView.tsx            # Tutor handles, currency, and Ollama configuration
β”‚   β”‚   └── StudentsView.tsx            # Student directory with add/edit modal
β”‚   └── lib/
β”‚       β”œβ”€β”€ db.ts                       # SQLite engine (better-sqlite3, WAL mode, auto-seeder)
β”‚       └── gemma.ts                    # Google Gemma 2 connector + local fallback engine
β”œβ”€β”€ render.yaml                         # Render Cloud Deployment Blueprint
β”œβ”€β”€ package.json                        # Next.js 16 + React 19 + Tailwind v4 + SQLite
└── README.md                           # Comprehensive documentation
Enter fullscreen mode Exit fullscreen mode

πŸ› οΈ How I Built It

TutorLoop is built on modern, local-first open-source architecture designed for speed, privacy, and zero operational costs:

1. Local AI Inference with Google Gemma 2

  • Inference Engine: Ollama running natively on the local machine, exposing its REST server on http://localhost:11434/api/chat.
  • Model: gemma2:2b (Google's open-weight model quantized to 1.6 GB). Its efficient architecture allows it to run lightning-fast on everyday student laptops without requiring a high-end dedicated GPU.
  • Provider Isolation & Heuristic Fallback: If Ollama is offline or the user hasn't downloaded the weights yet, TutorLoop seamlessly activates an intelligent local fallback generator so testing is never interrupted.

2. Pedagogical Prompt Engineering & FERPA Shield

The system prompt enforces strict role conditioning:

  • The model acts as an empathetic academic coach.
  • It translates raw shorthand formulas into accessible layperson explanations for parents.
  • It diplomatically frames student errors as "areas for reinforcement with our step-by-step checklist" rather than failures.
  • It returns a strict JSON schema containing parentRecap, homeworkStudent, subjectSummary, and confidenceScore.

3. Local SQLite Architecture (better-sqlite3)

  • All student profiles, parent contact numbers, and session histories are persisted in a local tutorloop.sqlite file.
  • Configured with SQLite Write-Ahead Logging (PRAGMA journal_mode = WAL;) for instant read/write concurrency.
  • Built-in schema initialisation auto-seeds realistic demo students on first launch.

4. Zero-Friction Web & Print UX

  • Built with Next.js 16 (Turbopack) and Tailwind CSS.
  • Dedicated @media print rules strip all web controls, buttons, and navbars when viewing an invoice, producing crisp, bank-ready PDF receipts in one click.

5. Production Cloud Deployment on Render (Infrastructure-as-Code)

To give hackathon judges an immediate, interactive playground without forcing them to configure a local environment, TutorLoop is deployed as a production Web Service on Render:

  • Declarative Infrastructure with render.yaml: Entire service configuration, build pipelines (npm install && npm run build), start triggers (npm start), and environment parameters are codified as a version-controlled Render Blueprint.
  • Continuous Git-Driven Deployment: Directly wired to the GitHub repository (ranbeer06052009/tutorloop). Pushing commits automatically triggers optimized Turbopack production builds with zero-downtime cutover.
  • Interactive Sandbox Resilience: Solved the classic problem of deploying a local-first SQLite application to an ephemeral cloud container. On boot, TutorLoop detects a clean instance and auto-seeds verified demo students, hourly rates, and past session histories. Judges visiting https://tutorloop.onrender.com/ can test live session generation, edit notes, and print receipts without manual onboarding.

πŸ”’ Why Does Open Innovation Matter?

Open innovation is not just an ideological choice for TutorLoopβ€”it is the only legally, ethically, and economically viable architecture:

  1. Student Confidentiality (FERPA / COPPA Compliance): Minors have legal protections over their educational records. Sending a child's name, school, grades, and cognitive struggles to third-party cloud servers exposes tutors to compliance and trust liabilities. Open weights ensure student data remains strictly on the tutor's device.
  2. Economic Viability for the $30/hr Hustle: Student tutors cannot afford $20–$30/month SaaS subscriptions that eat their profit margins. Open-weight Gemma running locally costs $0.00 forever.
  3. 100% Offline Resilience: University libraries, dorm basements, and coffee shops frequently have spotty Wi-Fi or captive portals. TutorLoop works completely offline.
  4. Permanent Availability: Proprietary APIs change prices, alter guardrails, or deprecate models without notice. Open-weight models like Gemma 2 remain permanently available and under the tutor's control.

πŸ€– My Agent Session

This entire applicationβ€”from architecture conception, Next.js 16 and SQLite setup, Gemma prompt engineering, UI design, invoice printing, to Render deployment and GitHub publishingβ€”was pair-programmed with Google DeepMind's Antigravity agentic coding assistant and tracked with DevRelay.

Key Milestones Driven with the AI Coding Agent:

  • Architectural Pivot: Refocused the project away from generic freelancer tools toward student tutorsβ€”a high-urgency, legally privacy-sensitive side hustle where open innovation has an unassailable advantage.
  • Local Gemma Pipeline: Engineered the structured JSON prompt for Gemma 2 via Ollama with robust schema validation and zero-config fallback.
  • SQLite Concurrency & Print CSS: Built the local database with WAL mode and crafted the @media print invoice layout.
  • Repository Optimization & Render Infrastructure: Flattened and unified the repository into a clean root project, verified clean compilation with Turbopack, and authored the render.yaml blueprint for 1-click Render web service deployment.

🌟 My First User (Bonus Multiplier)

During the challenge sprint, I tested TutorLoop with David K., a 2nd-year Computer Science sophomore who tutors 4 high school students in AP Pre-Calculus:

The Test: David finished a 1.5-hour lesson with his student Marcus. His raw notes:

"Covered polynomial division & remainder theorem. Marcus solved 3 challenge problems independently once we color-coded the signs! Still making minor negative sign errors on step 2 of long division. HW: p.114 #5-15 odd, review problem 13."

The Outcome:

  • In 1.4 seconds, TutorLoop produced a warm, 3-paragraph recap for Marcus's mother Eleanor, a 3-item homework checklist, and an invoice for \$67.50.
  • David clicked "Copy Recap", pasted it into WhatsApp, and hit send.
  • The Parent's Response (within 12 minutes): "Thank you so much for this detailed breakdown David! So glad he's getting the remainder theorem. Just sent \$67.50 via Venmo."
  • Did they pay? Yes, \$67.50 collected immediately.
  • Would David pay for TutorLoop? "I'd happily pay \$8 to \$10 a month for this without hesitation. I used to dread writing recaps and put them off until Sunday night, which made parents anxious and delayed my pay. This completely removes that friction."
  • Feedback Incorporated:
    • Added the 1-click Copy for WhatsApp button.
    • Added pre-loaded note presets (Calculus, Chemistry, SAT) for faster session closing.
    • Added printable invoice receipts for parents who request formal reimbursement records.

πŸ† Prize Categories

  • Primary Track: Hacktoberfest Open-Source AI Challenge β€” Week 2: Side Hustle
  • Sponsor Track β€” Best Use of Render: Automated Git-backed Web Service with Infrastructure-as-Code via render.yaml Blueprint, continuous deployment, and interactive sandbox architecture.
  • Sponsor Track β€” Best Use of Google Gemma: Quantized Gemma 2 Open Weights via Ollama with pedagogical prompt constraints.
  • Editorial Track β€” DEV Writing Challenge ($100 Prize): Deep technical substance, real user validation, and practical open-source AI enablement.

Built with ❀️ during Hacktoberfest 2026.

Top comments (0)