Heroes API was created to serialize super heroes from across different publications all into one place, using Super API. The data is passed along through two endpoints, /search
and /supers
, and uses pagination to return the super heroes. Valid search parameters can allow you to sort and filter through the super heroes and return based on specific parameters that are highlighted below in Endpoints. This application uses Circle CI for Continuous Integration and is deployed on heroku at https://supers-api.herokuapp.com
, being autodeployed with a passing Circle Build.
- Authors
- Schema Design
- Getting Started
- Running the tests
- Endpoints
- Built With
- Refelctions
- Acknowledgments
- Andrew Johnston - GitHub
Go to Endpoints and use /search
and /supers
endpoints to recieve super hero information/make a search.
Make yourself aware and familiar with the gems that are being used for this project:
- Fork and clone this repo
- Run
bundle install
- Run
rails db:{create,migrate,seed}
rails db:seed RAILS_ENV=test
to seed the test databasebundle exec rspec
to run the test suite
Project consists of tests for Requests, Models, Services and Facades, all with happy path, sad path/edge cases. Coverage currently sits at 100%
These are just examples, to see the full test coverage please look into the spec
folder of the app
Creates a Search in the DB as long as valid parameters are sent as the body of the request, returns super heroes that match from the DB. Defaults to sort by name, defaults to page 1 and 20 per page, but all can be changed.
Valid Parameters:
Note: Supers default to sorting by name ascending, but the sort param causes the Supers to be sorted by descending order
Returns all super heroes, sorted by name. Pagination defaults to page 1 and 20 per page, but can be changed.
- Rails API
- Postgres
- FastJsonApi
- RSpec
- Capybara
- VCR
- SimpleCov
This is version 1 of Heroes API, for any updated versions please check back here. New versions will be linked below:
I very much enjoyed getting to work on this application, it was a lot of fun getting to work with an API of my choice that deals with one of my interests. I felt comfortable and confident with the choices I made, and look forward to getting to explain these choices further.
Project Planning and TDD was a large part of what made my work on this application, in my opinion, successful. The ability to sit and plan out what exactly how I wanted to implement the functionality before jumping into code, allowed me the time to foresee potential issues and best practices to follow. Just like life, things always come up that you can't forsee, but in keeping with TDD I was able to change my code, refactor, and continue working fairly smoothly when problems/issues arised.
This was my first time creating a Search Table and it threw me for a loop at first glance. However, the more I thought about it, the more it made sense in my head. Allowing us to store distinct searches in our database can allow our application to implement all sorts of interesting functionality. A big piece that stood out to me, was how it could allow us to more easily cache our Super Hero results for specific searches and boost performance in our application, among other things. I believe there are probably other ways to implement this search table and functionality, but I went with what felt best with my skill set.
As stated before, I used Heroku to host the application and Circle CI for Continuous Integration. While working on this app by myself I found Circle to be a helpful, extra guard against failing tests and deploying broken code, especially when there is no one to review your code. Heroku is set to autodeploy after Code has been merged into main, and the Circle build passes.
This application is made possible and uses data from Super API.