Welcome to the Munch Mate Food Order App! This is a full-stack food ordering application built with HTML, CSS, React, JavaScript, Node.js, and Express. The application allows users to browse a menu, add items to a cart, adjust quantities, and place orders.
- Demo
- Features
- Technologies Used
- Advanced React Concepts and Best Practices
- Backend Development
- Installation
- Usage
Check out the live demo of the application hosted on Netlify: Munch Mate
Note: Backend is temporarily hosted on Render's free tier. Free tier instances spin down with inactivity, which can delay requests by 50 seconds or more.
- Browse menu items
- Add items to the cart
- Edit item quantities in the cart
- Checkout and place orders with customer details
- Frontend: HTML, CSS, React, JavaScript
- Backend: Node.js, Express
- State Management: Context API
- HTTP Requests: Custom React Hook
- Styling: Flexbox, Grid, CSS
- Using
useEffect
for side effects and their cleanup functions to avoid memory leaks and unexpected behaviors.
- Utilizing
Intl.NumberFormat
for consistent and locale-specific currency formatting.
- Building reusable components like
Input
,Button
, andModals
to maintain consistency and reduce code duplication.
- Leveraging refs for direct DOM manipulation and portals for rendering components outside the DOM hierarchy.
- Implementing
ContextAPI
for efficient state management and ensuring state updates are immutable.
- Creating a custom hook to encapsulate stateful logic, preventing code duplication.
- Using CSS Flexbox and Grid to create a responsive and adaptive layout.
- Importing Google Fonts and applying a modern, clean design with a consistent color palette and responsive elements.
- Using Express to set up the server and manage routing.
- Utilizing
body-parser
to parse incoming request bodies in a middleware before handling.
- Serving static files using
express.static
.
- Setting headers to allow cross-origin requests, enabling the frontend and backend to communicate effectively.
- Creating RESTful endpoints to handle GET and POST requests for meals and orders.
- Using Node.js
fs/promises
for asynchronous file operations to read and write data.
- Validating incoming data for orders to ensure all required fields are present and correctly formatted.
- Node.js installed on your machine
- npm (Node Package Manager) installed on your machine
-
Clone the repository
git clone https://github.com/trishna456/munch-mate-food-order.git
-
Install dependencies for the frontend
cd munch-mate-food-order npm install
-
Navigate to the backend folder and install dependencies
cd backend npm install
-
Start the backend server
cd backend npm start
-
Start the React frontend
cd .. npm run dev