Foodify is a full-featured food ordering website developed using the MERN stack, complete with secure transaction functionality via Stripe. The project is organized into three main folders: frontend
, backend
, and admin
. The frontend
and admin
components utilize Vite for fast development builds, while the backend
is configured with Nodemon for live reloading during development.
- User Authentication: Register, login, and manage user sessions.
- Menu Management: View and order from a variety of food items.
- Cart Functionality: Add, update, and remove items in the cart.
- Order Processing: Place orders and manage order history.
- Payment Integration: Secure payments using Stripe API.
- Admin Dashboard: Manage food items, track orders, and handle other administrative functions.
- Responsive Design: User-friendly on desktop and mobile.
- Frontend: React, Vite, Tailwind CSS
- Backend: Node.js, Express.js, MongoDB
- Admin: React, Vite
- Payment: Stripe API for secure transactions
/frontend
: Contains the user-facing side of the Foodify app, built with Vite and React./backend
: Server-side code using Node.js and Express.js./admin
: Administrative dashboard built with Vite and React.
- Node.js (v14 or above)
- MongoDB (Local or MongoDB Atlas for remote DB)
- Stripe Account (for payment integration)
git clone https://github.com/your-username/foodify.git
cd foodify
cd backend
npm install
cd ../frontend
npm install
cd ../admin
npm install
Create a .env
file in the backend
folder and configure the following variables:
PORT=5000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
STRIPE_SECRET_KEY=your_stripe_secret_key
- Ensure your MongoDB server is running.
- For MongoDB Atlas, replace
MONGODB_URI
with your connection string.
The backend server uses Nodemon for live reloading during development.
cd backend
npm run server
The frontend is powered by Vite for faster builds and reloading.
cd ../frontend
npm run dev
The admin dashboard also utilizes Vite for the same benefits.
cd ../admin
npm run dev
- Frontend: http://localhost:3000
- Backend: http://localhost:5000
- Admin: http://localhost:4000 (or whatever port specified in your Vite config)
Script | Description |
---|---|
npm run server |
Starts the backend server using Nodemon with live reloading. |
npm run start |
Starts the backend server without Nodemon. |
Script | Description |
---|---|
npm run dev |
Starts the Vite server for development with HMR. |
npm run build |
Builds the project for production. |
npm run serve |
Serves the built project for production. |
The backend requires the following environment variables to be set up in a .env
file:
- PORT: Port number for the backend server (default is
5000
). - MONGODB_URI: Connection string for MongoDB.
- JWT_SECRET: Secret key for JSON Web Token (JWT) generation and validation.
- STRIPE_SECRET_KEY: Secret key from your Stripe account for handling payments.
This project is licensed under the MIT License.