How atanu2k4/munchmate_admin works
Project Type and Purpose
• This is a single-page admin dashboard (full-stack BaaS) built with React and Vite.
• It provides restaurant owners with UI for managing menu items, tracking orders, scanning QR codes, and viewing invoices in real time.
File Structure
• Top-level config files: package.json, vite.config.js, vercel.json, eslint.config.js.
• Public assets: index.html, public/.
• Source folder:
• src/main.jsx – application entry point & ReactDOM.render
• src/App.jsx – root component with route/layout logic
• src/config.js – Firebase SDK initialization
• src/components/ – feature components (AdminMenu, AdminOrders, AdminScanQR, AdminNav, OrderInvoiceDetail)
• src/App.css & src/index.css – global & utility styles
README for Additional Insights
• Backend (BaaS): Firebase Firestore (real‐time DB), Firebase Auth, Firebase Storage
• External service: Cloudinary for image uploads
• Hosting: Vercel (via vercel.json) or Firebase Hosting
Main Components & Interactions
a. Frontend SPA (Browser)
• React app loads index.html → main.jsx → App.jsx
• User interacts with UI components under src/components/
• State management via React Hooks
b. Firebase Services
• Firestore: orders collection, menu items collection, real-time listeners
• Auth: user sign-in (if enabled)
• Storage: file uploads (if used)
c. Cloudinary
• Image upload endpoint for menu item photos
d. Hosting/CDN
• Served from Vercel or Firebase Hosting
Data Flow Example (Order Lifecycle):
1. Admin clicks “Mark Delivered” in AdminOrders.jsx.
2. React calls Firestore SDK (config.js) to update document status.
3. Firestore triggers real-time update → UI re-renders with new status.
Architectural Patterns & Principles
• Component-based UI (atomic React components)
• SPA routing & layout in App.jsx
• Serverless BaaS backend (no custom node server)
• Real-time data via Firestore listeners
• Externalized media storage: Cloudinary
• CSS utilities (Tailwind) + motion library (Framer Motion)