This guide provides a comprehensive analysis of Arivu’s architecture and a detailed checklist for deploying across different platforms.Documentation Index
Fetch the complete documentation index at: https://arivu.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Architecture Analysis (A-Z)
Backend Components
API Server
API Server
Technology: FastAPI + Uvicorn
Port: 8000 (configurable)
Requirements:
- Python 3.10+
- ~512 MB RAM minimum
- Async-capable runtime
- POST
/api/chat- Execute queries - GET
/api/health- Health check - WebSocket
/ws/live- Real-time updates - GET
/api/traces- Pipeline traces - GET
/api/sessions- Session history
Database Connectors
Database Connectors
Supported Databases:
- PostgreSQL (primary)
- MySQL
- SQLite
- Snowflake
- Databricks
- Network access to database
- Proper credentials/auth
- ~10-50 MS latency to DB is acceptable
LLM Integration
LLM Integration
Supported Providers:
- OpenAI (GPT-4, GPT-4o)
- Anthropic (Claude)
- Groq (Mixtral, Llama)
- DeepSeek
- HuggingFace (via Replicate)
- Ollama (local)
- API keys stored in secrets manager
- Internet access to LLM endpoints
- Rate limiting awareness
- Cost monitoring
Memory Backend
Memory Backend
Options:SQLite: Local file-based
- File:
arivu.db - Storage: Local filesystem or mounted volume
- Performance: Excellent for <100 concurrent users
- Scaling: Poor for distributed deployment
- URL:
redis://host:port/db - Storage: In-memory with optional persistence
- Performance: Excellent for high concurrency
- Scaling: Excellent with Redis Cluster
Cache Layer
Cache Layer
Caching Strategy:
- HTTP response caching (ETag, Last-Modified)
- Redis cache for query results (300s TTL)
- Frontend browser cache (manifest caching)
- CDN caching for static assets
- Semantic similarity on queries
- Session ID + query hash
- LLM model version
Background Jobs
Background Jobs
Current Implementation:
- Synchronous within request
- Pipeline execution inline
- No message queue (yet)
- Celery + Redis for async tasks
- Schema refresh as background job
- Report generation queue
Security & Auth
Security & Auth
API Key Authentication:
- Header:
X-API-Key - Validation on all endpoints
- Environment:
ARIVU_API_KEY
- Session-per-user isolation
- User ID in logs for audit
- No build-in RBAC (extensible)
- Never in code
- Secrets manager (AWS/Azure/etc)
- Rotation ready
Frontend Components
Next.js Application
Next.js Application
Technology: Next.js 15.5.9 + React 19
Build Output: Static HTML/JS/CSS
Port: 3000 (dev), served on prod port
Build Size: ~2-3 MB (gzipped)Key Pages:
/- Dashboard home/connections- Database connections/llms- LLM provider config/traces- Pipeline tracing/chat- Interactive query builder
Component Library
Component Library
UI Framework: Radix UI + Tailwind CSS
Icons: Lucide React
Charts: Chart.js (via CrayonAI)
Tables: TanStack React Table
Notifications: Sonner toastsAsset Size:
- HTML: ~150 KB
- JavaScript: ~1.5 MB (bundled)
- CSS: ~300 KB
- Custom fonts: ~500 KB
API Communication
API Communication
Base URL:
- Dev:
http://localhost:8000 - Prod:
/api(same origin)
/api/chat- Query execution/api/connections- DB management/api/llms- LLM settings/api/traces- Execution traces/api/export- Data export
- JSON request/response
- CORS handling for cross-origin
- Error propagation to UI
State Management
State Management
Approach: React hooks + Context API
Page State:
- Session ID persisted
- User preferences in localStorage
- Query results in React state
- Real-time updates via WebSocket
- LocalStorage: Settings, preferences
- URL params: Query context
- Cookies: Authentication (if needed)
Performance Optimization
Performance Optimization
Code Splitting:
- Dynamic imports for route pages
- Lazy loading for modals/dialogs
- Next.js Image component
- Responsive srcset
- WebP format support
- Static pages: 30 days
- Dynamic pages: 1 hour
- Scripts: 1 year (with hash)
Supporting Infrastructure
Load Balancing
Load Balancing
For Backend:
- HTTP Health checks every 30s
- Sticky sessions for WebSocket
- Round-robin for stateless APIs
- DNS-level (Route 53, Azure DNS)
- CloudFront/CDN for static
- Geo-routing if multi-region
Monitoring & Logging
Monitoring & Logging
What to Track:
- API latency (p50, p95, p99)
- Error rates by endpoint
- Database query performance
- LLM token usage and cost
- Memory usage growth
- Cache hit ratios
- Centralized logging (CloudWatch, Datadog)
- Structured JSON logs
- Request tracing across services
Backup & Disaster Recovery
Backup & Disaster Recovery
Database Backups:
- Automated daily backups (7-30 day retention)
- Point-in-time recovery capability
- Cross-region replication (optional)
- Test restores weekly
- Git version control for IaC
- Secrets in encrypted storage
- Database connection strings in vault
Networking
Networking
VPC/Network Setup:
- Public subnets for ALB/frontend
- Private subnets for backend/database
- NAT Gateway for outbound traffic
- Security groups (least privilege)
- Apex domain → CDN/LB
- API subdomain → Backend
- WebSocket endpoint → Backend (sticky)
Deployment Scenario Comparison
Scenario 1: Startup (0-1000 MAU)
Recommended Platform
Railway or Render
Estimated Cost
$10-20/month
Scenario 2: Small Business (1000-10000 MAU)
Recommended Platform
DigitalOcean App Platform
Estimated Cost
$40-60/month
Scenario 3: Mid-Market (10000-100000 MAU)
Recommended Platform
AWS ECS or Azure App Service
Estimated Cost
$100-200/month
Scenario 4: Enterprise (100000+ MAU)
Recommended Platform
AWS EKS or Azure AKS
Estimated Cost
$300-500/month
Platform Decision Matrix
- Quick Decision Tree
- Matrix
-
Budget?
- < $20/month → Railway, Render
- $20-100/month → DigitalOcean, Heroku
-
$100/month → AWS, Azure
-
Complexity tolerance?
- Very low → Vercel + Railway
- Low → DigitalOcean, Render
- Medium → AWS ECS
- High → AWS EKS, Azure AKS
-
Existing cloud provider?
- AWS user → ECS or EKS
- Azure user → App Service or AKS
- None → DigitalOcean, Railway
Universal Deployment Checklist
Pre-Deployment
- Code review and testing complete
- Environment variables documented
- Database migration tested locally
- Docker image builds successfully
- All dependencies in requirements.txt
- API keys secured (no hardcoded values)
- Health check endpoints configured
- Monitoring/logging configured
Infrastructure Setup
- VPC/networking created
- Database provisioned and tested
- Redis/cache provisioned
- Secrets manager configured
- SSL certificates ready
- DNS records configured
- Load balancer configured
- Auto-scaling policies defined
Deployment
- Docker images built and pushed
- Task definitions/manifests created
- Environment variables set
- Database migrations run
- Initial deployment (canary or blue-green)
- Smoke tests passing
- Monitoring alerts triggered
- Team notified
Post-Deployment
- Health checks all green
- Log aggregation working
- Metrics dashboards visible
- Alerts tested
- Backup verified
- Performance baseline established
- Documentation updated
- Incident response plan ready
Platform-Specific Checklists
- AWS ECS
- Azure App Service
- DigitalOcean
- Heroku/Railway
- VPC created with public/private subnets
- RDS database created and tested
- ElastiCache Redis cluster created
- ECR repositories created
- IAM roles and policies configured
- ECS cluster created
- CloudWatch log groups created
- ALB created and configured
- Auto Scaling group configured
- Route 53 DNS configured
- CloudFront distribution created (optional)
- S3 buckets for logs/backups created
Success Criteria
After deployment, verify:Performance
- API p99 latency < 2s
- Frontend load < 3s
- 99.9% uptime
Reliability
- Health checks 100% green
- Automatic failover working
- Zero data loss
- Backups tested
Security
- No hardcoded secrets
- HTTPS everywhere
- Access logs present
- Encryption enabled
Next Steps
- Choose Your Platform: Review the options and select based on your scenario
- Follow Platform Guide: Go to AWS, Azure, or Other Platforms section
- Test Locally First: Use Docker Compose to test the full stack
- Use This Checklist: Mark off items as you complete them
- Set Up Monitoring: Don’t skip logging and alerting
- Plan Scaling: Know your growth strategy beforehand

