A simple web application designed to help small businesses manage their physical product inventory. This application aims to replace manual tracking processes, reduce stock discrepancies, and provide a clear overview of inventory levels.
- Comprehensive Product Management:
- CRUD operations (Create, Read, Update, Delete) for products.
- Track SKU, barcode, name, category, supplier, item number, description, cost/sell prices, reorder levels, and current quantity.
- Real-time Stock Levels: (Future implementation will make this more dynamic) Current stock quantities are stored and can be updated.
- Basic Page Navigation:
- Home page (
index.php) - Products page (
products.php) to view and manage products. - Add New Product page (
add_product.php) for easy data entry. - Reusable side navigation bar for consistent user experience.
- Home page (
- Database: Uses SQLite for lightweight and file-based data storage.
.xlsxImport/Export: (Planned) Functionality to import existing product lists and export inventory data.- Barcode Scanning: (Planned) Integration for barcode scanning to quickly find or add products.
- Backend: PHP
- Database: SQLite
- Frontend:
- Tailwind CSS (Utility-first CSS framework)
- DaisyUI (Component library for Tailwind CSS)
- PHP: Ensure PHP is installed on your system (version 7.4 or higher recommended).
pdo_sqliteExtension: The PHP Data Objects (PDO) SQLite extension must be enabled.- You can typically enable this in your
php.inifile by uncommenting or addingextension=pdo_sqlite. - Verify by running
php -m | grep sqlitein your terminal; you should seepdo_sqlite.
- You can typically enable this in your
- Navigate to the project's root directory in your terminal.
- Run the database setup script:
This will create a
php setup_database.php
database.sqlitefile in the root directory and set up the necessaryproductstable. You should see success messages. - (Optional) You can verify the table structure by running:
php verify_database.php
You need a web server to serve the PHP files.
-
Using PHP's Built-in Web Server (for development/testing):
- Open your terminal in the project's root directory.
- Run the command:
(You can replace
php -S localhost:8000
8000with another port if it's in use). - Open your web browser and go to
http://localhost:8000.
-
Using a Local Web Server Stack (e.g., XAMPP, MAMP, WAMP):
- Place the entire project folder into your web server's document root (e.g.,
htdocsfor XAMPP,wwwfor WAMP). - Start your Apache server (or equivalent) through the XAMPP/MAMP/WAMP control panel.
- Open your web browser and navigate to the project directory (e.g.,
http://localhost/your_project_folder_name/).
- Place the entire project folder into your web server's document root (e.g.,
This project uses Tailwind CSS for styling, with the DaisyUI component library. To compile the CSS, you need Node.js and npm (or yarn).
-
Install Node.js and npm/yarn:
- If you don't have them, download and install Node.js (which includes npm) from nodejs.org. Yarn can be installed via npm if preferred (
npm install --global yarn).
- If you don't have them, download and install Node.js (which includes npm) from nodejs.org. Yarn can be installed via npm if preferred (
-
Install Project Dependencies:
- Open your terminal in the project's root directory (where
package.jsonis located). - Run the command:
(or
npm install
yarn installif you are using Yarn). This will download all the necessary development dependencies defined inpackage.jsoninto anode_modulesfolder.
- Open your terminal in the project's root directory (where
-
Build CSS:
- For development (watch for changes):
This command will continuously watch your source CSS (
npm run watch
src/css/input.css) and PHP files for changes to Tailwind classes and automatically rebuild the output file (public/css/output.css). Keep this running in a separate terminal window while you are developing the frontend. - For production (one-time build):
This command will generate a minified (if configured, though current script is basic) version of
npm run build
public/css/output.css. Run this before deploying your application.
- For development (watch for changes):
The PHP pages (index.php, products.php, etc.) are already configured to link to /public/css/output.css. Ensure this file is generated by running one of the build commands above for styles to apply correctly.
Once the application is running:
- The Home page (
index.php) provides a general welcome. - Navigate to the Products page (
products.php) using the sidebar to view a list of all products (once data is added). - Click on Add New Product in the sidebar to go to the
add_product.phppage, where you can input details for new inventory items.
This README was generated and last updated by Jules, your AI Software Engineer.