Fábio Miranda is a Commit Engineer who specializes in developing Web Applications and sees beauty in designing systems and making sophisticated requirements and technologies evolve into simple solutions and unique user experiences. He enjoys spending time with family playing video games, watching movies, and traveling.
When I joined Commit on October 20, I was already trying to learn the open-source tool called Zero, which makes it quick and easy for startup technical founders and developers to build everything they need to launch and grow high-quality SaaS applications. It seemed to be perfect to guide me to learn how to build a development workspace and my own deployment infrastructure. There were a lot of things to learn, so I chose a seemingly simple Expense CRUD app. The requirements were:
- Add some “Accounts” records to group expenses.
- Add expenses/due days (e.g., Condominium rent must be paid until the fifth day of the month).
- Add payment records to save the date and the amount of a given expense.
My whiteboard was my main tool during the process of designing this app. Below are the initial UI idea and the first model diagram of the application:
I also added a technical requirement: I wanted to implement it using Hotwire, a new toolset that will be part of the next version of the Rails framework.
I decided to start by experimenting with this Zero-based App Playground. After clicking “generate app”, my Hackathon Onboarding Project was created with (1) a bare minimal Python example app and a Dockerfile; (2) some Github Actions; and (3) some Kubernetes manifests:
By inspecting the Dockerfile, it became clear that it was the first thing I needed to learn to be able to run the application. I installed the Docker Desktop then followed the instructions to run the Getting Started guide, which has very good documentation for Docker beginners, like me:
Docker: Summary of the learned lessons
The Docker Get Started guide helped me learn how to build the Docker image and run the application using some simple commands, so, at this point, “all I need to do” was learn how to set up a Ruby image and run the Rails application. Indeed I learned so many things that I started writing a step-by-step series to document the numerous details:
- The best way of working with Docker, without needing to rebuild the app image due to source code changes.
- Creating separate containers, one for the app, another for the Postgres database, another for the Redis database, and so on.
- How containers communicate with one another in their containerized network.
- Creating named volumes to persist the relevant files and prevent losing data when the container is shut down (e.g., database records and downloaded gems).
- How to simplify the Docker commands and group the containers services using Docker Compose.
- How to run commands using Docker and Docker Compose using only the containers environment, without having to install all the infrastructure directly on my host.
- How to debug applications using Docker.
Hotwire Expenses Application
After five days of intense research and tests, I felt I had accomplished my personal goal on my HOP demo: I learned Docker and I enjoyed using it! I spent two more days building the Hotwire-based app that works as demonstrated in this video.
I thought it was awesome! Hotwire makes this kind of behaviour easy to implement, on which a change made by one user automatically updates the UI for another user, or even if the changes are made via some production-side Rails console, the data changes are broadcast to all the users who are observing that data.
I will certainly use Docker on all my next projects, as I did on the HOP demo, as well I had a chance to experiment with Hotwire and learn an elegant approach to design apps that can benefit from this “broadcasting” feature that proportionate live updates to the users. There’s still a steep learning curve to master both Docker and Kubernetes, and the Commit community has been very supportive in providing guidance along the path.
I loved the Commit way of onboarding engineers by creating a healthy and welcoming workspace and encouraging engineers to do what they like the most: bringing project ideas to reality and learning new technologies. Interacting with the Commit community to ask for advice or to share the lessons learned is awesome!