In this phase, you will create a web API that provides access to your database.
You may not use generative AI to assist you in this part of the assignment.
Write a web API in Python (or another language approved by the instructor) that provides the following endpoints:
/register endpoints to allow a user to retrieve, update, and delete registration
records in the MySQL database you created in Phase 2. The endpoints should behave like the example web API
endpoints we discussed in class. You should have the following endpoints:
GET /register - retrieve registrationsPOST /register - add a registrationPATCH /register/(id) - update a registrationDELETE /register/(id) - remove a registrationDELETE /register - remove all registrationsI suggest that you use the products_api.py example as a starting point.
The GET, POST, and PATCH /register endpoints must use the following JSON format:
{
"id": 1,
"firstName": "George",
"lastName": "Banks",
"address": "101 Anywhere Ln",
"gradeFinished": "K5",
"gender": "M",
"rideBus": true,
"class": "K5-A"
}
Notes:
POST /register - the “class” attribute is optional. All others are required.Wrote a POST /assign endpoint that assigns children to classes.
When the endpoint is invoked, it should:
The endpoint should return the string “OK”.
You may do either or both of the options below. If you do both, you can get +25 points.
Setup a virtual private server using a cloud provider like DigitalOcean. Deploy the database and web API to the server. Configure the server firewall so that both the database and the web API are accessible.
If you do this option, in your report, on the title page, provide the URL I can use with curl to test your deployed API.
Write a web user interface for your database. You may use generative AI to write the front end, or write it by hand. The front end code should be in the same project as your web API. It can either:
When your project runs, a GET / request should return a web page that allows the user to
POST /assign functionality (if you did that)Note that curl commands sent to the /register endpoints should continue to work.
If you do this option, create a screen recording demonstrating your project in action, and include a link to your recording on the title page.
No collaboration with other humans (other than the instructor) is permitted on this assignment. This includes debugging help. You may post questions clarifying assignment requirements on Microsoft Teams.
You may use generative AI as specified above.
Include the following Academic Integrity Statement at the end of your report, specifying any use of generative AI debugging help received.
“By affixing my signature below, I certify that the accompanying work represents my own intellectual effort. Furthermore, I have received no outside help other than what is documented below.”
Signed: ________ (Type your name here)
Help Report:
| Date | Person/AI Helping | Nature of Help | Time Spent |
Use the following command to export your MySQL database to a SQL script:
mysqldump -u root -p -R --set-gtid-purged=OFF --result-file=vbs.sql vbs
Submit the following to canvas: