How nil1729/food-order-app works
Project type and purpose
• This is a full-stack food-ordering web application (SPA) built with Vue.js on the client, Node.js/Express for the API server, MongoDB for persistent storage, Firebase for file storage and authentication, and Razorpay for payment processing.
File structure
• Top-level “client/” directory contains the Vue.js SPA: components, layouts, pages, Vuex store, router, Firebase front-end config.
• Root folder holds the Express app (server.js, index.js, routes/, models/, middleware/, config/), Docker/Nginx configs, admin scripts.
• Config files (config/db.js, config/admin.js, config/razorpay.js) set up MongoDB, Firebase Admin SDK, Razorpay.
• models/ defines Mongoose schemas for User, Product, Order.
• routes/ defines the REST API endpoints (auths, products, orders, admin).
• middleware/ contains authentication, pagination.
• Tests folder shows one server integration test.
README for additional insights
• The README confirms the tech stack and describes how Firebase Authentication and Storage are used, plus Razorpay for payments.
• It notes an admin mode for product management.
a. Main components
• Client (Vue.js SPA with Vuex & Vue Router)
• API Server (Node.js/Express)
• Data Store (MongoDB Atlas)
• File Storage & Auth (Firebase Storage & Firebase Authentication)
• Payment Gateway (Razorpay)
• Admin interface (Node script / Express admin routes)
• Reverse Proxy (Nginx) / Docker
b. Relationships & interactions
• User browser ←→ SPA (HTTPS)
• SPA → API server (REST calls for products, cart, orders, profile)
• API server ↔ MongoDB (CRUD on products, orders, users)
• API server ↔ Firebase Admin SDK (upload product images to Storage, validate tokens)
• SPA ↔ Firebase Auth (client-side login via Google/email)
• SPA → Razorpay (checkout widget) → Razorpay backend
• API server → Razorpay (verify and capture payments)
• Admin script/UI → API server → MongoDB
c. Architectural patterns & design principles
• Client: Component-based SPA, state managed by Vuex, route-based code splitting.
• API: MVC-like organization (routes → controllers in routes/, models in models/, middleware for auth/pagination).
• External services abstracted by config modules (config/razorpay.js, config/admin.js).
• Separation of concerns: authentication, business logic, data access.
d. Key technologies/frameworks
• Vue.js, Vuex, Vue Router (frontend)
• Node.js, Express, Mongoose (backend)
• MongoDB Atlas (NoSQL database)
• Firebase Storage & Admin SDK, Firebase Auth (file storage & user auth)
• Razorpay Checkout & REST API (payments)
• Nginx (reverse-proxy), Docker (containerization)