This is a Rails JSON-API-only application capable of doing the following actions:
- Create Robots. Each robot can have weapons and armors.
- Update a robot's attributes, including (but not limited to) weapons and armors.
- Search Robots according to their attributes, weapons and armors.
- Destroy a robot
In this app I have used Devise for authentification and Pundit for authorization, following some resources from my bootcamp. However I have experienced problems with the registration/login responses as Devise doesn't support Rails --api applications out of the box, so I have realized this might not be the best solutions and I will try to use devise_token_auth in a new version of this API.
In order to guarantee the authentification of the user I have used Simple Token Authentification
Please check it out and I would be very happy to get your thoughts.
Here is the API running
I will be adding also some more features as automatic generation of serial numbers for each model and most important, some humor about robots :)
Postman documentation available here
- Ruby v.2.5.3
- Ruby on Rails v.5.2.3 - The web framework used to build the app
- Docker - Used to containerize the app
- Postgresql - The database used to store the data
- Devise - Used for user authentification
- Pundit - Pundit helps to make more robuts authorization system
- Simple Token Authentification - Used to manage authentification token for User Model
- PG Search - Implement search for named scopes
What things you need to install the software and how to install them:
git@github.com:agutierrezgit/apirobots.git
2. Build the project - See set up for Linux
docker-compose build
docker-compose run web rails db:create
docker-compose run web rails db:migrate
docker-compose run web rails db:seed
docker-compose up
- Create Robots. Each robot can have weapons and armors.
- Update a robot's attributes, including (but not limited to) weapons and armors.
- Search Robots according to their attributes, weapons and armors.
- Destroy a robot.
- Make API public.
- Create a Readme.