How avinandanroyy/bloodbridge works
BloodBridge is a blood-donation coordination API. A requester submits a blood request; the API uses donor eligibility and matching to create donor notifications, then WhatsApp replies can accept or decline and update the match. Donors also authenticate, verify identity, and maintain profiles. The graph includes the persistence and integration layers. Router wiring and several service relationships are supported by the source index; unsampled provider behavior is left unverified.
Main entry points: auth.py Authentication and eKYC · requests.py Blood requests · main.py FastAPI application · matching.py Donor matching
Components 25
API workflows
- FastAPI application
backend/app/main.py - Authentication and eKYC
backend/app/routers/auth.py - Donor profiles
backend/app/routers/donors.py - Blood requests
backend/app/routers/requests.py - WhatsApp replies
backend/app/routers/webhooks.py - Auth schemas
backend/app/schemas/auth.py - User schemas
backend/app/schemas/user.py - Request schemas
backend/app/schemas/request.py
Donation domain
- Donor eligibility
backend/app/services/eligibility.py - Donor matching
backend/app/services/matching.py - Donor accounts
backend/app/models/user.py - Blood request records
backend/app/models/blood_request.py - Match notifications
backend/app/models/match_notification.py - Domain statuses
backend/app/models/enums.py
Persistence and security
- JWT security
backend/app/core/security.py - Database sessions
backend/app/db/session.py - PostgreSQL
- Runtime settings
backend/app/core/config.py
External integrations
- eKYC service client
backend/app/services/ekyc.py - WhatsApp messaging
backend/app/services/whatsapp.py - Google identity
- eKYC provider
- WhatsApp provider
Other components
- Requester
- Donor
Connections 34
- Requester → FastAPI application: uses API
backend/app/main.py - Donor → FastAPI application: uses API
backend/app/main.py - FastAPI application → Authentication and eKYC: mounts routes
backend/app/main.py - FastAPI application → Donor profiles: mounts routes
backend/app/main.py - FastAPI application → Blood requests: mounts routes
backend/app/main.py - FastAPI application → WhatsApp replies: mounts routes
backend/app/main.py - Authentication and eKYC → Auth schemas: validates with
backend/app/routers/auth.py - Authentication and eKYC → User schemas: returns profile
backend/app/routers/auth.py - Authentication and eKYC → JWT security: creates tokens
backend/app/routers/auth.py - Authentication and eKYC → eKYC service client: verifies identity
backend/app/routers/auth.py - Authentication and eKYC → Donor accounts: reads and updates
backend/app/routers/auth.py - Donor profiles → Donor eligibility: checks eligibility
backend/app/routers/donors.py - Donor profiles → User schemas: uses profile schema
backend/app/routers/donors.py - Donor profiles → Donor accounts: reads and updates
backend/app/routers/donors.py - Blood requests → Request schemas: validates requests
backend/app/routers/requests.py - Blood requests → Donor eligibility: checks eligibility
backend/app/routers/requests.py - Blood requests → Donor matching: finds donors
backend/app/routers/requests.py - Blood requests → Blood request records: creates requests
backend/app/routers/requests.py - WhatsApp replies → Donor matching: loads pending match
backend/app/routers/webhooks.py - WhatsApp replies → WhatsApp messaging: sends replies
backend/app/routers/webhooks.py - WhatsApp replies → Match notifications: updates response
backend/app/routers/webhooks.py - Donor matching → WhatsApp messaging: dispatches alerts
backend/app/services/matching.py - Donor matching → Blood request records: queries requests
backend/app/services/matching.py - Donor matching → Donor accounts: selects donors
backend/app/services/matching.py - Donor matching → Match notifications: creates notifications
backend/app/services/matching.py - Authentication and eKYC → Database sessions: gets session
backend/app/routers/auth.py - Donor profiles → Database sessions: gets session
backend/app/routers/donors.py - Blood requests → Database sessions: gets session
backend/app/routers/requests.py - WhatsApp replies → Database sessions: gets session
backend/app/routers/webhooks.py - Database sessions → Runtime settings: loads connection settings
backend/app/db/session.py - Database sessions → PostgreSQL: opens sessions
- Authentication and eKYC → Google identity: verifies token
backend/app/routers/auth.py - eKYC service client → eKYC provider: calls provider
- WhatsApp messaging → WhatsApp provider: sends messages