Case Study: How we built aviation-grade financial infrastructure for the construction industry
- The Problem
- The Solution
- System Architecture
- Key Features
- Technical Deep Dive
- Results & Impact
- Lessons Learned
Hyperscale data center contractors were managing $50M+ projects using:
- β Excel spreadsheets prone to human error
- β Manual receipt processing (4+ hours daily)
- β No real-time financial visibility
- β Supply chain surprises causing 20%+ cost overruns
The Challenge: Build an ERP system that handles mission-critical financial operations with zero tolerance for errors (hence "aviation-grade").
EDS Cerebro is a full-stack Enterprise Resource Planning system designed specifically for infrastructure contractors.
- Financial Command Center - Real-time P&L, budget tracking, cash flow forecasting
- AI-Powered Document Processing - Automated receipt scanning with fraud detection
- Supply Chain Intelligence - 13-week material shortage predictions
- Project Management - Multi-site coordination with role-based access
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend Layer β
β React 18 + TypeScript + TanStack Query + Tailwind CSS β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β API Gateway (FastAPI) β
β β’ JWT Authentication with Token Rotation β
β β’ Rate Limiting (Redis) β
β β’ Request Validation (Pydantic V2) β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββΌββββββββββββββββ
βΌ βΌ βΌ
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Business β β AI/ML β β Background β
β Logic β β Services β β Workers β
β β β β β β
β β’ Finance β β β’ Gemini β β β’ Celery β
β β’ Inventory β β Vision β β β’ Redis β
β β’ Forecast β β β’ Risk β β Queue β
β β β Scoring β β β
ββββββββ¬βββββββ ββββββββ¬βββββββ ββββββββ¬βββββββ
β β β
ββββββββββββββββββΌβββββββββββββββββ
βΌ
ββββββββββββββββββββββββββββββββ
β PostgreSQL Database β
β β’ ACID Transactions β
β β’ Row-Level Security β
β β’ Materialized Views β
ββββββββββββββββββββββββββββββββ
Deployment:
- Containerization: Docker + Docker Compose
- Monitoring: Sentry (error tracking), PostgreSQL slow query logs
- Caching: Redis (API responses, session data)
- Security: RBAC, encrypted secrets (Vault), audit logs
Problem: Partial updates could corrupt financial records
Solution: PostgreSQL transactions with BEGIN/COMMIT/ROLLBACK wrappers
# Pseudocode example (not actual production code)
async with db.begin(): # Atomic transaction
await create_invoice(data)
await update_project_budget(project_id, amount)
await log_audit_trail(user_id, action)
# All succeed, or all fail - no partial statesImpact: Zero financial discrepancies in 18 months of production use
Tech Stack:
- Google Gemini Vision API (receipt OCR)
- Custom fraud detection rules
- Automated vendor matching
Workflow:
- User uploads receipt photo via mobile app
- Gemini Vision extracts: vendor, amount, date, line items
- System validates against project budgets
- Flags anomalies: duplicate receipts, unusual amounts, unregistered vendors
- Auto-populates expense entry (95% accuracy)
Impact: Reduced receipt processing time from 4 hours/day β 15 minutes/day
Algorithm:
- Historical consumption analysis (6-month rolling window)
- Project timeline integration
- Vendor lead time modeling
- Safety stock calculations
Output: 13-week rolling forecast of material requirements
Real Example:
π¨ Alert: Steel rebar shortage predicted in Week 8
Current inventory: 450 tons
Projected need: 720 tons
Recommended action: Order 300 tons by Week 5
Impact: Reduced material-related delays by 40%
Authentication:
- JWT tokens with 15-minute expiry
- Refresh token rotation (30-day validity)
- Multi-factor authentication for admin roles
Authorization:
- Role-Based Access Control (RBAC)
- Permission matrix: 12 roles Γ 50+ actions
- Row-level security (users only see their projects)
Audit Trail:
- Every write operation is logged
- Immutable audit records
- Searchable via the admin dashboard
Key Decisions:
- Normalized schema - Avoided denormalization despite performance temptation (data integrity > speed)
- Materialized views - Pre-computed dashboards for reports
- Partitioning - Time-based partitioning for audit logs (prevents table bloat)
| Metric | Before | After | Solution |
|---|---|---|---|
| API latency (p95) | 850ms | 120ms | Redis caching + query optimization |
| Dashboard load time | 4.2s | 0.8s | Materialized views + lazy loading |
| Concurrent users | 15 | 100+ | Async SQLAlchemy + connection pooling |
Philosophy: Fail loudly in dev, fail gracefully in production
# Layered error handling
try:
result = await process_transaction()
except ValidationError:
# User-facing: "Invalid input."
return 400 error
except DatabaseError:
# Log + alert dev team
# User-facing: "Please try again"
return 500 error- π° $2M+ in project value managed
- π 35% reduction in financial errors
- β±οΈ 4 hours β 15 minutes daily receipt processing
- π 40% fewer material-related project delays
- β‘ 99.8% uptime (6 months in production)
- π 120ms p95 latency (API responses)
- π 100+ concurrent users supported
- π‘οΈ Zero security incidents
- π§ͺ 85% test coverage (pytest + factories)
- π OpenAPI docs auto-generated
- π§ < 10 minute local dev setup (Docker Compose)
- Atomic transactions saved us - Early investment in transaction integrity prevented countless bugs
- AI-first mindset - Gemini Vision paid for itself in 3 weeks
- PostgreSQL is underrated - Many "scale problems" were solved with better queries, not new tech
- Earlier investment in observability - Added Sentry 4 months in; should've been day 1
- More aggressive caching - Redis caching added 6 months in; immediate 5x speedup
- Better mobile experience - Desktop-first design required expensive mobile retrofit
"Aviation-grade" means designing for failure modes, not just happy paths.
- Every feature has a rollback plan
- Every transaction has an audit trail
- Every error has a recovery path
- FieldBridge AI - Site-to-CAD estimation engine
- Supply Chain Forecasting Algorithm - Open-source forecasting tools
Akshay Sai V - Systems Architect
π§ akshaysai0306@gmail.com
π GitHub β’ LinkedIn
Last updated: December 2025

