This project is an API service for a pizza-delivery company. All APIs are RESTful.
Just clone this project and start app.js to begin using the API.
node app.js
The API server allows the following:
-
CRUD operations for users. An instance of a user stores their name, address and email ID.
-
CRUD operations for tokens. Token generation is equivalent to a user logging in and token is required for most API requests.
-
Fetching an item list of pizzas and sizes that a user can add to their cart
-
CRUD operations for the cart of a user.
-
Creating orders. An order is created for the existing items in cart and clears the existing cart on creation. Logged-in users can create an order by sending a payment-token that can be validated via Stripe APIs. A user can fetch their orders and delete an existing order to get a refund provided it is within fifteen minutes of creation.
-
The server is integrated with mailgun.com to email the user on success/failure of order creation as well as payment refunds.
The API specs are provided for each of the resources that can be requested
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.