How aitchessbee/rehmat works
Project Type and Purpose
• Project Type: This is a full-stack application built to support online healthcare consultations specifically tailored for refugees. The frontend is built using a React-based client (see the “client” folder with pages for Home, Login, Signup, etc.), and the backend is a Python/Django server (located in the “server” folder with Django configuration and apps).
• Purpose: Rehmat aims to connect doctors with refugees through integrated video chat for consultations. It also supports on-site volunteer teams for when refugees lack internet connectivity, thereby addressing core sustainability development goals.
File Structure
• Client Side ("client" directory):
– Contains the source code (React components, pages, CSS modules, images) which shows a modular structure with dedicated directories for each page (e.g., Home, ContactUs, Login, Signup, etc.).
– Configuration files like package.json and package-lock.json indicate dependency management for a modern JavaScript/React app.
• Server Side ("server" directory):
– Contains a standard Django project structure, with configuration in the “config” directory and several Django apps: “donate”, “slot”, “user”, and “jobs.”
– The presence of “manage.py”, “db.sqlite3”, migration scripts, and templates clarifies that Django’s MVC (or “MVT”) pattern is in use.
– Additional assets like Dockerfile, docker-compose.yml, Makefile, and run.sh point to containerization and automated deployment considerations.
– The “jobs” directory suggests scheduled tasks or background processing (possibly for recurring tasks like notifications or slot management).
Architecture Components and Relationships
a. Main Components:
– Frontend (Client-side): React application deployed on Netlify (as per README “Deployed at” link).
– Backend (Server-side): Django-based RESTful API serving multiple domains including user management, donation handling, and slot scheduling.
– Database: SQLite (for development), which can conceptually be replaced with another RDBMS in production.
– Auxiliary components: Video chat integration (for online consultations) and background job processing (from the “jobs” module).
– Containerization/Deployment: Docker-related files indicate containerized deployment for the backend, and the frontend’s public folder (with _redirects) ensures proper routing on Netlify.
b. Relationships and Interactions:
– The frontend communicates with the backend via API endpoints (evident in the “client/src/config.js”, likely specifying backend URLs).
– Within the backend, the Django apps (“user”, “donate”, “slot”) interact with the database via ORM, handle user authentication, manage donation flows, and process scheduling.
– The “jobs” module interacts with the backend systems to potentially schedule tasks or run asynchronous processes.
– External services such as video chat tools (integration mentioned in README) connect with the backend and frontend to provide real-time communication.
Architectural Patterns and Design Principles
• Separation of Concerns: Clear boundary between frontend and backend.
• Modularization: Multiple Django apps (donate, user, slot) and segmented React pages/components promote reusability.
• MVC/MVT Pattern: Django follows the Model-View-Template pattern.
• Containerization: Using Docker and docker-compose to manage deployment environment and dependencies.
• API-Centric Communication: Likely REST endpoints (e.g., serializers present in Django apps) ensure standardized communication between the client and server.