How sujalafx23-ux/sahakara works
Sahakara is a food-rescue platform: donors post surplus food, the app applies food-safety and distance rules to route it to an eligible shelter, animal recipient, or compost facility, and participants progress the rescue through pickup and delivery. The primary SPA uses Supabase directly for core data and realtime features; the separate Express/SQLite backend is documented as optional. Admin tools manage live operations and impact. The README documents several admin capabilities whose implementation details were not sampled, so their connections are limited to the admin controller and Supabase.
Main entry points: script.js Rescue SPA · server.js Express server · admin.js Admin portal · donationService.js Donation lifecycle
Components 21
Rescue application
- Rescue SPA
frontend/script.js - Safety ladder
frontend/matching.js - Supabase config
frontend/config.js
Admin operations
- Admin portal
frontend/admin/admin.js
Data services
- Supabase services
- Platform schema
supabase/schema.sql - Map / routing services
Optional backend
- Express server
backend/src/server.js - Donation routes
backend/src/routes/donations.js - Shelter / stats routes
backend/src/routes/misc.js - Auth routes
backend/src/routes/auth.js - Donation lifecycle
backend/src/donationService.js - Zone matching
backend/src/matching.js - Local SQLite
backend/src/db.js - OTP email
backend/src/emailService.js - Demo seed
backend/src/seed.js
Other components
- Donor
- Shelter / recipient
- Volunteer driver
- Administrator
- SMTP service
Connections 26
- Donor → Rescue SPA: posts food
- Rescue SPA → Safety ladder: requests match
- Safety ladder → Rescue SPA: returns recipient
- Rescue SPA → Supabase services: reads / writes
- Supabase services → Rescue SPA: realtime updates
- Shelter / recipient → Rescue SPA: claims donation
- Volunteer driver → Rescue SPA: updates progress
- Administrator → Admin portal: manages operations
- Admin portal → Supabase services: manages records
- Supabase services → Admin portal: streams updates
- Supabase config → Supabase services: creates client
- Platform schema → Supabase services: defines tables
- Admin portal → Map / routing services: uses map
- Rescue SPA → Map / routing services: uses maps
- Rescue SPA → Express server: auth API
- Express server → Donation routes: mounts routes
- Express server → Shelter / stats routes: mounts routes
- Express server → Auth routes: mounts routes
- Express server → Demo seed: initializes data
- Donation routes → Donation lifecycle: handles lifecycle
- Shelter / stats routes → Donation lifecycle: reads / toggles
- Auth routes → Local SQLite: reads / writes
- Auth routes → OTP email: sends OTP
- Donation lifecycle → Zone matching: finds shelter / driver
- Donation lifecycle → Local SQLite: reads / writes
- OTP email → SMTP service: sends mail