-
-
Welcome screen: what it is and who it's for
-
The AI's proposal in violet pencil: leak, 93%
-
The rules table stamps Class C, 24-hour window, with the countdown
-
Case file with the dated log and the heat log card
-
Notice addressed to the registered managing agent
-
The landlord's 4 buildings: 948 open violations, 17.8× the city rate
-
Answers only in quotes, each stamped QUOTE CHECKED
-
AI words in violet, facts from the log in marker
-
Readings stamped below the legal minimum
-
Night-notebook dark theme
Inspiration
The power dynamic between landlords and tenants in New York City is unbalanced. Renters often struggle to report repair problems formally: some fear retaliation, and most don't know the housing code, the right terminology, or how long a landlord legally has to fix something. So they text the super, keep no dated record, and arrive at a 311 complaint, an HPD inspection or housing court with nothing but a scattered camera roll.
The problem is huge. NYC Open Data lists about 2.65 million open housing-code violations, including 587,952 Class C (immediately hazardous) ones, across 85,096 buildings. Every repair dispute turns on documentation, and what renters have today is chatbots, not evidence. We wanted to turn "my ceiling is leaking" into a dated, cited record a renter can act on with confidence.
What it does
Habitable is a phone-first web app for NYC renters. There's no account and nothing to install, and the case stays on the renter's phone.
- Snap the problem. The photo is fingerprinted on the device (SHA-256), dated from its own EXIF data, stripped of its location, and given a signed server receipt that anyone can check at
/verify. - The AI proposes. A Gemini vision model picks one of seven answers (leak, mold, no heat or hot water, pests, broken lock or door, peeling paint, or "not covered") with a confidence score and one sentence of why. Below 70% confidence, the app asks one clarifying question. The renter can always correct it.
- The code disposes. A cited rules table, never the model, decides the HPD hazard class and the correction window. A dripping leak is Class C, 24 hours. Mold is classed by area (Local Law 55), and peeling paint in a pre-1960 building with a child under 6 is presumed lead. When a rule needs a fact a photo can't show, the app asks. The card shows the class stamp, the window, the code section, a live countdown to the requested repair-by date, and a "Why?" drawer with the exact rule and its source.
- The building's record. Open HPD violations for the building (291 for the demo building), the managing agent and owner registered with HPD, complaints from the last 12 months, litigation on record, and whether the building is in HPD's Alternative Enforcement Program, all live from NYC Open Data.
- A dated case log. Every issue lands on a timeline with follow-ups ("still dripping, day 12") and "mark fixed".
- The repair notice. A print-ready PDF in English or Spanish, addressed to the registered managing agent with the owner copied. It lists every open issue with dates, photos, fingerprints, receipt links, citations and repair-by dates, and comes with pre-filled 311 complaint text.
- Heat and hot water log. A photo can't show a temperature, so each reading is checked against NYC's minimums. The outdoor temperature comes from the National Weather Service.
- What to do next. A plain-language ladder (write to the landlord, call 311 for an HPD inspection, an HP Action in Housing Court) plus free legal help, every line linked to its official page.
- Built for real phones. Backup and restore, calendar reminders, offline use once loaded, and light and dark themes.
Three features with depth
The same rule runs through all three: the model proposes, and plain code checks.
- Landlord track record. Is it the building, or the landlord? Habitable follows the HPD registration across seven NYC Open Data sets to find every building under the same head officer, managing agent or corporate owner, then scores the whole portfolio. The demo landlord has 4 buildings, 84 apartments and 948 open violations, 17.8× the city's rate per apartment, and its worst building has 140 open Class C violations.
- Ask the law. A local BM25 search over 65 verbatim passages of the NYC Housing Maintenance Code and HPD pages. The AI may answer only in quotes, and code checks every quote word for word against the passage it cites. A sentence whose quote isn't in the law never reaches the screen.
- Message coach. A text, email or phone script to the landlord or super, tuned to the hazard class. The AI writes the words around placeholders, and code fills in every date, class, address and citation. Code rejects any draft that contains a digit, a banned phrase (like withholding rent or threats) or an overclaim.
How we built it
- Planned first with the Devpost Learn Skill Pack, inside Claude Code.
2-scopedefined the kernel ("AI proposes, code disposes"), the user and the PoC boundary.3-prddefined the journey, screens and states.4-specchose the stack and wrote the cited rules table the app runs on.5-buildturned it into a checklist of slices with a revisions log. The documents are in the repo'sdevpost/folder and rendered at habitable-blush.vercel.app/plan. - Built slice by slice with Claude Code subagents, each slice integration-checked and tested before the next, with every push to GitHub deploying to Vercel.
- Stack: Next.js 16 (App Router), React 19, TypeScript, Tailwind CSS 4, AI SDK 7 with Gemini 3.5 Flash (falling back to Flash-Lite), Zod, exifr, IndexedDB, @react-pdf/renderer, Vercel.
- The AI is boxed in. Structured output validated by a Zod schema at temperature 0, a fixed list of answers, and no access to classes or deadlines. A demo mode with saved answers means the demo never depends on an AI quota.
- Data: NYC Open Data (HPD violations, registrations and contacts, complaints, litigation, AEP, 311 heat complaints, PLUTO), NYC GeoSearch and the National Weather Service.
- Tested: 465 Vitest unit tests (including a check that every combination of facts reaches a cited outcome) and Playwright end-to-end tests on Chromium, WebKit (iPhone) and Firefox.
Challenges we ran into
- Keeping the AI out of the law. A model that "decides" a hazard class or a deadline is exactly the trust problem we were trying to solve. We limited the model to a fixed list of problem types and moved every legal outcome into a cited rules table with unit tests.
- Stopping invented law. Ask the law and the message coach generate text, so a prompt alone wasn't a strong enough guard. Code verifies every quote against the law text and rejects coach drafts with digits, banned phrases or overclaims.
- Getting the rules right. Research changed the table more than once: pests split between Class B and C, ordinary peeling paint is Class A, and self-closing doors have their own section. Building the law corpus showed we had cited §27-2018 for bedbugs, which the 2026 code lists as repealed, so we corrected it. For leaks, locks and plaster, HPD's inspector assigns the class, so the card says so and shows how often HPD used each class.
- An honest clock. HPD's correction windows run from when HPD serves a violation, not from the photo, so the countdown is labelled as the repair-by date the notice requests.
- Evidence that reads the same everywhere. Photo times were shifting by the viewer's time zone, and Safari formats dates differently from Chrome. We now read capture times as New York time and normalise the evidence text on every browser.
- Free-tier AI limits. Some models were closed to new keys or too slow, so the app uses Gemini 3.5 Flash with a fallback, per-model cooldowns, an hour-long cache and per-visitor caps.
- Messy civic data. Joining seven city datasets into one landlord portfolio means matching names and addresses that aren't always written the same way. The page says a shared name is a lead, not proof of ownership.
Accomplishments that we're proud of
- The whole chain works on a phone: photo → AI proposal → cited class and clock → dated log → an addressed notice in English or Spanish.
- The AI never sets a class or a deadline, and every sentence it writes is checked by code before a renter sees it.
- Every rule is cited, and every number on screen traces back to NYC Open Data.
- It works with no account, keeps the case on the phone, and opens offline. We tested the live app on a phone, start to finish.
What we learned
- Building AI tools is less about hooking up an API and more about guardrails, and the strongest guardrails are in code: fixed choices, schemas and verification, not just prompts.
- Planning before coding (scope, PRD, spec, checklist) kept a big build focused, and logging every revision kept the plan honest when the build forced changes.
- How to direct an AI coding agent across the full stack, from scaffolding the UI to deploying on Vercel, by breaking features into small, tested slices.
What's next for Habitable
- Emailing the notice directly, and a read-only evidence link a renter can share with a tenant organizer.
- A multi-unit view for tenant associations, and a reminder when a repair-by date passes.
- New York State law in Ask the law (the warranty of habitability and protection from retaliation).
- A native-speaker review of the Spanish, more languages, and more cities, each with its own cited rules table.
Try it: habitable-blush.vercel.app → Try the demo building → Snap a problem. Code: github.com/vj-io/habitable. Habitable is not legal advice.
Built With
- gemini
- next.js
- nyc-open-data
- playwright
- react
- react-pdf
- tailwindcss
- typescript
- vercel
- vercel-ai-sdk
- vitest
Log in or sign up for Devpost to join the conversation.