Cat Call is a responsive web app that helps users search for adoptable cats by their location. It provides important information regarding each cat and the contact information for the shelter so that you may move forward with the adoption process. All data is provided by the Petfinder API. It was built with Django, React, Redux, and React Bootstrap.
Create a python3 virtual environment, and sign up for a petfinder api key and secret here . Then clone the project and follow the steps below to get set up locally.
Install python packages
$ pip install -r requirements.txt
Install frontend dependencies
$ npm install
Create environment variables for your
Initial frontend build
$ npm run build
From the backend directory start the backend dev server at localhost:8000
$ ./manage.py runserver
From the root directory run
$ npm run start
- User can enter a zipcode to find adoptable cats near that zipcode
- User will see a list of adoptable cats in an infinite scroll grid of cat cards
- User can click on a cat card and be taken to the detail page
- User can see cat detail data including the shelters contact information, and tags which describe health & behavior, if the cat prefers a home with or without other cats, dogs, or children, and general characteristics.
- React for UI components
- Redux using react-redux for frontend state management
- react-router for frontend routes
- React-Bootstrap and native CSS for styling
frontend-architecture.mdfor details of routes, containers, components, and redux architecture
- Django project served by gunicorn
- Minimal template for serving initial page load
- Calls to api are proxied to petfinder api using
django-proxyswapping out the domain.
- Petfinder response goes straight back to browser and frontend handles data manipulation
- Deployed on Heroku on heroku-16 stack using python and node buildbacks
Problems Encountered & Solutions
V1 of Petfinder API
- V1 of the Petfinder API had an option to return JSON, however, it was primarily built to work with XML. The data returned in JSON responses had numerous nested meaningless
$tas keys. I wrote a function to clean the data of these to return a response that would be easier to work with.
- V1 of the Petfinder API did not have standard error codes. I wrote some custom error handling to make sure that errors would actually be displayed in an error component in the frontend instead of being swallowed and having the application break without any notification to the user.
V2 of Petfinder API rewrite
- I refactored my code to work with V2 of the Petfinder API. This version solved the problems above so I got to delete code and remove complexity from my app. I added code to handle authenticating to the API with an access token. I also had to refactor my components to work with some changes in the data shape and availability returned by the new API calls.