Skip to content

Latest commit

 

History

History
119 lines (95 loc) · 4.26 KB

README.md

File metadata and controls

119 lines (95 loc) · 4.26 KB

Simmer Eats

Simmer Eats API

REST API that gets information from MongoDB cloud storage for e-commerce web applications. It is used in the Simmer Eats project. It currently offers 3 different authorization levels: Basic Authentication, Business Authentication, and Admin Authentication.

GitHub deployments

💻 Technology Stack

Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge

🚀 Quick start

  1. Local Development Mode
# clone the repository
git clone https://github.com/raquel-f/simmer-eats-API.git

# install dependencies
npm install
  1. Setup Environment Variables
# Mongo DB username
DB_USER=...

# Mongo DB password
DB_PASSWORD=...

# JSON Web Token Secret
JWT_SECRET=...

# Stripe Secret Key for payment integration
STRIPE_SECRET=...

# Stripe Secret Key for webhook events
STRIPE_WEBHOOK_SECRET=...
  1. Run the project
# run the project
npm start
  1. Usage

    Connect to the API using Postman on port 5000.

  2. Open the source code

    The project auto-updates as you edit the files thanks to Nodemon. Don't forget to save the changes!

🧐 What's inside?

A quick look at the top-level files and directories you'll see in this project.

.
├── constants
├── controllers
├── docs
├── middleware
├── models
├── node_modules
├── routes
├── uploads
├── .env
├── .gitignore
├── index.js
├── package-lock.json
├── README.md
└── vercel.json

🔌 API Endpoints (Most Used)

HTTP Method Authentication Endpoint Action
GET None /food Retrieve all food items
GET None /food/:id Retrieve details of a single food item
GET Admin /user/:id Retrieve details of a single user account
GET Basic /user/me Retrieve details of the authenticated user's account
POST None /user/signup Create a new user account
POST None /user/signin Login with an existing user account
PATCH Basic /user/me Update details of the authenticated user's account
DELETE Basic /user/me Delete the authenticated user's account
GET None /image/:id Retrieve details of a single image
POST Business /image Create a new image
GET Basic /cart/me Retrieve details of the authenticated user's shopping cart
POST Basic /stripe/createCheckout Create a new Stripe payment checkout session
POST None /webhook Handle Stripe webhook events
GET Basic /delivery/me Retrieve details of the authenticated user's deliveries