Demo video (4:47): watch right in your browser - no account, no ads, opens and plays directly.
The problem
Every June, dorm hallways fill with boxes of textbooks headed for the landfill. Every September, the same students pay full list price for the same editions. The supply exists. The demand exists. Nobody built the loop.
What CampusLoop does
CampusLoop is a browser-only circulation engine for used textbooks. Photograph a cover and the app identifies the book entirely on-device, forecasts what it is worth and who needs it next, and runs a fair matching round that settles trades between students - no server, no accounts, zero network calls. Turn your Wi-Fi off; the whole product still works.
Four views close the loop:
- Scan - point at a textbook cover (camera or upload). The re-homing engine returns title, edition and condition, and shows the classifier's confidence and its 100-dimensional feature vector side by side, so no decision is a black box.
- Loop - a live marketplace of everything your campus has listed. Matches are settled as one global assignment, not first-come-first-served.
- Impact - a running ledger of textbook mass kept in circulation, CO2e avoided and money saved, booked on every confirmed match.
- Portfolio - your listings, your matches, your campus ranking.
How it works
1. Zero-network photo recognition. Frames are rasterised in software, pushed through a 10-stage photo-degradation simulation, and reduced to a 100-dimensional descriptor per cover. Matching is cosine k-NN over descriptors with a margin-based confidence gate: above 0.72 the match auto-confirms, below it a human reviews. The "model" is deterministic image math that ships inside the JS bundle - no download, no API key, no data leaves the device.
2. Fair matching, not a queue. Each match round builds a bipartite graph of listings and requests, finds a maximum-cardinality matching with Hopcroft-Karp, then improves equity with a greedy + 2-swap post-pass, so students in the same dorm get served at the same speed.
3. An honest impact ledger. Every confirmed trade books "mass x edition factor x 0.92" reuse credit - conservation math that cannot be gamed by flipping one book forty times.
4. Small and strict. Vite 7 + React 19 + TypeScript 5.9 (strict), unit-tested algorithms, and 24 incremental commits - you can watch the project grow instead of reading a single dump. MIT licensed.
What inspired me
I am a high-school student, and I watched exactly this waste happen twice at my own school - a pile-out at the end of term, then a textbook order form nobody could afford. Campus is the densest textbook market that exists, and it runs on group chats and goodwill. I wanted to prove that with plain math and a browser, a tiny team of one can beat a cardboard box on a staircase.
Challenges I ran into
- Recognition without a network. The hardest constraint was refusing to phone home. Simulating realistic camera degradation (motion blur, JPEG blocking, glare, perspective) in software so that synthetic descriptors match real photos took most of the tuning time.
- Fairness is combinatorial. A greedy matcher looked fine and quietly starved late joiners. Reading up on bipartite matching and implementing Hopcroft-Karp (plus the 2-swap fairness pass) changed the whole product story.
- Grid layout bugs at 1 a.m. A blank-card rendering bug in the Scan view taught me to profile computed styles in a headless browser instead of staring at CSS. (Fix: set ".stack" to align-content start - see commit history.)
What I learned
How to design algorithms that survive review: maximum bipartite matching, margin-based confidence gating, and an append-only impact ledger. Also how to record a clean demo - scripting mouse moves, TTS narration and a single-pass ffmpeg build turned out to be a project of its own.
What's next
Classroom-scale rollouts (teacher-posted class lists), a lightweight campus relay that only syncs when two phones are on the same Wi-Fi (still no server), and richer condition grading from the same on-device pipeline.
Why I built this - and what I learned
I am 16 years old, a self-taught developer, and CampusLoop was my first solo hackathon build. The spark was local: every June my school throws away tonnes of still-usable textbooks while new students buy the same books brand new. I wanted a tool my classmates would actually trust - at our school that means it must work offline on a phone, ask for no account, and keep every photo on the device.
What I had to learn from scratch:
- ML fundamentals. With no network allowed, I implemented the whole recognition pipeline myself: software rasteriser, 10-way rotation normalisation, a 100-dimensional visual descriptor, cosine kNN with a margin-based confidence gate. Building the ablation harness taught me more about overfitting than any tutorial could - the naive first-fold cross-validation flattered the classifier, which is exactly why evaluation protocol B exists.
- Algorithms. Bipartite matching (Hopcroft-Karp with a greedy warm start plus a 2-swap fairness pass) and demand forecasting on a decay-weighted ledger.
- Engineering discipline. 25 progressive commits, behaviour tests that emit every number quoted in the docs (npm run test), and scripted browser QA across all seven views that caught five real layout defects - each fixed and re-verified.
- Honest metrics. The impact ledger is kept as one line of checkable arithmetic, and the docs state exactly what it omits. Numbers you cannot audit are not engineering.
Even the demo video became a lesson: hackathon platforms only embed YouTube/Vimeo/Youku, and I could not finish signup on any of them, so the video now ships inside the repository and plays from the GitHub Pages link at the top of this description.
AI usage disclosure (as First Commit rules require)
This project was built with an AI coding agent (Trae) assisting under continuous human direction and review - the full disclosure is in the repository README, section AI Usage Disclosure. In short:
- Human decisions: product scope and framing; the four-engine architecture; the evaluation protocols (including why protocol B exists and why first-fold CV would have flattered the classifier); the leakage bans in the feature set; the fairness weight in matching; keeping the impact ledger as one line of checkable arithmetic.
- AI assistance: large volumes of TypeScript/CSS written under review, mechanical refactors, and automated browser QA.
- Integrity: every number quoted in this description is emitted by the committed code, not hand-written into documentation; where docs and code disagree, the code is right. I can walk through any part of it line by line.
Built solo by doge and submitted to First Commit and NextStep Hacks 2026. Source: github.com/doge-th/campusloop - live demo: doge-th.github.io/campusloop.
Log in or sign up for Devpost to join the conversation.