Inspiration
Dealing with landlords has personally always been an issue with our families. New York City has some of the strongest tenant protections in the country, but most tenants never use them. Not because the rights don't exist, but because navigating the NYC Housing Maintenance Code, knowing which section applies, and writing a legally credible complaint letter is intimidating, time-consuming, and often requires a lawyer. We wanted to remove every one of those barriers, especially for tenants whose first language isn't English.
What it does
TenantShield lets a tenant snap a photo or describe a housing issue, fill in their details, and receive a fully formatted complaint letter in under a minute. It identifies the exact NYC code violation (down to the subsection), assigns a severity level, explains the landlord's legal deadline, and generates the letter in any of 10 languages, including Spanish, Bengali, Arabic, and Haitian Creole. Reports are saved in-session with a built-in PDF viewer so tenants can review, expand, and download their letters instantly.
How we built it
The frontend is built with React 19 + TypeScript + Vite with Tailwind CSS 4. The backend is a FastAPI server that forwards complaints (text and/or image) to Google Gemini 2.5 Flash via a carefully engineered prompt, then renders the structured JSON response into a professional PDF using ReportLab. A persistent issue log lets tenants track problems over time and attach existing photos directly to new reports.
Challenges we ran into
The hardest part was getting the AI to cite accurate, specific NYC code sections, not just plausible-sounding ones. Early versions would confidently cite the wrong subsection or invent legal deadlines. We solved this by building explicit chain-of-thought verification steps directly into the prompt: the model must reason through code accuracy, severity appropriateness, and legal deadline correctness before producing output.
Accomplishments that we're proud of
We're really proud that the generated letters cite real subsections with accurate HPD enforcement timelines and not just generic advice. Ultimately, the end-to-end experience (photo in, complaint PDF out, in just seconds) feels like something that could actually help someone today.
What we learned
Prompt engineering for legal accuracy is a completely different discipline than prompt engineering for creativity. Vague instructions produce confident hallucinations; explicit verification steps and grounding constraints produce trustworthy output.
What's next for TenantShield
- A browseable catalog of housing codes, simplified and translated for understanding.
- A map to display ongoing complaints, enabling users to potentially work together.
- Multi-language support for the entire app instead of for just the letter.
Built With
- fastapi
- google-gemini
- react
- tailwind
- typescript
Log in or sign up for Devpost to join the conversation.