How elhabchimohammed666-hub/reduire_gaspillage_allimentaire_app works
PlateShare connects food donors with beneficiaries: donors publish surplus, beneficiaries discover nearby offers, reserve a basket and receive a pickup code, then a donor validates that code to complete collection. The React app routes users through exploration, account access and role-based dashboards; its API client calls the Express API, whose routes and controllers enforce access and update MongoDB records. The README documents geolocation, distance/category/free filters and pickup tracking; some feature implementations were not sampled, so their internal links are omitted where unverified.
Main entry points: ExplorePage.jsx Explore offers · App.jsx React app routes · app.js Express API · reservation.controller.js Reservation operations
Components 25
Web application
- React app routes
client/src/App.jsx - Home page
client/src/pages/HomePage.jsx - Explore offers
client/src/pages/ExplorePage.jsx - Listing filters
client/src/features/listings/ListingFilters.jsx - Map and geolocation
client/src/features/map/LeafletMap.jsx - Offer cards
client/src/features/listings/FoodCard.jsx - Pickup countdown
client/src/features/listings/CountdownTimer.jsx - Reservation dialog
client/src/features/reservations/ReservationModal.jsx - Account registration
client/src/pages/RegisterPage.jsx - Session and roles
client/src/context/AuthContext.jsx - Role dashboard
client/src/pages/DashboardPage.jsx - API client
client/src/services/api.js
API and access
- Express API
server/src/app.js - Listing routes
server/src/routes/listing.routes.js - Authentication routes
server/src/routes/auth.routes.js - Reservation routes
server/src/routes/reservation.routes.js - JWT authentication
server/src/middlewares/auth.middleware.js - Account operations
server/src/controllers/auth.controller.js - User records
server/src/models/User.js
Listings and discovery
- Listing operations
server/src/controllers/listing.controller.js - Food listings
server/src/models/FoodListing.js
Reservations
- Reservation operations
server/src/controllers/reservation.controller.js - Reservation records
server/src/models/Reservation.js
Other components
- Donor or beneficiary
- MongoDB
Connections 35
- Donor or beneficiary → React app routes: uses
client/src/App.jsx - React app routes → Home page: routes to
client/src/App.jsx - React app routes → Explore offers: routes to
client/src/App.jsx - React app routes → Account registration: routes to
client/src/App.jsx - React app routes → Role dashboard: protects route
client/src/App.jsx - Account registration → Session and roles: registers through
client/src/pages/RegisterPage.jsx - Session and roles → API client: calls
client/src/context/AuthContext.jsx - Explore offers → API client: loads offers
client/src/pages/ExplorePage.jsx - Explore offers → Listing filters: renders
client/src/pages/ExplorePage.jsx - Explore offers → Map and geolocation: renders
client/src/pages/ExplorePage.jsx - Explore offers → Offer cards: renders
client/src/pages/ExplorePage.jsx - Explore offers → Reservation dialog: opens
client/src/pages/ExplorePage.jsx - Offer cards → Pickup countdown: renders
client/src/features/listings/FoodCard.jsx - Role dashboard → API client: loads and updates
client/src/pages/DashboardPage.jsx - Role dashboard → Pickup countdown: renders
client/src/pages/DashboardPage.jsx - API client → Express API: requests API
README.md - Express API → Listing routes: mounts routes
server/src/app.js - Listing routes → Listing operations: dispatches
server/src/routes/listing.routes.js - Listing operations → Food listings: queries and changes
server/src/controllers/listing.controller.js - Listing operations → MongoDB: aggregates nearby offers
server/src/controllers/listing.controller.js - Express API → Authentication routes: mounts API routes
server/src/app.js - Authentication routes → Account operations: dispatches
server/src/routes/auth.routes.js - Account operations → User records: reads and writes
server/src/controllers/auth.controller.js - Express API → Reservation routes: mounts API routes
- Reservation routes → Reservation operations: dispatches
server/src/routes/reservation.routes.js - Reservation operations → Reservation records: creates and updates
server/src/controllers/reservation.controller.js - Reservation operations → Food listings: updates offer status
server/src/controllers/reservation.controller.js - Reservation operations → MongoDB: persists reservations
- Listing routes → JWT authentication: authenticates writes
server/src/routes/listing.routes.js - Reservation routes → JWT authentication: authenticates access
server/src/routes/reservation.routes.js - Authentication routes → JWT authentication: authenticates session
server/src/routes/auth.routes.js - JWT authentication → User records: loads user
server/src/middlewares/auth.middleware.js - Food listings → MongoDB: stores listings
- User records → MongoDB: stores accounts
- Reservation records → MongoDB: stores reservations