Skip to content

An android application to track and manage inventory using Google's Firebase platform.

Notifications You must be signed in to change notification settings

uzairmukadam/Inventory_Management_System

Repository files navigation

Inventory Management System

Inventory Management System makes use of google's firebase platform, namely Authentication for user authentication and Firestore Database to store the inventory details to track and maintain inventory for any business. An android application is built to access and edit the firebase entries. The application can be easily replicated and modified as per any individual's needs.

Index

  1. Firestore Database collections

    a. users

    b. metadata

    c. logs

    d. categories

    e. products

    f. manufacturers/customers

    g. purchases/sales

  2. Android architecture

  3. To-do tasks

  4. Usage

Firestore Database collections

users

This collection contains documents with document id set to the user id created in Firebase Authentication.

user_id { "access_level" : 1, "is_active" : true, "is_login" : false }

  • "access_level" : This attribute allows to control the level of access any user has. Setting the value to 0 gives the user full access to modify other user attributes and product descriptions. Value set to 1 gives user moderate access. The user can enter transactions (sales and purchases) and view them. Value set to 2 restricts user activities further by allowing the user to only enter transactions (sales and purchases) and not view them. Custom rules can easily be implemented.

  • "is_active" : This attribute allows to lock any user access. Simply by setting the value to "false", the user can no longer access the application.

  • "is_login" : This attribute is used to prevent multiple device logins for any user. A user can only login and use one device at a time. Based on business requirements, the attribute can be modified.

metadata

This collection contains platform specific limits to restrict a user from using outdated or any unsupported version of the application. The documents id is prefered to be set as the platform name, eg. android, ios.

android { "current_version" : 1, "supported_verson" : 1 }

  • "current_version" : This attribute specifies the current active/latest application version available for the platform(android).

  • "supported_version" : This attribute specifies the older version that is supported by the business for the platform(android) to avoid incompatible transaction formats.

logs

This collection records all the necessary required logs generated by the application. These logs can help the business to understand failure points, unauthorized accesses and other activities. The document id is auto-generated.

log_id { "critical" : false, "device" : "star2lte", "message" : "successful login by user", "timestamp" : "March 8, 2023 at 1:17:16 PM UTC+5:30", "user" : "zM7HJ75HO8F4YnsjuHrt9nTq222F", "version" : 1 }

  • "critical" : This arrtibute specifies if the following log is critical or not in nature.

  • "device" : This attribute records the name of the device that is generating the log.

  • "message" : This attribute contains the message of the log. These messages can be custom based on the business requirements.

  • "timestamp" : This attribute records the date and time at which the log is generated to keep a track of the actions.

  • "user" : This attribute records the user_id that is generating the log. For any user who hasn't logged in, the logs generated will set the value to null(empty).

  • "version" : This attribute records the application version in use.

categories

This collection contains the different categories to be managed by the business. The documents id is auto-generated and is unique which will be used by other documents.

category_id { "name" : "Dairy" }

  • "name" : This attribute specifies the category name.

products

This collection contains all the products managed by the business. Each product belongs to some defined category. Multiple products can belongs to a single category. However, single products are not designed to belong with multiple categories. The document id is auto-generated and is unique which will be used by other documents.

product_id { "category" : "o2cUJJTHRTpK9px775LSp", "index" : 0, "name" : "Cow Milk 1L", "description" : "A liter or packed cow milk", "purchase_rate" : 45, "sale_rate" : 50, "quantity" : 10 }

  • "category" : This attributes specifies the category that the product belongs in. It is set to the document id of the category document.

  • "index" : This attribute specifies the order of the product within the category. It helps in arranging the products in order whenever read.

  • "name" : This attribute specifies the display name of the product visible on the application.

  • "description" : This attribute contains the description of the product for further details.

  • "purchase_rate" : This attribute specifies the default rate of purchase of the product. There is not support of multiple currencies at the moment.

  • "sale_rate" : This attribute specifies the default rate of sale for the product. There is not support of multiple currencies at the moment.

  • "quantity" : This attribute specifies the quantity of product currently present in the inventory. It allows the user to quickly check the available inventory and restock if needed.

manufacturers / customers

These collections contain all the manufacturers and customers dealing with the business. These individuals collections can hold the data later used for billing related transactions.

individual_id { "categories" : [ "o2cUJJTHRTpK9px775LSp", "4tthewpHRTpK9hr87ru34" ], "name" : "John" }

  • "categories" : This attribute is an array of all the categories supported by the individual.

  • "name" : This attribute contains the name of the individual.

purchases / sales

These collections contain all the individual transaction records, i.e. all the purchases and all the sales. While recording the transactions the product quantity is updated by the application to allow for less document read to check the product quntity.

transaction_id { "category" : "o2cUJJTHRTpK9px775LSp", "id" : "hrru57esoA5YnsjuHrt9nTq222F", "record" : [ { "product_id" : "tMMhsrw546pK9px775LSp", "quantity" : 50, "rate" : 42 } ], "timestamp" : "March 18, 2023 at 3:13:35 PM UTC+5:30", "user" : "zM7HJ75HO8F4YnsjuHrt9nTq222F" }

  • "category" : This attribute specifies the category for which the transaction is taken place for.

  • "id" : This attribute specifies the manufacturer/customer id for which the transaction is taken place for.

  • "record" : This attribute is an array of product details like product_id, quantity and rate of transaction for the transaction.

  • "timestamp" : This attribute contains the timestamp for the transaction.

  • "user" : This attribute containes the user_id of user performing the transaction.

Android Architecture

The android application follows a singleton architecture. There is only one activity created and each other pages are fragments that uses the navigation component to move from one fragment to another. This allows for easy sharing of data between components and consistent behaviour. Further MVVM file structure is implemented to keep the codes separated. This allows for better debugging and quick changes.

To-do Tasks

  1. Implementation of access_level 0 options.
  2. Implementation of a suitable UI.
  3. Optimization of codes.
  4. Documentation improvements.

Usage

In order to implement this project for any business, the following steps need to be followed.

  1. Create a Firebase account.
  2. Create a new Firebase project.
  3. Enable Authentication and Firestore Database.
  4. Enable Authentication methods suitable for the business and add users.
  5. Based on the collections explained earlier, create users, metadata, categories and products collections with sample documents.
  6. Clone the repository.
  7. Add new application to the Firebase project. Select android as the application and follow the steps presented by Firebase.
  8. After setting up the application and project, try running the app.
  9. Do changes as per the business needs.

About

An android application to track and manage inventory using Google's Firebase platform.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages