Inspiration
A campus after dark is a different place. A path that feels fine at 3 pm can feel unsafe at 9 pm, and the reports about it are scattered across emails, spreadsheets and maintenance tickets. We wanted to give campus teams one map and one defensible way to decide which lighting repair matters most when the budget is limited.
What it does
AfterDark OS puts campus lighting reports, pathways, lights and buildings on one map. Reports move through a strict lifecycle — reported, assessed, scheduled, repaired and field-checked — and coverage changes only after a field check. The repair planner takes a budget and compares every feasible repair combination using pathway length, evening footfall and capped overlapping coverage gains, then returns the plan that improves the most walked paths for the money. With a photo attached, Gemini suggests a category, factual title and description; the reporter reviews and edits the suggestion before submitting. Manual categorisation always remains available.
How we built it
AfterDark OS is a Next.js App Router app with React, TypeScript, Tailwind CSS, Prisma and SQLite. The campus, costs and reports are deterministic synthetic data so every demo is repeatable. The optimiser is an exact deterministic subset search: it enumerates feasible repair sets, caps overlapping gains per pathway, applies length and footfall weights, and returns the best plan under the budget. Zod validates input, Recharts renders the coverage comparison, and Framer Motion handles the interface. Gemini vision is called server-side from /api/classify; the API key never reaches the browser.
Challenges we ran into
- Preventing overlapping repairs from double-counting the same coverage gain.
- Making a synthetic campus feel like a connected network rather than unrelated dots.
- Keeping the exact planner fast enough for a live budget slider.
- Designing a lifecycle strict enough to trust but simple enough for a phone.
- Running a SQLite demo on a read-only serverless filesystem; the public demo seeds a runtime copy in /tmp.
- Getting Gemini to return strict JSON within the token budget while keeping the photo suggestion factual.
Accomplishments that we're proud of
- A complete flow: report → map → budget plan → field check.
- An exact optimiser that gives visibly different plans at ₹3,000 and ₹5,000.
- A 20-pathway, 20-light, 12-building synthetic campus with 12 seeded reports.
- A working Gemini photo-assist that suggests a category but leaves the decision with the reporter.
- A public deployed demo, an open-source repo and a narrated 47-second walkthrough.
- An honest dataset: every screen says coverage is a planning estimate, not a measurement or safety score.
What we learned
Small, well-modelled decisions are easier to trust than a single black-box score. Showing the selected repairs and the before/after coverage makes the budget conversation concrete. Synthetic data must be labelled everywhere it appears. Exact search is practical at this scale; the hard parts are the interface and the data model. Gemini is useful as a fast first pass on a photo, but the reporter still needs to confirm what is actually visible.
What's next for AfterDark
- Real campus geometry and measured lighting levels.
- Persistent production database and an audited maintenance history.
- A richer Gemini workflow: photo, location and report text together, with confidence and a visible "why".
- Work orders and contractor cost tracking.
- Field testing with campus operations staff.
Built With
- framer-motion
- gemini-api
- lucide
- next.js
- prisma
- react
- recharts
- sqlite
- tailwind-css
- typescript
- vercel
- zod