How I serve 12,237 law pages in 0.3 seconds with Astro and zero client JavaScript
Spanish law is public. Reading it shouldn't cost €200/month. That's why I built Ley Abierta, an open source platform indexing every Spanish law from 1835 to today. 12,237 laws. 42,000 Git commits t...

Source: DEV Community
Spanish law is public. Reading it shouldn't cost €200/month. That's why I built Ley Abierta, an open source platform indexing every Spanish law from 1835 to today. 12,237 laws. 42,000 Git commits tracking every reform. Lighthouse score: 100 Performance. Here's how it works. The problem Spain's official gazette (BOE) publishes legislation as XML. If you want the consolidated text of a law with all reforms applied, you either: Read the BOE website (good luck navigating it) Pay for Westlaw, Aranzadi, or similar services There's no free, searchable, version-controlled source of Spanish law. So I built one. Architecture overview BOE API → Pipeline (Bun) → Git repo (Markdown) → Astro (SSG) → Cloudflare Pages → SQLite + FTS5 → Elysia API → Hetzner Docker The same data lives in three places, each for a different reason: Layer Format Why JSON cache 12,231 JSON files Pipeline source of truth Git repo Markdown + YAML frontmatter Human readable, version control SQLite 14 tables + FTS5 index Fast q