Inspiration

Opening a physical business is a huge financial bet. Whether you are launching a supermarket, a café, a gym, or a clinic, picking the wrong street can sink the company before it even starts. Most teams either pay thousands of euros for slow consulting reports or guess blindly without knowing neighborhood income, rent pressure, local competition, or hidden hazards like flood plains. We built ExpandIA so businesses can find their ideal location with ease, turning scattered territorial data into clear, visual answers in seconds.

What it does

After logging in with Auth0, you pick your brand and sector. ExpandIA opens on a view of Catalonia shaded by a color scale showing the number of competitors in each county, making it easy to spot saturated or underserved regions at a glance.

When you zoom in to the 5 km or 1 km radius, a viability heatmap from 0 to 100 shows where it is most convenient to open your business. Competitor locations show up in orange and your own brand appears in green, down to individual 3D buildings at street level, while water areas are cut out so rivers and the sea are never treated as valid sites.

Clicking any spot opens a panel with detailed statistics for every variable, including income per capita, population, housing price per m², official MITECO flood risk, and local competition. It also estimates whether the location is profitable in the long term using our financial model for rent, revenue, ROI, and payback. You can ask the Gemini agent open questions like "where should I open a gym in Barcelona?", and it scores the whole town, pins the three best spots on the map, and explains the choice using only the platform's figures. Questions can be typed or dictated with ElevenLabs Scribe, answers can be listened to via ElevenLabs, and every conversation is saved to your account in Tiger Data (PostgreSQL / TimescaleDB) where you can review or delete past queries.

How we built it

We built the frontend with React 19, Vite, TypeScript, and Mapbox GL JS, paired with a Rust backend powered by Axum and Tokio. Every protected endpoint validates Auth0 JWT tokens and keeps all API keys strictly on the server.

Locatan supplies the socioeconomic and housing metrics, MITECO provides the official flood layers, and a precomputed Catalonia OpenStreetMap index handles instant competition lookups and our footfall model built from traffic generators like public transport, schools, and pedestrian streets. Our Rust scoring engine weights the five factors by sector and scores market saturation using $\frac{1}{1 + r^{1.5}}$ (where $r$ is the ratio of actual to expected competitors), scaled by a demand multiplier so empty land does not outscore busy neighborhoods, while the financial model penalizes isolated or mountain locations.

Chat history is stored in a Tiger Data hypertable with compression and mirrored to local files as a fallback so the app keeps working if the database is down. The Gemini agent runs with strict guardrails so it cannot invent data, its ROI stays close to our base financial model, and it can never give a better verdict than our deterministic rules. We also versioned our code using Entire.

Challenges we ran into

Latency was our biggest hurdle. Fetching batches of 25 points from Locatan took 16 to 20 seconds, which made exploring the map feel sluggish. We fixed this with non-blocking background queues, a persistent disk cache, coordinate-aligned grids, and progressive rendering that fills the heatmap as real data arrives instead of faking colors.

Public Overpass servers also timed out repeatedly during the weekend, so we compiled a local Catalonia OpenStreetMap extract into memory for instant queries. On top of that, early versions of our model gave farmland near-perfect scores because prices were low and there were zero competitors. Adding a footfall demand multiplier fixed that problem, and exact coastline masking stopped the sea and rivers from counting as valid sites.

Accomplishments that we're proud of

Getting the circular heatmap to render cleanly and smoothly on the map is what we are proudest of. Blending interpolated viability scores, exact coastline cutouts, and full-resolution MITECO flood zones right underneath 3D business footprints took a lot of tuning, and seeing it work in real time felt amazing. We are also really proud of being able to contrast and cross-check data from completely different sources in one place, combining socioeconomic and housing data from Locatan, official flood maps from MITECO, and real local competition from OpenStreetMap while flagging any gaps filled from reference values as Estimated in the UI.

What we learned

This was the first time either of us had built anything in Rust. Going from zero experience to shipping an async Axum server with concurrent batch queues, JWT verification, disk caching, and a geospatial scoring engine in one weekend was intense, and fighting the borrow checker taught us a ton. We also learned how to keep map-heavy apps feeling fast on top of slow external APIs, and why backing AI reports with deterministic math gives much more reliable advice.

What's next for Expandia

Next, we want to expand our local indexes beyond Catalonia and return to the social impact idea that originally sparked this project. Our first goal was to help relocate marginalized people living in high flood-risk zones to safer neighborhoods within the same city without increasing their rent. Modeling a fair and practical relocation turned out to be much more complex than just finding cheaper housing, and it was not something we could finish properly by Sunday morning. Now that our core location engine works, building that relocation workflow is our main next step.

Built With

Share this project:

Updates

Submission history