How rohtanza/ramadanflow works
Main components
a. Frontend (React/Vite/Tailwind)
b. Backend API (Node.js/Express)
c. Database (MongoDB via Mongoose models)
d. Static data sources (JSON files for Azkar in backend/data)
e. External services (optional: third-party Hijri calendar or prayer-time API if used)
f. Authentication (JWT or session via auth middleware)
Relationships and data-flows
• Browser/Client ↔ React SPA communicates over HTTPS with the Express API
• Express routes call service layer → data layer (Mongoose models ↔ MongoDB)
• Services may read static JSON files for Azkar or call external APIs in calendarService
• Auth middleware guards protected routes, issuing/verifying JWTs stored in browser localStorage/context
• User actions (e.g., “Log Prayer,” “Favorite Hadith”) write to respective collections via models
Architectural patterns
• Layered architecture in backend:
– Routes (API endpoints)
– Middleware (auth.js)
– Services (business logic)
– Models (data persistence)
• React uses Context API (AuthContext) for global state and React Router for page navigation
• Separation of concerns between static assets (public) and dynamic SPA code (src)
• Use of JSON data files for Azkar lists rather than external DB tables