How vishal2473/replate works
REPLATE is a surplus-food rescue platform connecting food donors with NGOs and volunteers, with administrators overseeing users, donations, and impact. The main workflow runs from donor inventory posting through NGO discovery and claiming, pickup, and delivery certification, followed by impact reporting. The React app routes users to role-specific dashboards; its documented preview uses localStorage-backed state, while the server exposes a separate Express/MongoDB API. The README also describes simulated map, notification, and photo-upload integrations; their wiring is not established by the sampled source, so they are omitted.
Main entry points: App.tsx App controller · api.ts Client state API · server.js Express server · Home.tsx Public home
Components 20
Web application
- App controller
src/App.tsx - Public home
src/pages/Home.tsx - Login / signup
src/pages/LoginSignup.tsx - About and contact
src/pages/About.tsx - Role navigation
src/components/Navbar.tsx - Localization
src/services/i18n.ts
Rescue workflow
- Donor dashboard
src/pages/donor/DonorDashboard.tsx - NGO dashboard
src/pages/ngo/NGODashboard.tsx
Administration
- Admin dashboard
src/pages/admin/AdminDashboard.tsx
API and persistence
- Client state API
src/services/api.ts - Auth endpoints
server/routes/authRoutes.js - Donation endpoints
server/routes/donationRoutes.js - Express server
server/server.js - User schema
server/models/User.js - Donation schema
server/models/FoodDonation.js - MongoDB
- Browser localStorage
Other components
- Donor
- NGO / volunteer
- Administrator
Connections 26
- Donor → App controller: uses
- NGO / volunteer → App controller: uses
- Administrator → App controller: uses
- App controller → Public home: renders
- App controller → Login / signup: renders
- App controller → About and contact: renders
- App controller → Donor dashboard: renders
- App controller → NGO dashboard: renders
- App controller → Admin dashboard: renders
- App controller → Role navigation: renders
- App controller → Client state API: initializes state
- Role navigation → Client state API: reads and updates preferences
- Public home → Client state API: reads listings
- Public home → Localization: translates labels
- Donor dashboard → Client state API: posts and reads donations
- NGO dashboard → Client state API: reads and updates donations
- Admin dashboard → Client state API: manages records
- Client state API → Browser localStorage: persists preview state
- Express server → Auth endpoints: mounts
- Express server → Donation endpoints: mounts
- Express server → MongoDB: connects
- Auth endpoints → User schema: queries and creates users
- Donation endpoints → Donation schema: queries and updates donations
- Login / signup → Client state API: authenticates
- Auth endpoints → MongoDB: persists users
- Donation endpoints → MongoDB: persists donations