Project Overview
RedeCasas is a high-scale Brazilian real estate content platform. It combines a static site generator that produces SEO-optimized pages for thousands of cities with interactive backend services powered by Cloudflare Workers.
Key Concepts
Scopes
The site is organized around three primary real estate scopes:
| Scope | Path | Description |
|---|---|---|
| Casas | /casas/ | Houses for sale and rent |
| Jardim | /jardim/ | Garden homes and outdoor properties |
| Condomínios | /condominios/ | Condominium and apartment listings |
Each scope generates index pages for all 27 Brazilian states and city-level pages for 5,000+ municipalities.
Static + Dynamic Hybrid
- Static: The Go generator pre-builds HTML pages for scopes, states, cities, topics, and special pages. These are uploaded to Cloudflare R2.
- Dynamic: Workers handle auth, billing, listings, and AI chat. The dev proxy routes
/api/*requests to the appropriate worker.
Daily Build
A rotating daily refresh system keeps content fresh:
- Full page generation (if needed)
- Rotating state refresh — picks the next Brazilian state and regenerates its index pages plus up to 5 random city pages per scope
- Sitemap regeneration
Run it manually with:
./scripts/daily-build.shOr schedule it via cron:
0 3 * * * /home/debian/workspace/brasil/scripts/daily-build.sh >> /home/debian/workspace/brasil/logs/daily-cron.log 2>&1