📋 System Overview
EVEP Mobile Reflection Unit is a comprehensive vision screening and glasses prescription management system designed for school-based and mobile unit operations. The system integrates clinical workflows, inventory management, delivery tracking, and medical staff management into a unified platform.
🎯 Core Objectives:
- Streamline vision screening processes in schools and mobile units
- Manage complete patient journey from screening to glasses delivery
- Track inventory and manage glasses distribution
- Maintain comprehensive medical staff records and credentials
- Provide real-time analytics and reporting capabilities
🏗️ System Architecture
🌐 Frontend Layer
- React.js Application - Modern UI/UX
- Material-UI Components - Consistent design
- Responsive Design - Mobile & desktop
- Real-time Updates - Live data sync
- Role-based Access - Secure interfaces
🔧 Backend API Layer
- FastAPI Framework - High-performance API
- RESTful Endpoints - Standardized interfaces
- JWT Authentication - Secure access control
- Role-based Authorization - Granular permissions
- Request Validation - Data integrity
🗄️ Data Layer
- MongoDB Database - Flexible schema
- Collections Structure - Organized data
- Indexing Strategy - Performance optimization
- Data Validation - Schema enforcement
- Backup & Recovery - Data protection
🔐 Security Layer
- JWT Token Management - Session control
- Password Hashing - Secure storage
- API Rate Limiting - Abuse prevention
- CORS Configuration - Cross-origin security
- Input Sanitization - XSS prevention
🔄 Data Flow Architecture
📊 System Data Flow:
User Authentication
Medical staff login with credentials → JWT token generation → Role-based access granted
Patient Registration
Student/parent information capture → Database storage → Unique patient ID generation
Vision Screening
VA testing → Results recording → Clinical decision support → Prescription generation
Glasses Selection
Inventory check → Glasses selection → Prescription validation → Order processing
Delivery Management
Delivery scheduling → Status tracking → School coordination → Delivery confirmation
Analytics & Reporting
Data aggregation → Performance metrics → Report generation → Insights delivery
⚙️ Technology Stack
🛠️ Complete Technology Stack:
Frontend
React.js 18.x
Material-UI 5.x
TypeScript 4.x
Backend
FastAPI 0.104.x
Python 3.11+
Pydantic 2.x
Database
MongoDB 6.x
MongoDB Compass
Indexing Strategy
Authentication
JWT Tokens
bcrypt Hashing
Role-based Access
Deployment
Docker 24.x
Docker Compose
Nginx Web Server
Infrastructure
Linux Server
Port Management
SSL/TLS Security
🔒 Security Architecture
🛡️ Multi-Layer Security Implementation:
- Authentication Layer: JWT token-based authentication with configurable expiration
- Authorization Layer: Role-based access control (RBAC) with granular permissions
- Data Protection: Password hashing using bcrypt with salt rounds
- API Security: Rate limiting, input validation, and CORS protection
- Transport Security: HTTPS/TLS encryption for all communications
- Session Management: Secure token storage and automatic session expiration
- Audit Trail: Comprehensive logging of all system activities
- Data Validation: Pydantic models for request/response validation
🚀 Deployment Architecture
🏗️ Production Deployment Structure:
🌐 Web Server (Nginx)
Port: 8084
Role: Static file serving
Status: 🟢 Running
Container: evep-docs-nginx
⚡ Backend API (FastAPI)
Port: 8013
Role: API endpoints
Status: 🟢 Healthy
Container: evep-backend
🎨 Frontend App (React)
Port: 3013
Role: User interface
Status: 🟢 Healthy
Container: evep-frontend
🗄️ Database (MongoDB)
Port: 27030 (Primary)
Role: Data persistence
Status: 🟢 Running
Replica Set: Primary + 2 Secondaries + Arbiter
📡 API Endpoints Overview
🔗 Core API Endpoints:
Authentication & Users:
Mobile Screening Workflow:
Inventory Management:
Analytics & Insights:
System Health:
🐳 Current Docker Services Status
🟢 Live Production Services:
🎨 Frontend Service
- Container: evep-frontend
- Status: 🟢 Up 28 minutes (healthy)
- Port: 3013:3000
- Image: evep-my-firstcare-com-frontend
⚡ Backend Service
- Container: evep-backend
- Status: 🟢 Up 26 minutes (healthy)
- Port: 8013:8000
- Image: evep-my-firstcare-com-backend
🌐 Documentation Server
- Container: evep-docs-nginx
- Status: 🟢 Up 37 minutes
- Port: 8084:80
- Image: nginx:alpine
🗄️ MongoDB Cluster
- Primary: evep-mongo-primary (27030)
- Secondary 1: evep-mongo-secondary-1 (27031)
- Secondary 2: evep-mongo-secondary-2 (27032)
- Arbiter: evep-mongo-arbiter (27033)
🔴 Redis Cluster
- Master 1: evep-redis-master-1 (6395)
- Master 2: evep-redis-master-2 (6396)
- Master 3: evep-redis-master-3 (6397)
- Replicas: 3 nodes (6398-6400)
📊 Health Status
- Backend API: ✅ Healthy
- Frontend App: ✅ Healthy
- Documentation: ✅ Accessible
- Database: ✅ Running
📊 System Metrics & Monitoring
📈 Key Performance Indicators:
🎯 Performance Metrics
- API Response Time: < 200ms
- Database Query Time: < 100ms
- System Uptime: 99.9%
- Concurrent Users: 100+
📊 Business Metrics
- Daily Screenings: 50-100
- Glasses Deliveries: 20-40
- Patient Satisfaction: 95%
- Data Accuracy: 99.9%
🔍 Monitoring Tools
- Docker Health Checks
- API Response Monitoring
- Database Performance
- Error Rate Tracking
🚨 Alert System
- Service Down Alerts
- Performance Degradation
- Error Rate Thresholds
- Security Incident Alerts