How brighteyekid/bloodsync works
Project Type & Purpose
• The project is a full-stack blood donation management system. Its purpose is to streamline blood donation operations—from donor interactions, appointment scheduling, to blood request management and real-time inventory updates.
File Structure
• Main directories:
• Frontend (located in the root “src” folder and additional configuration files such as tailwind.config.js, tsconfig.json, etc.).
• Backend (located in the “backend” folder) that includes:
▪ API endpoints under “backend/src/api”, with submodules for models and services (e.g., authentication, blood donation, blood request handling, digilocker integration, maps).
▪ Application entry point (“backend/src/app.py”).
▪ Database configuration and migration components under “backend/src/databases” and “backend/src/migrations”.
• Supporting files include build configurations for the frontend (package.json, pnpm-lock.yaml, etc.) and migration-related files for the backend. This clearly shows a separation into presentation (frontend), business logic & API (backend), and persistence (database).
Key Components and Their Relationships
a. Frontend Component:
• Developed with React, TypeScript, Tailwind CSS.
• Manages user interactions for donors, administrators, and general site navigation.
• Uses Axios (in “src/api/axios.ts”) for communicating with the backend.
b. Backend/API Component:
• Provides RESTful endpoints to serve data and business logic.
• Contains distinct modules under “api/services” for functionalities such as authentication, blood donation events, blood request processing, external integrations (e.g., digilocker, maps).
• Implements a service layer (possibly influenced by a microservice or layered architecture) to separate models from services.
c. Database and Migrations:
• Database access and configuration are managed in “backend/src/databases/db.py”.
• Migration scripts (found under “backend/src/migrations”) indicate that schema evolution is managed in a controlled manner.
d. External API/Service Integrations:
• Components like “digilocker_integration.py” and “maps.py” suggest connectivity with third-party services (for identity or location-based functionalities).
Architectural Patterns & Design Principles
• Separation of Concerns: The project divides responsibilities among the frontend (UI), backend (API business logic), and the database layer.
• Modular Design: Distinct folders for API models, services, and integrations indicate a modular and maintainable architecture.
• RESTful Communication: Clearly defined API endpoints between the frontend and backend.
• Scalability: Use of migrations and dedicated service modules implies that the architecture is built to evolve as the system grows.