Handicrafts portal built with PHP 7.3.29, MySQL and Bootstrap 5.1.
- Read and print all handicrafts
- Login into an user account
- Create a new user account
- Read user's handicrafts
- Create one handicraft
- Update one user's handicraft
- Delete one user's handicraft
- Logout
MVC architectural design pattern.
MySQL database.
SQL statements to create the database and table along with CRUD queries are provided.
- Install XAMPP.
- Execute XAMPP control panel and Start both Apache and MySQL.
- Go to phpMyAdmin on localhost and prepare the DDBB and its tables with ddbb.sql file.
- Clone the repository in htdocs folder inside XAMPP installation folder.
- Open http://localhost/handicraft-portal/ with a web browser.
- Use htmlspecialcharacters() function for data coming from the DB.
- Use msqli_fetch_assoc function instead of fetch rows as arrays.
- Sanitize the names of uploaded files.
- Handle errors and validate $_POST data in server side because browsers can deactivate JS and, in turn, client-side validation.
- Reduce the length of functions references of controllers, e.g., createHandicraft for create.
- Validate weight_grams in client side so that float numbers are accepted.
- Validate file extensions of files uploaded by users in server and client sides.
- A button to delete the image of a handicraft.
- Filters.
- Order by functionality.
- Implement pagination by counting the number of results, using OFFSET and LIMIT in SQL queries, and $_GET from URLs to organize them.
- Refactor models to use the PDO (PHP Data Objects) interface instead of mysqli to invert dependencies so that the app becomes more easily maintained in case DB changes.
- Add categories for handicrafts by using a table for categories and another one where rows contain the id of the handicraft and the id of a category. Views must render check boxes.
- Make a detail view for handicrafts where users get from the home page by clicking a button that is in each handicraft card. When clicking it, the application redirects to an URL like handicrafts/id. This goes to the controller that uses the id parameter to retrieve the handicraft from the DB and renders its data on the corresponding view.
- Create a config file for environments (development/production) to hide confidential data, such as admin info to login in the DB system, and exclude it from belonging to the repository by using a .gitignore file.
- UX/UI.
- Send email to the user when a handicraft has been created.
- Request email verification for user to finish the signup.
- Create an user admin page for updating user info.
- Change the format of the date_created property/field in PHP and DB to get hour, minute and secondDate data.