Flatiron SWE Projects (2 Part Series)
The Coffee Project is the app that serves as the grand finale to Module 2 of my Flatiron School program: Sinatra.
Sprinkled throughout the app are a few nods to the late, great Frank Sinatra, and its name is derived from one of his songs, "The Coffee Song."
As a barista and coffee lover, I took inspiration for this project from what I know well - day to day life in a coffee shop. The prompt required that the app functions as a Content Management System (CMS), and I decided to build an app that would track inventory for The Cafe Sinatra, a fictional small chain of coffee shops.
The Coffee Project is an MVC (Model-View-Controller) Sinatra application. Sinatra is a Domain-specific language for creating web applications with Ruby. When paired with the Shotgun gem, it's incredibly easy to view your app in browser with real-time changes.
The Cafe Sinatra has multiple cafe locations, and each of those locations (Store model) has its own inventory of supplies (Item model) and employees (User model). Put in terms of Ruby model relationships:
- A Store has_many items and users
- A User belongs_to a Store and has_many Items
- An Item belongs_to a Store and to (many) Users through their Store
CRUD = Create, Read, Update, Delete
Before a user is able to complete the signup process, the form is checked for completeness and the username they entered is checked against the database to ensure that it hasn't already been taken by way of the validates_uniqueness_of macro.
Each store has two types of users - employees and admins. The full inventory of an individual store is available for all of its users to view (read) and update when they are logged in, but only admins are able to create and delete items.
Building this app was quite a learning experience, and after all of the debugging, researching, route building, and testing, I'm proud to say Sinatra KNOWS this ditty!
Check out the repo here:
The Coffee Project is an inventory management system for The Cafe Sinatra, a fictional small chain of coffee shops.
Fork and clone this repository to your local machine.
$ bundle install
To get started: 1. Run 'rake db:migrate' 2. Run 'shotgun' to open the app in browser With The Coffee Project, you can: 1. View/edit your store's inventory 2. See a list of your store's current employees
Bug reports and pull requests are welcome on GitHub at https://github.com/TheCodingBarista/the-coffee-project. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.