This is a web application built with Flask that allows users to create and manage Pokémon teams. Users can register their teams, add Pokémon to their teams, and view all registered teams.
-
Create new Pokémon teams
-
Add Pokémon to existing teams
-
View all registered Pokémon teams
-
Error handling for invalid Pokémon names and missing user input
-
GET /: Renders the HTML interface for creating and viewing Pokémon teams.
-
GET /api/teams: Retrieves all registered teams.
-
GET /api/teams/{username}: Retrieves a team by username.
-
POST /api/teams: Creates a new team or adds Pokémon to an existing team.
pip install -r requirements.txt
-
Run the Flask application:
python app.py
-
Open your web browser and go to http://localhost:5000 to access the application.
-
To create or update a Pokémon team, use the provided form on the homepage. Enter your username and select Pokémon from the dropdown menu. Click "Create Team" to submit.
-
To view all registered teams, navigate to http://localhost:5000/api/teams in your browser.
-
To search for teams by user, use the endpoint
http://localhost:5000/api/teams/<username>
, replacing<username>
with the desired username.
Alternatively, you can run the application using Docker.
-
Build the Docker image:
docker build -t pokemon-api .
-
Run the Docker container:
docker run --rm -p 5000:5000 pokemon-api
-
Access the application at http://localhost:5000 as described above.
Contributions are welcome! Please feel free to submit bug reports, feature requests, or pull requests.