DEV Community

Cover image for Inventory Tracking App using Ruby and Active Record

Posted on

Inventory Tracking App using Ruby and Active Record

For my second project for Flatiron school, I created a MVC app using Ruby and Sinatra. The app keeps track of the inventory for a shoe store. I have a friend who owns a sneaker store so I know how important it is to track the inventory.


I designed the database schema as follow: Sneakers belongs to brands, brands belongs to the user who created it, users have many brands, brands have many sneakers and users have many sneakers through brands.


  • Create and save to the database

Users can create an account and login. Logged in users can create a brand of a sneaker for example Nike. They can also store additional details such as style, size, gender, price, quantity and barcode data.

  • Edit user info

The users can edit their business name, username, email, and change their password.

  • Edit brands

Users can edit/rename brands.

  • Edit sneaker

Users can edit their sneakers, can add to the quantity, and can subtract from sneaker quantity.

  • Delete Users and brands

Users can delete their own account. Deleting an account also deletes all the brands and sneakers that are saved for the account. Users can delete individual and multiple brands, when a brand is deleted, the sneakers in the brand are deleted too, and users can delete individual and multiple sneakers.

  • Search

Users can search for a sneaker with the style name and the bar code number.

What did I Learn?

Now I understand the saying "more code more bugs." The more I refactored, the more bugs I found. In the end I was able to fix all issues. Also I learned more about SQl and about using Active Record to manipulate the database. I would like to learn more because I like it. I see what I can build with the little that I know and I can't imagine the things I will be able to build with more experience. After working on this app I think I will enjoy working as a backend developer.
You can check out the code on github.

Top comments (0)