How shreyas0017/munchmate works
Project type and purpose
• This is a single‐page web application (SPA) built with React (via Vite) that leverages Firebase as a backend and Cloudinary for image hosting. Its purpose is to enable university students to browse menus, place orders, manage profiles, and handle real-time order/inventory updates.
File structure
• Top level: index.html, public/ for static assets, package.json, vite.config.js, vercel.json (deployment).
• src/:
• main.jsx – React entry point, ties into index.html via Vite.
• App.jsx & App.css – root component and styling.
• components/ – UI building blocks (Landing, Menu, Cart, Orders, Payment, Auth flows, Admin/Invoice).
• context/CartContext.jsx – React Context for global cart state.
• config.js – Firebase & Cloudinary setup.
• No backend code in repo; project uses Firebase Auth & Firestore as a BaaS.
README
• Confirms tech stack: React + Vite, TailwindCSS, Framer Motion/GSAP for animations, React Router, React Context, Firebase Auth/Firestore, Cloudinary, deployed on Vercel.
• Mentions user flows: authentication, real-time availability, cart interactions, admin dashboard, profile management.
Main components & relationships
a. Frontend SPA (client-side)
• Browser with React/Vite runtime
• React Router for page navigation
• React Context (CartContext) for state management
• UI Components (Navbar, Menu, Cart, Payment, Profile, AdminDashboard, etc.)
• Animations (Framer Motion, GSAP) & Styles (TailwindCSS)
b. Hosting
• Vercel (static asset/CDN hosting + automatic deploy from Git)
c. Backend Services (external)
• Firebase Auth – user sign-up/sign-in flows, email verification
• Firebase Firestore – menu items, orders, user profiles, real-time updates
• Cloudinary – storing & delivering food images
d. Data flows & interactions
• SPA → Firebase Auth (REST/SDK calls) for login/sign-up
• SPA → Firestore for CRUD on menus, orders, profile
• SPA → Cloudinary for image upload (admin side) and fetch (public menus)
• Firestore real-time listeners feeding back availability & order status into the SPA
Architectural patterns & design principles
• Component-based UI (atomic React components)
• Single source of truth in React Context for cart state
• Unidirectional data flow (React → Context → Components → external services)
• Separation of concerns:
• Presentation layer (components + styles)
• State management (Context)
• Configuration layer (config.js)
• Routing layer (React Router)
• External BaaS services (Firebase, Cloudinary)