A full-stack food ordering application built with the MERN stack (MongoDB, Express, React, Node.js).
- 🔐 User Authentication: Sign up, login, protected routes
- 🍽️ Menu Browsing: View food items with details and images
- 🛒 Shopping Cart: Add items, adjust quantities, place orders
- 📦 Order Tracking: View order history and status updates
- React (with Vite)
- React Router for navigation
- Context API for state management
- Tailwind CSS for styling
- Axios for API requests
- Node.js with Express
- MongoDB database
- JWT for authentication
- RESTful API design
- Node.js (v14+)
- MongoDB installed locally or a MongoDB Atlas account
-
Clone the repository:
git clone <repository-url> -
Install frontend dependencies:
cd react_template pnpm install -
Install backend dependencies:
cd backend npm install -
Set up environment variables:
- Create a
.envfile in the backend folder following the example in.env.example
- Create a
-
Seed the database with sample menu items (optional):
cd backend node src/seeds/menuSeeder.js
-
Start the backend server:
cd backend npm run dev -
Start the frontend development server:
cd .. pnpm run dev -
Open your browser and navigate to
http://localhost:5173
/
├── backend/ # Backend code
│ ├── src/
│ │ ├── config/ # Configuration files
│ │ ├── controllers/ # Request handlers
│ │ ├── middleware/ # Express middleware
│ │ ├── models/ # MongoDB models
│ │ ├── routes/ # API routes
│ │ └── utils/ # Utility functions
│ └── package.json
│
├── public/ # Static assets
│ └── assets/
│ └── images/ # Food images
│
├── src/ # Frontend code
│ ├── components/ # React components
│ │ ├── auth/ # Authentication components
│ │ ├── cart/ # Cart components
│ │ ├── layout/ # Layout components
│ │ ├── menu/ # Menu components
│ │ └── orders/ # Order components
│ │
│ ├── context/ # React context providers
│ ├── hooks/ # Custom React hooks
│ ├── pages/ # Page components
│ ├── utils/ # Utility functions
│ ├── App.jsx # Main App component
│ └── main.jsx # Entry point
│
└── package.json