This documentation outlines the usage and functionality of the PokeTeamAPI. Why did I do this? It was just a selection process that required this, and I don't want to delete it
The PokeTeamAPI provides endpoints for managing Pokémon teams associated with trainers. Trainers can create teams, retrieve information about their own team, and fetch a list of all teams.
-
Ensure you have docker installed on your machine. If not, you can download it here.
-
Clone the repository.
git clone https://github.com/Peedrooo/TriagilPokeTeamAPI.git
-
Rename the
.env.example
file to.env
-
Navigate to the root of the project and run the following command to create network and start the containers.
docker-network create triagil-network docker-compose up poketeam
-
The API will be available at
http://localhost:5000
. -
The Swagger documentation will be available at
http://localhost:5000/docs
.
-
Navigate to the root of the project and run the following command to run the tests.
docker compose up poketeam-test
-
Navigate to the root of the project and run the following command to stop the containers.
docker-compose down
The base URL for the Team Service API is /teams
.
- Endpoint:
/teams
- Method: POST
- Description: Create a new Pokémon team for a trainer.
- Request Body:
{ "user": "ash", "team": ["pikachu", "blastoise"] }
- Response:
- Status Code: 201 Created
- Body:
{ "message": "Team created successfully", "status": "success", "data": { "owner": "ash", "pokemons": [ { "name": "pikachu", "weight": 60, "height": 4 }, { "name": "blastoise", "weight": 85, "height": 16 } ] } }
- Endpoint:
/teams/{user}
- Method: GET
- Description: Retrieve information about a specific trainer's Pokémon team.
- Path Parameter:
user
: The name of the trainer.
- Response:
- Status Code: 200 OK
- Body:
{ "owner": "ash", "pokemons": [ { "name": "pikachu", "weight": 60, "height": 4 }, { "name": "blastoise", "weight": 85, "height": 16 } ] }
- Status Code: 400 Bad Request
- Body:
{ "message": "Trainer ash not found", "status": "error", "data": null }
- Endpoint:
/teams
- Method: GET
- Description: Retrieve a list of all Pokémon teams.
- Response:
- Status Code: 200 OK
- Body:
{ "1": { "owner": "ash", "pokemons": [ { "name": "pikachu", "weight": 60, "height": 4 }, { "name": "blastoise", "weight": 85, "height": 16 } ] }, "2": { "owner": "misty", "pokemons": [ { "name": "starmie", "weight": 80, "height": 11 }, { "name": "psyduck", "weight": 196, "height": 8 } ] } // Additional teams... }
- Python
- FastAPI
- Docker
- Pytest
- brmodelo