How rajshrey7/aapda-mitra works
Project Type and Purpose
• This is a full-stack, MERN-based disaster preparedness platform (“Aapda Mitra”) with real-time features (Socket.IO) and VR modules.
• It serves three user groups (Students, Teachers, Administrators), offering quizzes, VR drills, chat, analytics, and external integrations (weather, SMS, AI).
Main Components
a. User Interfaces
• Student/Teacher/Admin on Web Browser or Mobile (PWA)
• VR Client (A-Frame scenes)
b. Frontend
• React/Vite app (UI, routing, state & context, theming, i18n)
• Socket.IO client for live updates
c. Backend
• Express.js API server (REST endpoints, controllers, middleware)
• WebSocket service (real-time chat & game sync)
d. Database
• MongoDB (collections for users, quizzes, sessions, scores, drills, modules)
e. External Services
• OpenWeather API (weather alerts)
• Twilio (SMS alerts)
• OpenAI/Gemini (chatbot & quiz generation)
• Google Maps API (interactive maps)
Relationships & Data Flows
• Web UI ↔ HTTP REST API (login, quizzes, modules, analytics)
• Web UI ↔ WebSocket Server (chat messages, live leaderboards, game state)
• API Server ↔ MongoDB (CRUD for all data)
• API Server ↔ External Services (weather, SMS, AI)
• VR Client loads static HTML/GLTF assets from Frontend Public folder and reports drill results via API
Architectural Patterns & Principles
• Layered architecture: Presentation (React) → API (Express) → Persistence (MongoDB)
• Separation of concerns:
• UI components vs. page components vs. contexts vs. services
• Controllers, services, models, and routes on the server
• Real-time microservice: Dedicated websockets folder/server for high-volume, bidirectional events
• Modularization: Each domain (quiz, game, drill, alerts) has its own routes, controllers, and services
• Weather Alerts
• SMS Alerts
• AI Chatbot & Quiz Gen
• Maps & Geolocation
• Who uses the system
• Where they interact (browser/VR)
• How data flows to/from the server and database
• Which third‐party services enrich the platform