Using a Raspberry Pi for your own Inventory Management System

Using a Raspberry Pi for your own inventory management system.

An open-source, inventory management system written in PHP with a MySQL database has no problem operating on a Raspberry Pi.  Initially, you’ll only have local network access, but if you want to allow remote web access, you can.

In order to setup a web interface to access, view, and manage the content of your inventory management system you’ll need to set up a LAMP (Linux, Apache, MySQL, PHP) stack on your Raspberry Pi and configure it to work as a web server and set up a basic website which you can access on any device on the same network as your Pi.  This is a link to a nice tutorial for setting-up a L.A.M.P. server on your Pi, the WordPress portion is optional, you can stop after installing PHP. 

If you plan on having access to your Raspberry Pi through the Internet, you’ll need to configure your router and DDNS settings, or use a service such as dataplicity.io to wormhole to your pi through the web.

Next step is to use an open-source project found on GitHub to start your basic inventory management system.  https://github.com/siamon123/warehouse-inventory-system

“OSWA-Inv is a web based Inventory System, that will allow you to keep tracking of the quantity buying and selling price of the products existing in your warehouse or business. When creating a new products, you can set a quantity, buying and selling price.”

Included Features:

  • User Management:  Groups, Basic Profile, and Change Password
  • Categories:  For organizing products
  • Products:  Basic product information, title, quantity, pricing.
  • Sales:  Sales transactions are individual by product.
  • Reports:  Daily, Monthly, and Ranged Dates Sales/Profit Report

InventoryProducts

Install the Basic Inventory Management System Web Application

After updating the Raspberry Pi and setting up the LAMP stack, installation of the inventory application is relatively painless.

Download the source-code package and then you’ll need to extract the contents to the folder.  Either rename the folder to the base name now or after you move it to the web root for Apache Web Server found at /var/www/html/

Use either MySQL command line or the phpmyadmin web interface to import the database schema.  Create a database named oswa_inv and import the schema included in the project directory oswa_inv.sql  If you haven’t done so, installation is as easy as:

sudo apt-get install phpmyadmin

OR

Use MySQL command line create the database and import the initial schema.
sudo mysql -uroot

mysql> CREATE DATABASE oswa_inv;
mysql> USE oswa_inv;
mysql> source /var/www/html/warehouse-inventory-system/oswa_inv.sql

The directory containing the project, especially, the uploads directory, must have write permissions on the system and let the web application be run using the www-data account by executing the following commands from the project directory:

sudo chmod -R 775 uploads/
sudo chown -R www-data:www-data *

Edit the header.php file to suit the needs of your organization. e.g. change to logo
[project folder on server]/layouts/header.php
Same folder also contains the various menus used by the system.

Edit the CSS to reflect the needs of your organization. e.g. change background colors
[project folder on server]/libs/css/main.css

 

InventoryAdmin

Using the Inventory Management System

  • Secure the default accounts with a change password.
  • Create a user account for each person using the system, including yourself.
    Optionally upload a photo for the user.
  • Add Categories – you’ll need to add at least one category before you can add products.
  • Add Media before you Add Product if you want to associate a photo when you Add Product.  Otherwise, you can elect to have no image and updated later.
  • Add Order – before you try to Add Sales.

Improvements

These are the improvements I’ve added for my own system

  • Delete confirmation popup before delete actions
  • Description column for products
  • Location column for products
  • View products by category
  • Add sales from list of products – remove selected from list.
  • Add/Edit/Delete Sales also updates product’s quantity available
  • Order Management for all sales – All sales must be associated with an order number
  • View Sales by Order calculate total
  • Delete Order:  deletes all sales associated with order AND restores quantity/stock
  • Add/Edit/Delete Order also updates product’s quantity available
  • Stock:  Inventory Management for all products – Log of increase/decrease stock
  • Add/Edit/Delete Inventory also updates product’s quantity available

Improved Version Source-Code

 

Backup and Restore your Inventory Management System

How To Backup and Restore your Inventory Management System

Need a little help?

14 thoughts on “Using a Raspberry Pi for your own Inventory Management System

  1. Hi there,
    thanks to your post I found this little gem of inventory mangement. I see you have done a lot improovements. Are you willing to share your edits? Best Chris

    Like

  2. Good afternoon,
    I am very interested in getting this up and running, however I am stuck at a WordPress landing page after I have completed all the steps. Is there a checklist of where to start in my trouble shooting and audit of my work?

    It seems like I dont have any temlpates, but as I read through your guide it should have been included and defaulted in the files I downloaded.

    Thanks for reading!

    Like

    1. Hi Florian,
      Thank you for taking the time to share the issue you are having, it’s likely other people have had the same experience. The WordPress installation has over written the default settings of the web server installation. If you try the URL to your inventory management system directory, for example: http://localhost/inventory/index.php and you are redirected to WordPress then you will want to check your apache web server settings found in the /etc/apache2/apache.conf
      Let me know how it goes!

      Like

  3. Thank you for taking your time to respond .

    This is my first time but looking at the apache web server settings nothing seems to out of order . When try log in the site with localhost i get wordpress, if i try with ip adress//inventory/index.php i get a not found page .

    If i go on http://localhost/inventory/index.php i get 404

    Thank you !

    Like

  4. Mine is setup like this /var/www/html/warehouse-inventory-system , i kept the files in warehouse-inventory-system where they are .

    Thank you

    Like

  5. If i try to log in i get Database connection failed:Access denied for user ‘admin’@’localhost’ (using password: YES) where do i choose the default log in ? Should i just go and grand all permission to admin user ?
    Thank you

    Like

    1. Check your MySql databases configuration. The access is denied because the default password is set to yes for user admin. Does user admin exist, if so is the password in the conf file inside the inventory management system directory set to that password.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.