The Making of Companion Cats

Brent Muha
6 min readMar 25, 2020

--

Introduction

All students at Holberton School are tasked with completing a capstone project at the end of the foundations year. This project is very open-ended, and so there are a wide variety of student projects. Some examples include web apps, games, and 3D mazes. For my project, I created Companion Cats, a platform to borrow cats built in Python utilizing various APIs.

The purpose of the project is to demonstrate my ability to create a full stack web app after completing nine months of projects at Holberton. I worked on Companion Cats by myself because I wanted to challenge myself to create a responsive website on my own. I completed both the front end and the back end. We were given two weeks to come up with an idea and conduct research, two weeks to implement the project, and one week to create a landing page and presentation. Here is my timeline:

Timeline

The project was created for anyone who would like to borrow a cat. A potential user might be someone who lives in an apartment that does not allow pets, or someone who is not ready to make the commitment to be a pet owner. I’ll go into more detail in the Inspiration section of this article. My personal focus was on creating a full stack web app myself, focusing on the back end. One of my primary goals was populating my database with a wide variety of cats to make an engaging demo.

Inspiration

Poppy and Joan

I drew inspiration from a wide range of sources. The first is Poppy, the Holberton CPO (Chief Puppy Officer). Poppy wanders around the school, getting lots of attention from the students. Whenever I see Poppy, I take a break from my project to pet her for a few minutes. She has been very comforting and acts as our “therapy” dog.

The next source of inspiration is Wag, which bills itself as Uber for dog walking. I’ve been walking dogs on Wag for the past three years, and it’s a great way to spend some time with a variety of dogs without committing to pet ownership. I wanted to create a similar app that’s focused on cats. One day I was having a conversation with a classmate, Aalaa, and she told me about her idea for an app that lets you borrow cats. This eventually became Companion Cats.

Gary

Finally, I was inspired by my experiences with my own cat, Gary. Gary is an orange boy who loves sitting in my lap and getting his belly rubbed. When I work on my projects at home, he’s often there with me, constantly purring. I know a lot of people would love to have a pet that sits in their lap, but it’s not always viable to own one yourself.

Architecture

Architecture

The architecture is fairly straightforward. Clients access the website, which is made up of Django templates. These templates use data from the views, which interact with Python models. These models get their data from my PostgreSQL database.

Technology

Technology

The bulk of the site is built in Python, using Django. The front end is written in HTML, CSS, and JavaScript. I used Bootstrap because I wanted a responsive site that looks simple and clean. Jinja is used in the Django templates to display the dynamically generated data. I used PostgreSQL for my database, populated with Cat objects. I used the Cat API to get cat breeds and photos, and I assigned each cat GPS coordinates from Fast Food Maps. Directions from the user to the cat are generated using the Google Maps API. Finally, the site is deployed on Heroku, using Gunicorn.

Features

Find a Cat

Find a Cat: Find just the cat you’re looking for! Cats can be filtered by age and breed.

All Cats

All Cats: Browse our entire collection of cats available. 1300+ cats located all over the San Francisco Bay Area!

Borrow a Cat

Borrow a Cat: Once you’ve found the perfect cat for you, get directions and go pick it up!

Technical Challenge

I faced many interesting technical challenges while completing this project. The most interesting one was populating my database. When I first thought of the idea for the project, I thought I might just make 5–10 sample cats as a proof of concept. However, I quickly realized that the app would be more engaging with a larger data set. I spent some time during my research phase figuring out where to get the data, and more time during the implementation phase actually putting that data in my database.

One of my first discoveries was the Cat API. This is a free collection of thousands of cats, each with lots of data. I wanted access to the large collection of cat photos, as well as the breed of the cat in each photo. I wrote an add method that randomly assigns each cat a breed and photo from the Cat API.

The first 30 lines of Fast Food Maps

The next question was where to get GPS coordinates. I needed each cat to be associated with a location. I found Fast Food Maps, a project aimed at mapping the locations of the roughly 50,000 fast food restaurants in the United States as of 2007. While the data may be old, it’s perfectly suited for my project. The entire dataset can be downloaded as a CSV file. I used my first trimester Bash skills to filter out locations outside of California. Then I went through and manually removed the coordinates that are outside the San Francisco Bay Area.

The Bash command that generates all the fast food restaurants located in California

Finally, I needed to generate a name and age for each cat in my database. Age was easy enough: I simply generated a random integer between 0 and 20 for each cat. For the names, I decided to have a little more fun. Because I was presenting this project to Holberton students, I thought it would be engaging if people could see their own names. I copied the names of all the Holberton San Francisco students and staff from Slack, and randomly assigned each cat a name from this list. Because there are only about 250 names and 1300 cats in my database, each name is used for several different cats.

Technical Interests

I learned a lot while working on this project. First and foremost, I learned that I can take an idea and turn it into a fully functional project, from beginning to end. I chose to focus on the back end, as I have really enjoyed working with databases and APIs. However, I found that I also really enjoyed designing the site. I wanted it to be simple and clean, and I wanted to make sure it looks nice on mobile devices as well. I also wanted to choose a logo and color scheme that feels warm and inviting. I believe I succeeded in accomplishing these things. Because I really enjoyed each aspect of the project, I’m confident that I would thrive working in full stack web development.

About

My name is Brent Muha and I created Companion Cats. I’m a former elementary school teacher transitioning into software engineering. I love problem solving and collaborating with others. This site is my capstone project at Holberton School, and I am pursuing opportunities as a full stack web developer with a focus on back end.

Companion Cats: https://companion-cats.herokuapp.com/

Github: https://github.com/bmuha1/companion_cats

LinkedIn: https://www.linkedin.com/in/brentmuha/

Twitter: https://twitter.com/brentmuha

--

--

Brent Muha

Software Engineering Student/TA at Holberton School