Perito Psicólogo Madrid
peritopsicologomadrid.com
Online authority on autopilot for specialized professionals
High-performance SEO website for a forensic psychology practice in Madrid. Hub & Spoke architecture with 35+ pages and an autonomous content pipeline generating 18 daily pieces without human intervention.
35+
SEO pages
hubs, spokes, services and tools
18/día
Content pieces
2 articles + 16 social posts
10
Daily cron jobs
100% autonomous pipeline
The Challenge
Forensic psychology practices compete in a legal-medical niche where buyers (lawyers and individuals in legal proceedings) search with high commercial intent. Generic agency websites fail to rank for high-value keywords.
The Approach
Hub & Spoke architecture with 3 thematic hubs and 15+ spoke pages that transfer authority to commercial service pages. Autonomous pipeline with 10 daily cron jobs that selects keywords, enriches with news signals, generates articles with Claude, and distributes across 4 social networks.
Architecture
Hub & Spoke SEO: 3 thematic hubs with 15+ spokes transferring authority to commercial pages
Autonomous 5-stage pipeline: topic selection, news enrichment, Claude generation, Sanity publishing, social distribution
Anthropic prompt caching to reduce costs on recurring Claude API calls
Supabase Vault for secure secret management in cron jobs, avoiding the current_setting() antipattern
Vercel Fluid Compute: 300s timeout on Hobby plan for long-form article generation
Key Technical Decisions
Sanity CMS over WordPress: schema as TypeScript code, programmatic API for AI pipeline, Studio embedded at /studio
pg_cron over GitHub Actions: schedule lives alongside data, no queue delays or deactivation risk from inactivity
Claude Haiku over Sonnet: indistinguishable quality for Spanish SEO articles, with prompt caching for further optimization
Hub & Spoke over flat structure: controlled authority transfer from educational content to commercial pages
HSTS with preload: irreversible decision made after confirming client DNS HTTPS-only configuration
How It Was Built
Built in 5 phases: from the TypeScript strict foundation with trauma-informed design (no red colors, no urgency CTAs), through the Hub & Spoke content architecture justifying every internal link, to a fully autonomous AI pipeline. The most frustrating bug was discovering that pg_cron with current_setting() fails silently on Supabase managed Postgres, solved by migrating to Vault secrets. Choosing Claude Haiku over Sonnet proved that for Spanish SEO articles with a detailed prompt, the lighter model produces indistinguishable results at a fraction of the cost.
Results
From zero to 35+ indexed pages and a pipeline generating 18 daily content pieces without intervention. The Hub & Spoke model ensures every new article reinforces its corresponding hub authority, creating a compound effect where content published today improves the entire site ranking tomorrow. With 730 potential articles per year versus 2-4 published manually, the competitive advantage in the niche is exponential.
Tech Stack
What you get
- SEO authority that builds itself - daily articles optimized for your niche keywords
- Presence on 4 social networks effortlessly - posts adapted to each platform automatically
- Visual panel for your team - publish and edit content without code from Sanity Studio
- Interactive tools that convert - fee calculator and needs assessment quiz
- Professional-grade security - HSTS, strict CSP, and Vault authentication for the pipeline