This app answers the question, "What's for lunch today?" by providing a list of San Francisco food trucks along with their known street locations and the types of foods they serve. The goal is to showcase a variety of options and help users discover new places to eat.
You can pull down the repo and run it locally:
$ git clone git@github.com:marka2g/belly_bot.git $ cd belly_bot # Run the server with a REPL $ iex -S mix phx.server
And then, seed some Food Truck data:
iex> BellyBot.GlobalSetup.seed_food_trucks() # check the food truck count iex> BellyBot.FoodTrucks.list_food_trucks() |> Enum.count()
Currently, there are two ways to deploy this app to production:
- Continuous Delivery → Once a PR is merged into the
main
branch and CI checks run successfully, the compositeactions/deploy/action.yaml
will deploy the app to a docker swarm on AWS. - Manually → The
./scripts/deploy.sh
script can also be run with a key file(available upon request).
- the script requires three environment variables to be passed in:
PRIVATE_KEY_PATH
located in the./environments/production
directorySOPS_AGE_KEY_FILE
key fileGITHUB_USER
example:
$ PRIVATE_KEY_PATH=./environments/production/dynamic_private_key.pem \ SOPS_AGE_KEY_FILE=./environments/production/key.txt \ GITHUB_USER=marka2g \ ./scripts/deploy.sh
Start by checking the repo's Milestones Panel, which serves as the perfect starting point. Here, you'll discover various issues that track the project's progress.
In my overall allocation of time, the belly_bot
Phoenix app received the least attention, and there are a few reasons for this. Firstly, I find the process of building an app with Elixir, Phoenix Live View and app development in general to be the most enjoyable. However, I've learned over the years that planning ahead and addressing less enjoyable tasks are crucial for the project's longevity and momentum. Taking the time to chart a clear path forward makes development more focused, and prioritizing issues via milestones enables the team to work and communicate more efficiently.
That said, I've grown fond of Terraform, particularly for greenfield projects. Besides its ability to magically assist with provisioning platform resources, I deeply appreciate the project management tools it provides. Terraform has given me the freedom and confidence to pause, think, and plan before diving into coding, ultimately enhancing the product's quality. Furthermore, it has bolstered my ability to estimate time and prioritize tasks more effectively.
As to the time I spent, the type of development proposed in this assessment, mirrors patterns and development work I've been currently engaged in. Last week was quite busy for me so I had to work when time permitted. Having a healthy set of bootstrapped issues really helped. This project was quite enjoyable; turns out, I too like too eat :-). I plan to keep developing on the idea for fun and add more features, such as:
- Geographical searching with the PostGIS Postgres extension
- Improve search by parsing
days_hours
and food_items data - Instrumentation with Prometheus and a Grafana dashboard
- and well, basically develop the UI, and design.
Thank you so much for the awesome idea and the opportunity!
→ Github Milestones & Issues, provisioned with Terraform
located in this directory
./modules/cloud/aws/compute/swarm
→ web: Elixir/Phoenix Live View
→ db: Postgres 16
→ Single-node Docker Swarm manages an AWS/EC2 Instance/Security Group/VPC/Subnet, provisioned with Terraform.
located in this directory
./modules/integrations/github
→ Packer with an Amazon Machine(Linux) Instance with Docker preinstalled, provisioned with Terraform.
located in this directory
./packer
→ Encrypted Secrets with SOPS, provisioned with Terraform
located in this directory
./modules/integrations/github/secrets
Currently, an EC2 instance is running on AWS, and at the time of writing, it is live at this address: http://ec2-54-193-68-139.us-west-1.compute.amazonaws.com:4000. I submitted an issue here to investigate why the Docker Swarm EC2 instance and volume are not communicating.