An open API service indexing awesome lists of open source software.

https://github.com/anashany2193/mern-food-ordering-backend

The backend API for the MERN Food Ordering app handles restaurant listings, user profiles, authentication, and order management. Built with Express, it includes endpoints for searching, filtering, and updating orders. Integrated with Stripe for payments and Auth0 for secure user authentication.
https://github.com/anashany2193/mern-food-ordering-backend

cloudinary concurrently cors dotenv express jsonwebtoken mongodb mongoose multer nodemon oauth2 stripe typescript

Last synced: 2 months ago
JSON representation

The backend API for the MERN Food Ordering app handles restaurant listings, user profiles, authentication, and order management. Built with Express, it includes endpoints for searching, filtering, and updating orders. Integrated with Stripe for payments and Auth0 for secure user authentication.

Awesome Lists containing this project

README

          

# MERN Food Ordering - Backend 🍔🍕🍜

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.

## Project Overview 🚀

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](https://github.com/AnasHany2193/mern-food-ordering-frontend), which completes the user interface.

### Key Features ✨

- **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.

## Setup Guide 🛠

### Prerequisites

- Node.js & npm
- MongoDB
- Auth0 account
- Stripe account

### Installation Steps

1. **Clone the repository**:

```bash
git clone https://github.com/AnasHany2193/mern-food-ordering-backend.git
cd mern-food-ordering-backend
```

2. **Install dependencies**:

```bash
npm install
```

3. **Configure Environment Variables**:
Create a `.env` file at the root of the project with the following variables:

```plaintext
PORT=5000

MONGODB_CONNECTION_STRING=

AUTH0_AUDIENCE=
AUTH0_ISSUER_BASE_URL=
AUTH0_TOKEN_SIGNING_ALG=

CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=
CLOUDINARY_CLOUD_NAME=

FRONTEND_URL=
STRIPE_API_KEY=
STRIPE_WEBHOOK_SECRET=
```

4. **Start the Development Server**:

```bash
npm run dev
```

The backend will be available at `http://localhost:7000`.

## Frontend Setup 🌐

To complete the project, clone and set up the frontend as described [here](https://github.com/AnasHany2193/mern-food-ordering-frontend). Make sure the frontend `.env` file is configured to connect with this backend.

## Project Video 📹

![A demo video](src/assets/mern-food-ordering.mp4)

## API Endpoints 📚

- **Authentication**: `/api/auth`
- **Restaurants**: `/api/restaurants`
- **Orders**: `/api/orders`
- **Payments**: `/api/payments`

## Contributing 🤝

Feel free to open issues, make pull requests, or suggest improvements!