How yash-kumarsharma/elira works
Main Components
a. User’s Browser
• Loads static HTML/CSS/JS from a hosting server (e.g., GitHub Pages or any static-file host).
• Runs client-side logic: Tailwind CSS, Vanilla JS, Alpine.js.
• Manages demo-only auth in localStorage.
b. Static-File Hosting
• Serves all .html pages (index.html, budget.html, consult.html, etc.), CSS assets, images, audio.
c. Flask Backend Service (app.py)
• Provides the “Safe Routes Map” endpoint and any Python-powered features.
• Implements CORS for client calls.
d. External Services
• OSRM API for crime-aware route calculations.
• Leaflet.js library on the client for map rendering.
• EmailJS and WhatsApp link-based APIs for emergency alerts.
Relationships & Data Flows
• User’s Browser → (HTTP GET) → Static-File Hosting → .html + assets
• On /safe_routes_map.html: Browser JS → (XHR/Fetch) → Flask Backend → (OSRM API) → Flask returns JSON → Browser renders via Leaflet
• On /emergency_location.html: Browser geolocation → triggers EmailJS/WhatsApp links → external messaging services
• For all other pages: purely static client-side interactions; no backend calls (demo auth in localStorage)
Architectural Patterns & Design Principles
• Separation of Concerns: Static multi-page frontend vs. a single micro-service for dynamic mapping.
• Micro-service Pattern: Flask app isolated from static hosting, can be deployed separately.
• Client-heavy UI: Plain JS/Alpine.js for interactive components, reducing backend load.
• Serverless-style: Most pages need no server beyond static hosting.
Technologies & Frameworks to Call Out
• Frontend: HTML5, Tailwind CSS, Vanilla JS, Alpine.js
• Mapping: Leaflet.js + OSRM API
• Backend: Python, Flask, Flask-CORS
• Alerts: EmailJS, WhatsApp
• Auth (demo): Browser localStorage