Truck Checks is a web application designed to manage and monitor the inventory of truck lockers. It provides tools for administrators to maintain records, generate reports, and ensure compliance with inventory checks.
- Locker Item Management: Maintain and update the items stored in each truck locker.
- Inventory Checks: Perform and record checks of locker items to ensure inventory accuracy.
- User Management: Secure login and logout functionalities for administrators.
- Reports: Generate and email reports on inventory checks.
- Demo Mode: A special mode that allows users to explore the system without affecting real data.
- QR Code Generation: Generate QR codes for easy identification of lockers.
- Database Management: Includes tools for maintaining database backups and cleaning tables.
- Interactive Quiz: Users can participate in a quiz where they guess the location of an item. The quiz tracks the number of attempts and calculates a total score based on the number of correct guesses.
- PHP 7.x or higher
- MySQL or MariaDB
- Docker (optional, for containerized deployment)
-
Clone the repository:
git clone https://github.com/jtbnz/TruckChecks.git cd TruckChecks
-
Set up the database:
- Import the provided SQL file to set up your database schema.
- Update
config.php
with your database connection details.
-
Install dependencies: If you're using Docker, you can skip this step since dependencies will be handled by Docker. The main one you will need is qr-code to generate the qrcode image
composer2 require endroid/qr-code composer2 require tecnickcom/tcpdf
-
Configure local files:
-
db.php: update with your username,password,database name - This also has the demo toggle field
-
config.php: Configure Database Credentials Copy the config_sample.php file to config.php.
cp config_sample.php config.php
Open config.php and set your database credentials, admin password, and demo mode (unlikely!)
if (!defined('DB_HOST')) define('DB_HOST' , 'localhost'); if (!defined('DB_NAME')) define('DB_NAME' , 'your_database_name'); if (!defined('DB_USER')) define('DB_USER' , 'your_username'); if (!defined('DB_PASS')) define('DB_PASS' , 'your_password'); if (!defined('PASSWORD')) define('PASSWORD' , 'YourSecurePassword'); //Used for access to the Admin pages if (!defined('TZ_OFFSET')) define('TZ_OFFSET','+12:00'); //If you need to change timezones if (!defined('IS_DEMO')) define('IS_DEMO' , false); if (!defined('REFRESH')) define('REFRESH' , 30000); // 30000 = 30 seconds this is how often the main page will auto refresh if (!defined('RANDORDER')) define('RANDORDER', true); // Randomize the order of the locker items on the check page if (!defined('DEBUG')) define('DEBUG' , false); // Set to true to enable debugging define('IS_DEMO' , false);
- Run the application:
- Point your web server to the
index.php
file or use Docker to run the application.
- Point your web server to the
-
Login:
- Navigate to
login.php
to access the administrator panel.
- Navigate to
-
Perform Checks:
- Use the
check_locker_items.php
to perform and log inventory checks.
- Use the
-
Generate Reports:
- Access
reports.php
to generate and email inventory reports.
- Access
-
Manage Data:
- Use various maintenance scripts (
maintain_lockers.php
,maintain_trucks.php
, etc.) to manage lockers, trucks, and items.
- Use various maintenance scripts (
This project supports Docker for easy deployment.
-
Build the Docker image:
docker-compose build
-
Run the container:
docker-compose up -d
-
Access the application:
- The application will be accessible at
http://localhost:8000
by default.
- The application will be accessible at
- index.php: The main entry point of the application.
- login.php/logout.php: Handles user authentication.
- admin.php: Admin panel for managing the application.
- db.php: Database connection settings.
- check_locker_items.php: Interface for performing locker checks.
- reports.php: Generate and email reports.
- qr-codes.php: Generate QR codes for lockers.
- Docker/: Contains Docker-related files for containerizing the application.
- styles/: CSS files for styling the application.
- templates/: HTML templates used throughout the application.
- scripts/: Local scripts used to email the checks automatically with timezone handling
- Config Sample File: Copy and configure the
config.php
file fromconfig_sample.php
. - quiz/: Quiz to locate the correct locker for an item
waiting on next ideas!
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -m 'Add feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.