A robust Inventory Management System built with Laravel 10 and MySQL, designed to streamline your inventory tracking, sales, and purchasing processes.
The system is structured using a clear and efficient database schema:
- POS (Point of Sale)
- Orders
- Pending Orders
- Complete Orders
- Pending Payments
- Purchases
- All Purchases
- Approval Process
- Purchase Reports
- Products Management
- Customer Records
- Supplier Management
Follow these steps to set up the project locally:
-
Clone the repository:
git clone https://github.com/fajarghifar/inventory-management-system
-
Navigate to the project folder:
cd inventory-management-system
-
Install PHP dependencies:
composer install
-
Copy
.env
configuration:cp .env.example .env
-
Generate application key:
php artisan key:generate
-
Configure the database in the
.env
file with your local credentials. -
Run database migrations and seed sample data:
php artisan migrate:fresh --seed
-
Link storage for media files:
php artisan storage:link
-
Install JavaScript and CSS dependencies:
npm install && npm run dev
-
Start the Laravel development server:
php artisan serve
-
Login using the default admin credentials:
- Email:
admin@admin.com
- Password:
password
- Email:
With Docker, you can easily start both the app and MySQL database without needing to install anything locally.
In the docker-compose.yml file, you’ll find the configuration for MySQL.
Note: The app uses the environment variables from .env.example.docker. If you want to change any configurations in this environment file, create a new .env file, make your changes, and then rebuild the Docker image.
To pull and run the Docker images:
This command will pull the mysql:5.7 and inert/laravel-app images and start the containers:
Note: You don't need to have the repository on your local machine, you just need the docker-compose.yml file and run:
docker-compose up -d
Once the containers are up, the app will be available at http://localhost:8000/.
To build the Docker image after code changes:
If you’ve made changes to the code and want to update the Docker image, use the following command:
Note: This command will reset your database. Make sure to back it up.
docker build -t inert/laravel-app .
To tag the Docker image:
docker tag inert/laravel-app inert/laravel-app:"tagname"
To push the Docker image:
docker push inert/laravel-app:"tagname"
"In case you delete the MySQL Docker container by mistake"
To export the database from the Docker container and save it to your desktop:
Note: Change the path to your own.
powershell
docker exec mysql-db mysqldump -u root -p'examplepassword' inventory_management_system > "C:\Users\User\Desktop\backup.sql"
To import the database from the desktop back into the Docker container:
powershell
Get-Content "C:\Users\User\Desktop\backup.sql" | docker exec -i mysql-db mysql -u root -p'examplepassword' inventory_management_system
⚡ To clean the database, remove example data, and create a new admin with a fresh database, run:
docker exec -it laravel-app bash
php artisan migrate:fresh
php artisan tinker
use App\Models\User;
User::create([
'name' => 'Super Admin', // edit this
'username' => 'name',
'email' => 'email@email.al', // edit this
'password' => bcrypt('password'), // edit this
'role' => 'admin',
]);
- To customize tax rates, number formatting, and more, open
./config/cart.php
. - For more details, check out the hardevine/shoppingcart package.
Have ideas to improve the system? Feel free to:
- Submit a Pull Request (PR)
- Create an Issue for feature requests or bugs
Licensed under the MIT License.