Track voters and beneficiaries, coordinate staff and volunteers, watch spending, and get clear reports — built around how Philippine campaigns actually run on the ground.
Push / PR
GitHub
Run tests
CI test suite
Build image
Buildx · linux/amd64
Push image
Registry
Run migrations
Drizzle Kit
Trigger deploy
Dokploy webhook
Live app
Problem
The Areas page rolled up data across the full PSGC hierarchy (~42,010 barangays / ~43,768 nodes). Every request performed an access-scope tree walk and multiple unindexed GROUP BY queries, causing PostgreSQL CPU usage to spike to ~800% during repeated refreshes.
A materialized view didn't solve the issue because it required refreshing the entire dataset, making it inefficient for a multi-tenant system.
Solution
Replaced the live fan-out and materialized view with Redis caching + targeted invalidation in front of a single recursive CTE query:
ResultRepeated requests now hit warm Redis caches instead of rebuilding the 42k-node tree, eliminating the PostgreSQL CPU spikes and keeping the Areas page consistently fast.