CFPT-Montres
A luxury watch e-shop built with PHP and Slim Framework 4, with a filterable catalogue, a cart, a simulated checkout and a role-based back office.
About the project
CFPT-Montres is an online luxury watch shop developed during my training at CFPT Informatique. It is built with PHP and Slim Framework 4 following an MVC structure with a service layer, PHP-DI for dependency injection and MySQL/MariaDB through PDO with prepared statements.
Visitors can search the catalogue and combine filters by brand, price range, gender, movement, case material and water resistance, then sort and page through the results. Each watch has a detail page with its specifications and similar models. Registered users manage their profile and password, fill a cart and complete a simulated checkout — no real payment is processed — which turns the cart into an order stored in their purchase history.
A role-based back office lets staff members add watches, brands and models without touching the code or the database, while only administrators can edit existing watches. The interface uses Bootstrap 5 with a custom stylesheet and vanilla JavaScript, and the edit workflow is covered by Pest feature tests running on a separate test database.
What it does
- Watch catalogue with search across watch, brand and model names
- Combinable filters: brand, price range, gender, movement, case material, water resistance
- Safe sorting (whitelist) and pagination that keeps active filters
- Watch detail pages with specifications and similar models
- Registration, login, profile and password management with hashed passwords
- Cart and simulated checkout (no real payment) in a single database transaction
- Purchase history grouped by order with totals
- Staff back office to add watches, brands and models
- Admin-only watch editing protected by role middleware
- Server-side image validation (real MIME type, extension, size)
- Request access log viewable in the staff area
- Pest feature tests on an isolated test database
Problems to solve
- Combining several category filters correctly: each group (gender, movement, material, water resistance) is checked with its own EXISTS sub-query, so a watch must match every selected group, and sorting only accepts whitelisted values to keep the ORDER BY safe.
- Making the simulated checkout consistent: the order, its items and the emptied cart are written in a single database transaction that is rolled back if any step fails.
- Separating permissions between members, staff and administrators with dedicated middleware, with roles read from the database rather than from user input, and returning 403 when an account lacks the required role.
- Validating image uploads on the server by checking the real file type with finfo, the extension, the size and the file name before storing the image.
Internship, apprenticeship or junior role? Let's talk.
I'm looking for an internship, an apprenticeship or a junior developer position, and I'm also open to selected freelance projects. Feel free to get in touch.