Welcome to the backend repository for the MERN Food Ordering App! This project handles API functionality, database management, and integrations for a full-featured food ordering platform.
The backend is built with Node.js, Express, MongoDB, and Mongoose. It manages restaurant listings, user profiles, order processing, payment via Stripe, and much more. This repository works in tandem with the frontend found here, which completes the user interface.
- User Authentication: Auth0 for secure, managed authentication.
- Restaurant Management: API endpoints for adding, updating, and managing restaurant data.
- Order Management: Create, update, and track customer orders.
- Payment Integration: Stripe for processing payments.
- Search and Filtering: Allows searching by cuisine, rating, etc.
- Node.js & npm
- MongoDB
- Auth0 account
- Stripe account
-
Clone the repository:
git clone https://github.com/AnasHany2193/mern-food-ordering-backend.git cd mern-food-ordering-backend -
Install dependencies:
npm install
-
Configure Environment Variables: Create a
.envfile at the root of the project with the following variables:PORT=5000 MONGODB_CONNECTION_STRING=<Your MongoDB Connection String> AUTH0_AUDIENCE=<Your Auth0 API Audience> AUTH0_ISSUER_BASE_URL=<Your Auth0 Issuer URL> AUTH0_TOKEN_SIGNING_ALG=<Your Auth0 Token Signing Algorithm> CLOUDINARY_API_KEY=<Your Cloudinary API Key> CLOUDINARY_API_SECRET=<Your Cloudinary API Secret> CLOUDINARY_CLOUD_NAME=<Your Cloudinary Cloud Name> FRONTEND_URL=<Your Frontend URL> STRIPE_API_KEY=<Your Stripe API Key> STRIPE_WEBHOOK_SECRET=<Your Stripe Webhook Secret> -
Start the Development Server:
npm run dev
The backend will be available at
http://localhost:7000.
To complete the project, clone and set up the frontend as described here. Make sure the frontend .env file is configured to connect with this backend.
- Authentication:
/api/auth - Restaurants:
/api/restaurants - Orders:
/api/orders - Payments:
/api/payments
Feel free to open issues, make pull requests, or suggest improvements!