For our third portfolio project, we had to create a Rails application from scratch. Using my experience working in a restaurant years back, I decided to create a Point of Sale system that would streamline some of the communication issues we had between front and back of house.
When starting out, I played with the idea of having Users being able to both create their own restaurants, or be added as an employee of another restaurant owned by another User. An entirely web-based POS system that where users could just sign up and get started sounded pretty neat.
I ultimately decided to remove that level of complexity and decided to build the app as something targeted for one restaurant to use for their premise, for the sake of this project.
I broke down the flow of my app as this:
Managers are super users with permissions to CRUD other models and entities in the database. Employees could manipulate certain models based on their employee type (hosts can seat tables, but cannot complete their orders)
Users would have orders and tables assigned to them throughout the dinner service
These were integral to the success of my project, as everything was dependent on their relationships to one another — (users needed to know tables they owned, tables needed to know their orders and orders needed to know what menuitems were added to them)
The validate method came in handy with differentiating manager-level users from everyone else.
My views were arguably where I struggled most as far as taking advantage of the methods Rails granted me. For instance: I had a lot of conditional logic in my views for figuring out what to display to a User (managers would see different options than regular users). This meant I’m running queries in the database in my views. As an improvement, I think I would spend some more time refactoring and encapsulating these into model-level methods.
Controllers & Routes
One of things I need to go back and clean up for sure would be to use nested resources better. For example, when I navigate to a edit the order for a table, I would expect it to go to /table/:id/order. Currently, they only redirect to /order/:id/edit. This is a project requirement and I will need to fix this for sure.
As with all projects, this one definitely had its fair share of scope creep. On the surface, it felt like it would be a very light and simple app to create. But once I got deeper, things got unwieldly and it started to feel like I bit off more than I could chew. Every turn had its own bugs and struggles, but I’m proud of what I managed to create. With a bit more polish I think I can write this one off as a success.