How atanu2k4/munchmate works
Project Type and Purpose
• This is a single-page, full-stack web application (frontend heavy) for online food ordering and pick-up, built with React (Vite) and backed by Firebase (Auth & Firestore) plus Cloudinary for image storage. Its core use cases: user authentication, menu browsing, real-time availability, cart/checkout, order history, and an admin panel for menu management.
File Structure & Architectural Patterns
• src/
• components/ – UI elements and pages (Landing, Menu, Cart, Orders, Payment, Admin interfaces)
• context/ – React Context provider (CartContext) for global state management
• config.js – Firebase and Cloudinary configuration
• main.jsx – React application entry point, bootstraps Router and Context
• App.jsx – Top-level component mounting the router and layout
• public/ & index.html – Static assets and HTML template served by Vite
• vite.config.js – Build and dev-server configuration
• eslint.config.js – Linting rules
• vercel.json – Deployment settings
Architectural patterns:
• SPA (Single Page Application) with React Router for client-side routing
• Global state via Context API (CartContext)
• Component-based UI with clearly separated presentational and container logic
• BaaS pattern: Firebase Auth/Firestore as backend services; Cloudinary for media
Main System Components
• Browser (Client)
• React SPA (Vite-bundled)
• UI Components & Pages
• React Router (routes: /, /menu, /cart, /signin, /signup, /profile, /orders, /admin)
• React Context (CartContext for cart state)
• Backend Services (External)
• Firebase Authentication – user sign-up/sign-in, session management, email verification
• Firebase Firestore – NoSQL database for users, menu items, orders, availability status
• Cloudinary – image hosting and CDN for menu item photos
• Third-party Libraries
• TailwindCSS – utility-first styling
• Framer Motion & GSAP – animations and transitions
Interactions and Data Flows
• On app load, client fetches static bundle from Vite dev/build server
• User navigates via React Router; pages request data via Firebase SDK (configured in src/config.js)
• Auth flows: SignUp/SignIn pages interact with Firebase Auth APIs → on success, store user in context or local state
• Menu page queries Firestore collections for items; UI shows real-time availability (Firestore listeners)
• CartContext accumulates selections; on checkout, Payment component writes order records to Firestore
• Admin pages write CRUD operations to Firestore for menu management; Cloudinary upload widget used for images
• All reads/writes occur over HTTPS to Firebase endpoints; Cloudinary assets served over CDN
Architectural Patterns & Design Principles
• Separation of concerns: UI components, state management, data access layers
• Reactive data bindings: Firestore listeners for real-time updates
• Stateless functional React components where possible
• Resilient BaaS integration (client-side only, no custom server)