- Build a CLI interface that would allow the manager of the pizza place to:
To start the CLI: nodemon cli/index.js
π
-
View all the current menu items β
Run:list menu
-
View all the recent orders in the system (orders placed in the last 24 hours) β
Run:list orders
-
Lookup the details of a specific order by order ID β
Run:get order <ID>
// You can useget order 0
-
View all the users who have signed up in the last 24 hours β
Run:list users
-
Lookup the details of a specific user by email address β
Run:get user <EMAIL>
You can use:get user vigiho5448@trejni.com
// temporary email
- In order to test run
node index.js
and browse to http://localhost:3333/ π
Details (Scenario):
It is time to build a simple frontend for the Pizza-Delivery API you created in Homework Assignment #2. Please create a web app that allows customers to:
-
Signup on the site β
-
View all the items available to order β
-
Fill up a shopping cart β
-
Place an order (with fake credit card credentials), and receive an email receipt β
body: {email: String, password: String}
header: authorization
body: {email: String, name: String, password: String, street_address: String}
param: id
body: {email: String, name: String, password: String, street_address: String}
param: id
header: authorization
header: authorization
body: {itemId: String}
header: authorization
body: {cardNumber: String}
Details (Scenario):
You are building the API for a pizza-delivery company. 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. β (remaining: store users on desk instead of memory)
-
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. β
-
Create an Order with Stripe Integration ππ
A logged-in user should be able to create an order. Integrate with the Stripe.com Sandbox to process payments. Utilize Stripe's sandbox for testing purposes. Explore the Stripe testing documentation and the charges API to understand how to use fake tokens for server-side testing. -
Email Receipt with Mailgun Integration ππ
Once an order is placed, email the user a receipt. This should be done by integrating with the Mailgun.com sandbox. Each Mailgun account has a sandbox domain (likewhatever@sandbox123.mailgun.org
) that allows sending emails without DNS setup. For more details, visit the Mailgun FAQ.
Important Note: If you use external libraries (NPM) to integrate with Stripe or Mailgun, you will not pass this assignment. You must write your API calls from scratch.
This is an open-ended assignment. You may take any direction you'd like to go with it, as long as your project includes the requirements. It can include anything else you wish as well.
And please: Don't forget to document how a client should interact with the API you create!
This project now includes a GitHub Actions workflow that automatically updates npm dependencies and performs a vulnerability scanπ§. The workflow runs daily at 2 AM UTC and whenever changes are pushed to the master
branch. It ensures that the project stays up-to-date.
The workflow performs the following tasks:
- Updates all β¬οΈ npm dependencies.
- Runs a vulnerability scan using the Debricked CLI.π¨
- Automatically commits and pushes πchanges to the repository if dependencies are updated.