A simple PHP application for managing a product catalog, allowing users to add, view, and delete various types of products (Books, DVDs, Furniture).
This project was created as a test assignment for Scandiweb.
- List existing products.
- Add new products (Book, DVD, Furniture) with type-specific attributes.
- Mass delete selected products.
-
Clone the Repository:
git clone https://github.com/Ag-Tawfik/Simple-Product-Manager.git cd to the project folder -
Install Dependencies: Make sure you have Composer installed.
composer install
-
Database Setup:
- Make sure you have a MySQL server running.
- Create a database (e.g.,
product_crud_db). - Import the database schema using the
Database-Setup.sqlfile:(Replacemysql -u your_mysql_user -p your_database_name < Database-Setup.sqlyour_mysql_userandyour_database_name)
-
Environment Configuration:
- Create a
.envfile in the project root. - Copy the following content into the
.envfile and replace the placeholder values with your actual database credentials:DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=your_database_name DB_USERNAME=your_database_user DB_PASSWORD=your_database_password
- Create a
-
Run the Application:
- Using a Local Server (Apache/Nginx): Configure your server to point the document root to the project's public directory (which is the root directory in this case). Ensure
mod_rewrite(or equivalent) is enabled for URL rewriting if you plan to removeindex.phpfrom URLs later. - Using PHP Built-in Server: For development purposes, you can use the PHP built-in server. Navigate to the project root in your terminal and run:
php -S localhost:8000
- Access the application in your browser (e.g.,
http://localhost:8000).
- Using a Local Server (Apache/Nginx): Configure your server to point the document root to the project's public directory (which is the root directory in this case). Ensure
/Core: Core classes (Database, Router, Validator, etc.)./Http: HTTP related classes (Controllers, Product classes)./Views: PHP files for rendering HTML./vendor: Composer dependencies.index.php: Main entry point.bootstrap.php: Application bootstrapping (DI container, environment loading).routes.php: Defines application routes.Database-Setup.sql: SQL script for database schema.composer.json: PHP dependencies.