Workflow breakdown
Three pages define the main behavior of the project.
The backend is intentionally small. Each workflow below maps to a real file in the repository and a clear responsibility in the stack.
The entry form lives in the local PHP demo and captures the fields required to create a customer record.
- Collects customer ID, first name, last name, gender, email, phone, and address.
- Uses a straightforward form layout so the request body is easy to inspect and test.
- Acts as the starting point for the create workflow in the local backend.
POST /customers
customer_id=C-104
first_name=Leah
last_name=Morris
gender=Female
email=leah@example.com
The create handler normalizes incoming input, checks required fields, validates email format, and rejects very short phone values before inserting.
- Uses a dedicated database helper for connection setup.
- Writes through prepared statements with bound parameters.
- Returns a success or error state in the local UI.
INSERT INTO customers
(customer_id, first_name, last_name, gender, email, phone, address)
VALUES (?, ?, ?, ?, ?, ?, ?)
The listing page reads saved records from MySQL and renders them in a tabular view for quick review.
- Selects customer fields plus the creation timestamp.
- Orders records by most recent creation time first.
- Completes the round trip from form input to stored record output.
SELECT customer_id, first_name, last_name, gender, email, phone, address, created_at
FROM customers
ORDER BY created_at DESC