How nirajkumardangi/food-donation works
Project Type and Purpose
• Type: Full-stack SPA (Single Page Application)
• Purpose: Allow donors to list food donations and recipients (shelters, food banks) to browse, request, and schedule pickups.
• Backend: Serverless (Firebase for Auth, Database, Hosting)
• External APIs: Google Maps for geolocation and directions
Main Components
A. Client / Frontend
• Browser / User Device
• React Application (built with Vite + Tailwind CSS)
• UI Component Library (src/Ui)
• Pages & Route Components (src/pages)
• Feature Components (src/components: Dashboard, Donation, Home, etc.)
• State Management & Utilities (ReduxStore.jsx, Storage.jsx)
B. Backend / Serverless Services
• Firebase Authentication
• Firebase Firestore (or Realtime Database)
• Firebase Hosting
C. External Services
• Google Maps API
D. Third-Party Integrations
• Browser Local Storage (via Storage.jsx)
Relationships and Data Flows
• User → React App:
– Authentication flows (login/register) call Firebase Auth SDK
– Navigation between pages triggers data fetches
• React App → Firebase Database:
– CRUD operations for donations, requests, user profiles
– Real-time listeners for notifications and status updates
• React App → Google Maps API:
– Geocoding addresses, displaying maps, plotting donation drop-off points
• React App (Redux Store) manages global state (authenticated user, donation listings, notifications)
Architectural Patterns and Design Principles
• Component-based UI: Broken into reusable “Ui” primitives and feature-specific components
• Container-presentational split: Pages orchestrate data; UI components handle rendering
• Unidirectional data flow: React → Redux → Components → Firebase
• Serverless micro-services: No custom backend servers; Firebase handles all backend concerns
• Real-time updates: Observer pattern via Firebase listeners