Back End Architecture

Listing Lab's backend connects AI models, real estate data, and our infrastructure in a loosely coupled, event driven architecture.

Event-Driven Architecture with Inngest

So most of the data fetching, happens at random intervals, and such a cron job is needed to monitor for changes in listings. Every 15 minutes or so, we cycle through all the currently subscribed zipcodes, check the recent listings, and if there's new ones, we add them to the user(s) that are subscribed to that zipcode.

Also with the data enriching for listings, like the Google Places API, I have them all set up to run in separate Inngest functions, in case an API is down, I can retry the job. Also allows me to set up concurrency limits, and retry limits, to avoid being rate limited. Overall, it creates a pretty resilient system, if one of the API's goes down, or something else goes wrong like a bad commit that breaks a function, the user will stil be able to interact and generate content about a house. Isolating the failure and keeping the application working.

AI Models

Currently running using Googles Gemini model, which provides a massive context, and will allow me to add in new features. Such as, being able to work with multiple listings at once, or being able to generate recommendations for which clients a house might be a perfect fit for. Once the other major models available increase their context, I would like to be able to let agents choose their own model they want to use.

Turso for SQLite

For now, Turso has been a great way to power the backend. Database replication is easy, and can allow me to expand as needed.

In the future, I may switch to something else like PlanetScale, but haven't run into any use cases in this specific app that couldn't be done with SQLite.

Drizzle for Turso

Makes querying tables and updating the database schema a breeze, which gives me a fast iteration loop for new features.