This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle
Running a hackathon, student conference, or community meetup is exhilaratingβuntil Monday morning.
The energy fades, and organizers face a financial hangover:
- A crumpled pile of thermal paper receipts paid out of personal accounts.
- Unstructured WhatsApp messages and emails from vendors demanding bank transfers.
- Sponsor commitments scattered across chats, with nobody sure whose wire actually cleared.
- Deliverables (stage mentions, logo placements, booth slots) promised in a rush and forgotten.
- The nagging question: Did we break even, or are we paying for this out of our own pockets?
Enterprise accounting software like QuickBooks or Expensify costs $30β$80/month, requires tedious chart-of-accounts setup, and doesn't fit the scrappy, fast-moving reality of event operations.
I built SponsorLedger to solve this.
What I Built
SponsorLedger is an evidence-linked financial auditing and sponsorship reconciliation workspace for event leads and student communities.
It replaces spreadsheet chaos with three core systems:
- Gemma AI Irregular Text-to-CSV Ingestion: Event leads rarely get clean bank CSVs. They get informal WhatsApp notes ("Print House delivered banners on 2026-09-01 for 4,500 INR, ref RCPT-001"). Using Google's open-weight Gemma 4 26B, SponsorLedger extracts dates, vendors, categories, amounts, and receipt IDs into verified tabular rows in seconds.
- Deterministic Invariant Audit Engine: AI never does the math. All monetary calculations use base integer units in pure Python, evaluating 7 deterministic rules (budget overruns, unpaid sponsor balances, deliverable deadlines, duplicate expenses, missing receipts).
- Evidence-Linked Audit Trail & Gemma Closeout Dossier: Every discrepancy links directly to the underlying expense or sponsor record via a slide-over modal. When books close, Gemma synthesizes verified numbers into an executive summary and closing checklist.
Who Pays and Why?
- Target Audience: Hackathon organizers, college club leads, independent conference producers, and freelance event operations managers.
- The Value: A single missed $1,000 sponsor collection or an accidental $400 duplicate catering payment can wipe out a community event's entire reserve.
- Commercial Model: A permissive open-source core (GNU AGPLv3) paired with a $19 per-event hosted pass (or $149/year community license). Paying $19 to protect thousands in sponsor receivables and hand university deans a clean audit dossier is an easy decision.
Demo
- Live Web App: https://sponsorledger.onrender.com
- **Backend Web Service API: https://sponsorledger-backend.onrender.com/docs
Try It in 60 Seconds (No Sign-Up Needed)
- Open https://sponsorledger.onrender.com and click Launch App / Continue via Guest Mode.
- You get an Anonymous Cloned Sandbox in MongoDB. Multiple visitors can test simultaneously without data cross-contamination.
- Switch display currencies in the header (USD, EUR, INR, GBP, JPY) to see live FX recalculations across all dashboard charts.
- Go to Expenses (
/expenses), click "Try Sample Irregular .txt", and watch Gemma transform raw notes into structured rows. - Go to Audit (
/audit) to inspect duplicate receipts or unpaid pledges, and click any badge (RCPT-001) to inspect evidence. - Open Report (
/report) to generate an executive briefing synthesized by Gemma.
Code
- GitHub Repository: https://github.com/diptodeepb/SponsorLedger
- License: GNU AGPLv3
-
Test Suite: 65 automated tests (
pytest) covering exact integer math, CSV parsing, audit rules, and exchange rates.
git clone https://github.com/diptodeepb/SponsorLedger.git
cd SponsorLedger
python3 start.py
How I Built It
Architecture Overview
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β React 19 + Vite Frontend β
β (Tailwind CSS, Lucide Icons, Sentry Browser Tracing) β
βββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β REST / JSON (FastAPI)
βββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββ
β FastAPI Backend β
β βββββββββββββββββββββ βββββββββββββββββββββββ β
β β Pure Python Audit β β Live FX Service β β
β β (Exact Base Math) β β (forex-python) β β
β βββββββββββ¬ββββββββββ ββββββββββββ¬βββββββββββ β
β β β β
β βββββββββββΌββββββββββ ββββββββββββΌβββββββββββ β
β β MongoDB Atlas β β Gemma 4 (26B) β β
β β (48h TTL Sandbox, β β (Text2CSV + Report, β β
β β DateCodec, M0) β β Strict JSON Schema)β β
β βββββββββββββββββββββ βββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1. Invariant: "AI Does Not Do Math"
LLMs hallucinate arithmetic and drop numbers when summing ledger rows. In SponsorLedger:
- Exact Base Integer Math: All monetary amounts are stored in base integer subunits (paise / cents), eliminating floating-point rounding errors.
- 7 Deterministic Audit Rules:
| Rule Code | Severity | Description | Evidence Traced |
|---|---|---|---|
BUDGET_OVERRUN |
High | Total expenses exceed budget ceiling | Total expenses vs budget |
SPONSOR_BALANCE_DUE |
High / Med | Outstanding pledged amount past event date | Pledge vs received records |
SPONSOR_OVERPAYMENT |
Medium | Received funds exceed agreed commitment tier | Sponsor ledger entry |
DELIVERABLE_OVERDUE |
High | Sponsor deliverable past agreed deadline | Deliverable due date |
POSSIBLE_DUPLICATE |
Medium | Matching vendor and amount within nearby dates, or identical receipt ref | Correlated expense records |
MISSING_RECEIPT_REF |
Low | Expense recorded without receipt voucher | Expense row |
MISSING_CATEGORY |
Low | Expense has no category or marked Unknown | Expense row |
2. Dual Gemma Pipelines (gemma-4-26b-a4b-it)
Google's open-weight Gemma 4 26B runs two structured tasks:
-
Irregular Text-to-CSV: Parses messy WhatsApp messages and unformatted notes into standard CSV schema (
date,vendor,category,amount_inr,receipt_ref,notes). It normalizes informal dates ("yesterday", "14 Oct") and categorizes spending. - Executive Closeout Briefing: Receives verified ledger totals and open audit findings to draft an executive narrative, priority action items, and a closing checklist using strict Pydantic schemas. Post-processing cleans any accidental internal subunit terms.
3. MongoDB Atlas Isolated Guest Sandboxes
To let judges and visitors test live without stepping on each other:
- The frontend assigns an ephemeral
X-Guest-Sessiontoken inlocalStorage. - The backend clones an isolated sandbox dataset (event, sponsors, deliverables, expenses) tagged with that session.
-
Automated 48-Hour TTL Indexing: MongoDB Atlas purges sandbox collections automatically after 48 hours using
expireAfterSeconds=172800oncreated_at. No cron scripts needed. - Three one-click controls: Reset to Demo Data, Clear All Data ($0 clean slate), and New Guest Session.
4. Hard Bugs & Engineering Gotchas
-
BSON Date Serialization: PyMongo rejects raw Python
datetime.dateobjects. Instead of manual string casting across every endpoint, we registered a custom BSONDateCodecTypeRegistry that transparently serializes dates to ISO strings. - Empty Ledger Guardrail: Generating reports on an empty sandbox ($0 budget, 0 expenses) caused the model to hallucinate placeholder sponsors. We locked report generation with a hard guardrail requiring at least one transaction.
-
Sentry Tunneling (
/api/tunnel): Privacy browsers (Brave Shields, uBlock) blocked Sentry envelope requests. We built a reverse proxy endpoint in FastAPI (/api/tunnel) to route telemetry cleanly without third-party tracking flags.
Why Does Open Innovation Matter?
| Metric | Closed SaaS (QuickBooks / Expensify + AI) | SponsorLedger (Open-Weight Gemma + Open Source) |
|---|---|---|
| Cost per Event | $30β$80/month ongoing subscription | $0 to $0.002 compute cost |
| Data Privacy | Sensitive contracts uploaded to proprietary LLM APIs | 100% auditable code; data stays in your MongoDB |
| Vendor Lock-in | Subject to API price hikes and deprecated tiers | AGPLv3 code; runs locally or self-hosted forever |
| Offline Resilience | Zero functionality without internet | Deterministic audit engine works completely offline |
Open weights make modern financial tooling accessible to student clubs and non-profit hackathons that cannot justify enterprise SaaS subscriptions.
Prize Categories
π Best Use of Gemma (Featured Category)
Google's open-weight Gemma 4 26B (gemma-4-26b-a4b-it) powers irregular text-to-CSV ingestion and structured executive closeout report generation, wrapped in deterministic guardrails and Pydantic validation.
π Best Use of Render (Featured Category)
Orchestrated via a production render.yaml blueprint:
-
sponsorledger-backend: FastAPI Python 3.12 Web Service in Singapore with automated health checks. -
sponsorledger: React 19 + Vite Static Site on Render's Global CDN with SPA rewrites (/* -> /index.html).
π Best Use of MongoDB Atlas (Partner Category)
MongoDB Atlas M0 cluster provides isolated multi-user guest sandboxes, automated 48-hour TTL cleanup indexing, and custom BSON DateCodec serialization.
π‘οΈ Best Use of Sentry Agent Tracing (Partner Category)
Full-stack Sentry telemetry across FastAPI and React 19, featuring an internal /api/tunnel proxy endpoint to bypass client-side ad-blockers.
π Best Use of GitHub Copilot (Partner Category)
Automated with GitHub Actions CI workflows running on every push and pull request across main, master, and dev:
-
Backend Automated Testing: Python 3.12 CI job with pip dependency caching executing the complete 65-test
pytestsuite for exact integer math and audit invariants. - Frontend Build Verification: Node.js 22 CI job with npm caching validating strict production Vite asset compilation.
Appreciate everyone reading thus far! Test the live sandbox at sponsorledger.onrender.com or view the source on GitHub.*





Top comments (0)