You are building the API for a pizza-delivery company. Don't worry about a frontend, just build the API. Here's the spec from your project manager:
-
New users can be created, their information can be edited, and they can be deleted. We should store their name, email address, and street address.
-
Users can log in and log out by creating or destroying a token.
-
When a user is logged in, they should be able to GET all the possible menu items (these items can be hardcoded into the system).
-
A logged-in user should be able to fill a shopping cart with menu items
-
A logged-in user should be able to create an order. You should integrate with the Sandbox of Stripe.com to accept their payment. Note: Use the stripe sandbox for your testing. Follow this link and click on the "tokens" tab to see the fake tokens you can use server-side to confirm the integration is working: https://stripe.com/docs/testing#cards
-
When an order is placed, you should email the user a receipt. You should integrate with the sandbox of Mailgun.com for this. Note: Every Mailgun account comes with a sandbox email account domain ([email protected]) that you can send from by default. So, there's no need to setup any DNS for your domain for this task https://documentation.mailgun.com/en/latest/faqs.html#how-do-i-pick-a-domain-name-for-my-mailgun-account
API Documentation is in /doc
folder
Run the following commands to create the certificate files needed to start the HTTPS server. If these files are not present only the HTTP server will start
mkdir https
cd https
openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem