How kruddha981/astrothunder-sahakara works
Sahakara is a food-rescue platform connecting surplus donors with shelters and, as food ages, animal-rescue and compost recipients. The primary browser workflow posts a donation, applies the safety-and-distance ladder to find an eligible recipient, and tracks pickup and delivery; Supabase is the documented core data/auth/realtime service. The admin portal manages live operations and impact reporting. An optional Express backend provides a separate legacy API and SMTP OTP dispatch. Some frontend wiring and backend service details are unsampled, so the graph omits uncertain links.
Main entry points: script.js Rescue SPA · server.js Express API · donationService.js Donation lifecycle · admin.js Admin portal
Components 20
Rescue experience
- Rescue SPA
frontend/script.js - Safety ladder
frontend/matching.js - Client config
frontend/config.js
Admin operations
- Admin portal
frontend/admin/admin.js
Optional API
- Express API
backend/src/server.js - Auth routes
backend/src/routes/auth.js - Donation routes
backend/src/routes/donations.js - Shelter and stats routes
backend/src/routes/misc.js - Donation lifecycle
backend/src/donationService.js - Zone matching
backend/src/matching.js - OTP email
backend/src/emailService.js - Backend DB client
backend/src/db.js
Platform data
- Supabase schema
supabase/schema.sql - Supabase service
Other components
- Donor
- Shelter / recipient
- Volunteer driver
- Administrator
- SMTP provider
- Map and routing services
Connections 24
- Donor → Rescue SPA: posts surplus
- Rescue SPA → Client config: gets client config
- Rescue SPA → Safety ladder: evaluates rescue tier
- Rescue SPA → Supabase service: reads and writes donations
- Supabase service → Rescue SPA: streams live updates
- Shelter / recipient → Rescue SPA: uses rescue portal
- Volunteer driver → Rescue SPA: updates rescue status
- Administrator → Admin portal: manages operations
- Admin portal → Supabase service: manages records and logs
- Admin portal → Map and routing services: renders maps and routes
- Rescue SPA → Map and routing services: renders recipient map
- Donor → Express API: posts via optional API
- Express API → Auth routes: dispatches auth
- Express API → Donation routes: dispatches donations
- Express API → Shelter and stats routes: dispatches support routes
- Donation routes → Donation lifecycle: runs lifecycle actions
- Shelter and stats routes → Donation lifecycle: requests shelter and stats
- Auth routes → Backend DB client: reads and writes auth data
- Auth routes → OTP email: sends OTP
- OTP email → SMTP provider: sends email
- Donation lifecycle → Zone matching: selects shelter and driver
- Donation lifecycle → Backend DB client: reads and updates records
- Backend DB client → Supabase service: queries database
- Supabase schema → Supabase service: defines tables and policies