[!note] Document Purpose: Comprehensive technical architecture documentation for the AarogyaDost MVP platform
Audience: Developers, architects, technical stakeholders Related: [[README|MVP Overview]] | [[aws-infrastructure-report|AWS Infrastructure]] | [[DEPLOYMENT_STATUS|Deployment Status]]
🎯 Architecture Principles
Design Philosophy
Separation of Concerns: Frontend, backend, and infrastructure are independently deployable
API-First: RESTful API design with comprehensive documentation
Cloud-Native: Leverages AWS managed services for scalability and reliability
Mobile-Ready: Responsive web design + native mobile app support
Developer Experience: Fast local development, automated deployments
Cost-Effective: Optimized for AWS Free Tier and startup budgets
Key Architectural Decisions
Modern, type-safe, large ecosystem
Fast dev server, optimized builds
Fast, async, auto-generated API docs
AWS Amplify + Elastic Beanstalk
Managed services, auto-scaling, low ops
Fast prototyping, future: PostgreSQL/DynamoDB
Planned (OAuth 2.0 + JWT)
Industry standard, secure
Code reuse, rapid development
🏗️ System Architecture Diagram
High-Level Architecture
🔄 Data Flow Architecture
User Request Flow
Health Dashboard Flow (Example)
Health Data Models
Biomarker Category
Health Metric
AI Chat Message
Healthcare Provider
Medical File
🔌 API Architecture
RESTful API Design
Base URLs:
Production: https://api.arogyadost.in
Development: https://api-dev.arogyadost.in
API Endpoints Structure:
Standard Response Envelope:
Error Response:
API Documentation
Swagger UI: /docs - Interactive API explorer
ReDoc: /redoc - Clean API reference
OpenAPI Spec: Auto-generated from FastAPI type hints
🔐 Security Architecture
Authentication & Authorization (Planned)
Current Security Measures
Layer
Security Feature
Status
CORS Configuration
Allowed Origins:
Allowed Methods: GET, POST, PUT, DELETE, OPTIONS Allowed Headers: Content-Type, Authorization, Accept
📊 State Management Architecture
Frontend State Management
React Query (TanStack Query)
Cache Strategy:
Stale Time: 5 minutes (health data)
Cache Time: 10 minutes (inactive data)
Retry: 3 attempts with exponential backoff
Refetch: On window focus, network reconnect
Backend State Management
In-Memory Store (MVP)
Biomarker data: Preloaded static data
Chat history: In-memory dict (ephemeral)
Future: Migrate to PostgreSQL/DynamoDB
🚀 Deployment Architecture
Frontend Deployment (AWS Amplify)
Build Settings:
Backend Deployment (Elastic Beanstalk)
Deployment Configuration:
Platform: Python 3.11 on Amazon Linux 2023
Instance: t3.micro (1 vCPU, 1 GB RAM)
Auto-scaling: Single instance (MVP), scalable to multiple
Health check: /api/health/status endpoint
Rolling deployment: Zero-downtime updates
📈 Scalability Considerations
Current Architecture (MVP)
Component
Current
Capacity
Bottleneck
Future Scaling Strategy
Phase 1 (0-1K Users)
Current architecture sufficient
Monitor performance metrics
Add database (PostgreSQL RDS)
Phase 2 (1K-10K Users)
Auto-scaling group (2-4 t3.small instances)
Application Load Balancer
Phase 3 (10K-100K Users)
Microservices architecture
Separate services for health, chat, files
ElastiCache for session management
CloudFront CDN for static assets
DynamoDB for high-throughput data
Phase 4 (100K+ Users)
Event-driven architecture (SQS, SNS)
ML model serving (SageMaker)
Real-time analytics (Kinesis)
🔍 Monitoring & Observability
Current Monitoring
Planned Monitoring
🔗 Integration Points
Planned Integrations
ABDM (Ayushman Bharat Digital Mission)
Health ID creation and verification
PHR (Personal Health Record) linking
Hospital/clinic data exchange
Wearable Devices
Apple Health / Google Fit integration
Telemedicine Platforms
Video consultation integration
Payment Gateways
Razorpay / Stripe integration
Healthcare provider payments
📝 Technical Debt & Future Work
Known Limitations (MVP)
In-memory data storage - Not persistent across restarts
No authentication - All data publicly accessible
Mock data - Not real user data
Single instance - No high availability
No analytics - No usage tracking
Limited error handling - Basic error responses
Planned Improvements
Short-term (Next 3 Months)
Mid-term (3-6 Months)
Long-term (6-12 Months)
[[README|MVP Overview]] - High-level overview and getting started
[[DEPLOYMENT_STATUS|Deployment Status]] - Current deployment health
[[aws-infrastructure-report|AWS Infrastructure]] - Detailed AWS resources and costs
[[arogyadost-backend/API_ARCHITECTURE|Backend Architecture]] - Backend-specific architecture
[[arogyadost-web/WEBSITE_ARCHITECTURE_SUMMARY|Web Architecture]] - Frontend architecture details
Created: 2025-12-29 Last Updated: 2025-12-29 Version: 1.0 Maintained By: Technical Team
[[README|← Back to MVP Overview]]