🚀 Inspiration: Turning a Nightmare Trip into a Tool for Trust
The inspiration for SafeLease came from a very personal place: a story about my brother's trip to Rome. He and his girlfriend had booked what looked like a dream apartment, but the reality was a nightmare. The photos didn't match, the bedsheets were stained, and the property was completely unattended. It was a classic case of a misrepresented listing that ruined their vacation.
This story, combined with research revealing that rental fraud is a multi-billion dollar problem affecting millions, sparked the core idea. Renters are navigating a high-risk environment with almost no tools to protect themselves. We decided to build that tool: an AI-powered co-pilot to bring safety and trust back to the rental process.
🎯 What We Learned & Our Journey
This project was a deep dive into the real-world challenges of building a scalable, AI-native application.
Our first major hurdle was data acquisition. We quickly learned that automatically scraping major rental platforms is technically difficult and legally problematic. This forced a crucial pivot: instead of trying to scrape the web, we would empower the user. We developed our "copy-paste" solution, where the user provides the raw text, and our AI does the heavy lifting of structuring it. This was a key learning: adapting to constraints leads to a more user-centric design.
As the analysis became more complex, we hit a performance wall. A single, long-running analysis would freeze the app. This led us to re-architect the entire backend into a distributed system using FastAPI, Redis, and RQ (Redis Queue). This taught us how to build a truly scalable application where over ten independent worker jobs can run in parallel without impacting the user experience. We also implemented a robust, job-level Redis cache, which makes rerunning an analysis with minor changes almost instantaneous.
Finally, we learned that making AI reliable is an art. Early prompts produced inconsistent results. We solved this through advanced prompt engineering:
- Tiered Models: Using
Gemini 1.5 Flashfor simple tasks and the more powerfulGemini 1.5 Profor the final, complex synthesis. - Strict JSON Schemas: Forcing the AI to return structured data to eliminate errors.
- Explainable AI: We designed our system so that every worker job returns a standardized
AnalysisStepobject. This creates a full "forensic trail" that is fed to the finalizer, allowing it to cross-reference findings, identify contradictions, and produce a much more intelligent and trustworthy report.
🔧 How We Built It
SafeLease is built on a modern, asynchronous, and scalable full-stack architecture.
Backend (FastAPI, RQ, Redis, PostgreSQL):
- The core is an asynchronous task queue system. An Orchestrator job receives an analysis request and "fans out" over ten independent micro-analysis jobs. These jobs run in parallel, and their dependencies are managed by RQ.
- A Finalizer job gathers the results from all completed jobs, synthesizes them using
Gemini 1.5 Pro, and saves a complete, structured report to our PostgreSQL database. - A custom failure handler and robust "smart worker" logic ensure that any single job failure is caught, the analysis is gracefully marked as
FAILED, and the entire system remains stable.
Google Platform Integration:
- Google Maps Platform: This is the heart of our verification engine. The Geocoding API validates that an address is real. The Places API provides a "ground truth" for cross-referencing listing data (like reviews and property type). Crucially, we use the
country_codefrom the Geocoding result to perform localized reputation searches, making our analysis globally effective. - Gemini AI: We use a tiered approach for both cost-efficiency and quality, leveraging
Gemini 1.5 FlashandProfor different tasks. - Google Cloud Vision API: Powers our reverse image search to detect stolen or reused photos.
- Google Maps Platform: This is the heart of our verification engine. The Geocoding API validates that an address is real. The Places API provides a "ground truth" for cross-referencing listing data (like reviews and property type). Crucially, we use the
Frontend (React, TypeScript, Redux,
react-router-dom):- The frontend is a true single-page application that provides a seamless, interactive experience.
- We use a hybrid state management model: a lean Redux store manages truly global state (like loading status and theme), while components are responsible for their own data fetching.
- The
Sidebarcomponent manages the history list, and theResultsPagemanages the polling for an active analysis, creating a clean separation of concerns.
🏆 Challenges Faced
Beyond the architectural pivots, our main challenge was creating a system that could intelligently handle the vast diversity of real-world data. We built the system to be resilient to missing inputs (e.g., a listing with no photos), to handle API errors gracefully, and to intelligently decide when an analysis can't be performed due to insufficient data. The frontend polling logic, and ensuring it was efficient and didn't cause infinite loops, was also a significant but rewarding challenge to overcome.
🌟 What's Next for SafeLease
With the core analysis engine proven, our roadmap is focused on becoming the central hub for a renter's entire search.
- User Accounts & Monetization: We plan to introduce user accounts with persistent history and a freemium subscription model to unlock unlimited analyses and advanced features.
- Advanced Data Integration: We will enhance the "Neighborhood Analysis" with objective data like crime rate statistics, air quality, and natural disaster risk.
- Automated Alerts: A key future feature is to allow users to set up alerts for specific search criteria. SafeLease would then automatically analyze new listings and notify the user of high-risk properties, providing proactive protection.

Log in or sign up for Devpost to join the conversation.