Skip to content

AnotherDolphin/CarBooking_CustomerApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Car Booking System: Customer Api

Flask Customer data CRUD app for Car Booking system

ERD for the Car Booking DB Design

including relationships, constraints, and data types

ERD Full, executable SQL code included in repo root.

Customer API Features

Fully integrated app with Flask backend connected to MySQL database, a simple Jinja powered frontend, and real-time JavaScript HTTP fetch calls for PUT and DELETE requests. Fetch api was used because HTML doeesn't support PUT and DELETE methods, and while it was possible to use GET/POST as alternatives, PUT and DELETE for updates and deletions are more architecturally sound and confroming to RESTFUL standards.

Flask API endpoints:

  • /: Main webapp Interface
  • /add: to add new customers, with GET and POST routes for rendering interface and handling data.
  • /get: customer query interface
  • /get/all: list all customers' details on the database
  • /get/<id>: get customer details by id
  • /update: to update existing customer, with a GET route for input UI and a PUT route for hadling js fetch put reqeuests
  • /delete: (GET) render deletion input interface, with real-time confirmation per request
  • /delete/<id>: handles js fetch DELETE requests and performs deletions, rejects browser url GET requests

Front-end features:

  • Simple interface that navigates the app, responds to erros, and fulfills all api needs

Main page: index

Query page: get

Add customr: add

Update customer: update

Delete customer: delete

Confirmation page for POST (add) reqeusts: success

Successful PUT/DELETE operations are confimed dynamically with a notifcation: delete-res

USAGE

The app is fully functional. All that needs to be edited is the .yaml file for DB credentials and the SQL code be executed on a live MySQL server.

About

Flask Customer data CRUD app for Car Booking system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages