Food-Carts is a full-stack food ordering application built with the MERN stack (MongoDB, Express, React, Node.js). It features user authentication, cart management, menu browsing, and Stripe integration for payment processing.
- User Authentication: Register, login, and manage user profiles securely using Firebase Authentication and JWT.
- Menu Management: Browse and search food items from a well-organized menu.
- Cart Management: Add items to the cart, adjust quantities, and proceed to checkout seamlessly.
- Payment Integration: Secure payment processing using Stripe.
- Admin Dashboard: Manage menu items, orders, and users with an intuitive interface.
- Order Tracking & Customer Support: Future features to enhance the overall customer experience.
- Frontend: React, Tailwind CSS, Vite
- Backend: Node.js, Express
- Database: MongoDB, Mongoose
- Authentication: Firebase Authentication, JWT
- Payment Gateway: Stripe
- State Management: React Context, React Query
- Styling: Tailwind CSS, DaisyUI
- Icons: React Icons
-
Clone the repository:
git clone https://github.com/your-username/food-carts-server.git cd food-carts-server
-
Install dependencies:
npm install
-
Set up environment variables:
Create a
.env
file in the root directory and add the following:PORT=5000 DB_USER=yourMongoDBUsername DB_PASS=yourMongoDBPassword PAYMENT_SECRET_KEY=yourStripeSecretKey ACCESS_TOKEN_SECRET=yourJWTSecretKey
-
Start the backend server:
npm start
-
Clone the repository:
git clone https://github.com/your-username/food-carts-client.git cd food-carts-client
-
Install dependencies:
npm install
-
Set up Firebase Authentication:
Add your Firebase configuration in the frontend app by creating a
.env.local
file and adding the necessary Firebase credentials. -
Start the frontend server:
npm run dev
- User Registration and Login: Users can sign up and log in to their accounts to browse the menu and place orders.
- Menu Browsing: Explore the available food items and choose your favorites.
- Cart Management: Add food items to your cart, adjust quantities, and proceed to checkout.
- Admin Features: Admins can access a dashboard to manage menu items, view orders, and manage users.
- Payment: Securely pay for your order using Stripe.
- POST /jwt: Generate a JWT token for authentication.
- GET /menu: Fetch all available food items.
- POST /carts: Add an item to the cart.
- GET /users: Fetch user details.
- POST /create-payment-intent: Create a payment intent for Stripe payments.
- GET /admin-stats: View statistics for admins.
- GET /order-stats: View statistics for orders.
Deploy the backend on platforms like Heroku or DigitalOcean. Deploy the frontend on platforms like Netlify or Vercel.
Make sure to update the environment variables with the correct values in the respective platforms for both frontend and backend.
Contributions are welcome! Please open an issue or submit a pull request if you'd like to contribute to the project.
- Fork the repository.
- Create your feature branch:
git checkout -b feature-name
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin feature-name
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.