PokemonAPI is a project which implements basic CRUD operations using APIs, it also reads a CSV file from a remote repository to fill some data.
- Ruby version
- Version used to deploy the app ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x64-mingw32]
The following scripts can be useful in order to excecute de app, remember that you can execute them being inside the folder of the project. Ex: C:\Projects\pokemonapi\
- bundle install
- rake db:migrate
- rspec -> to check the tests first
- rake db:seed -> fill data
- rails server -> execute the app
- Paginated pokemon list
GET -> http://127.0.0.1:3000/pokemons?page=0
- Show one pokemon:
GET -> http://127.0.0.1:3000/pokemons/1 -> check the ID
- Update a pokemon
PATCH -> http://127.0.0.1:3000/pokemons/1 -> check the ID
body: { "pokemon":{ "name": "pikachu JR5", "type_1": "fly", "type_2": "dark", "total": 120, "hp": 150, "attack": 200, "defense": 100, "sp_atk": 260, "sp_def": 300, "speed": 150, "generation": 5, "legendary": true } } - Create a pokemon
POST -> http://127.0.0.1:3000/pokemons/body: { "pokemon":{ "name": "pikachu JR5", "type_1": "fly", "type_2": "dark", "total": 120, "hp": 150, "attack": 200, "defense": 100, "sp_atk": 260, "sp_def": 300, "speed": 150, "generation": 5, "legendary": true } } - Delete a pokemon
DELETE -> http://127.0.0.1:3000/pokemons/1 -> check the ID
-
System dependencies
- Install gem dependencies
bundle
- Install gem dependencies
-
Configuration
- To fill default list of data
rake db:seed
- To fill default list of data
-
Database creation
- To create the scheme
rake db:migrate
- To create the scheme
-
Database initialization
-
To erase all databases in the app
rails db:drop:_unsafe
-
For initialize test database
rails db:migrate RAILS_ENV=test
-
-
How to run the test suite
- Run tests
rpec
- Run tests
-
Deployment instructions
- Deploy app
rails server
- Deploy app