A hacked-together, barebones, locally-(or web)-hosted Pokemon Team Builder app. Mostly pure Python using Streamlit and PyZMQ.
π Homepage
- Feature List
- Software/Resources Used
- Images
- Preparation/Build Guide
- Usage
- Remove/Delete Program
- Notes
- Author
- Contributing
- Show your Support
- Acknowledgements
- License
- Functional
- Choose Pokemon
- Get game desc
- Get type
- Get sprite
- Choose Moves
- get move desc
- get power/acc
- get type
- Choose Held item
- get sprite
- get item desc
- Get Smogon Dex Analysis Link
- Choose Pokemon
- User
- tabbed or single page view
- Install Docker Desktop
- (optional) Install Git
- Clone this repo to a directory of your choice using the following command:
git clone https://github.com/fleetwoodmac/PokemonTeamBuilder.git
or by downloading repo as zip file and unzipping to desired to location
4. Make sure Docker Desktop is running and that you have space free before proceeding.5. In the root directory of the program, build using the following command:
docker build -t namehere .
where namehere
is whatever you want the docker image to be called. For example, this guide will use pokemonteambuilder
. Keep the .
in the command.
- Terminal/CMD should give a success message
docker images
To be updated
- This is if you built the docker image.
- Run the following command
docker run -p 8501:8501 namehere
where namehere
is the image name you used in step 5 of the docker build guide. You should see something like:
- Copy the URL (by default, this is http://0.0.0.0:8501). paste it into a browser, and you should see the webapp come up!
4. You can verify the docker container is running using
docker container ls
- Stop the container using the command
docker stop containername
where containername
is the text from step 4 under NAMES. In the image above, it happened to be peaceful_leavitt
. You can also open Docker Desktop, go to the Containers tab, and stop the container there.
To be updated
- The easiest way to do this is using Docker Desktop.
- Open Docker Desktop. Make sure any containers running this program are stopped.
- In the Containers tab, check the box for the container that has this program in it, and hit Delete.
- In the Images tab, check the box for the image containing this program, and hit Delete.
- Delete the directory you cloned/files you directly downloaded in the Install guide.
To be updated
-
While I do not collect any sort of information, Streamlit collects usage telemetry by default. This is not disabled by default.
- If you want to disable this, see Streamlit's documentation on the subject here.
-
Changing the port or address the app runs on
- You can change the port as well as the host URL you want to app to run on in the Dockerfile before you build the image. Also make sure to change the
EXPOSE
line in the Dockerfile if you change the default port.
- You can change the port as well as the host URL you want to app to run on in the Dockerfile before you build the image. Also make sure to change the
-
Deploying as a web-hosted/public instance
- I can do a more thorough write-up of how to deploy this as a public instance if there is interest but the general steps are:
- Make a docker hub account and create a public repository. Name it whatever you want (ex:
pokemonteambuilder-demo
). it should display a push command likedocker push yourdockername/yourreponame
- Build a docker image locally following the steps in the build guide. Make sure that your image name matches your repo name, i.e for the image name/tag use
yourdockerusername/yourimagename
(oryourdockerusername/yourimagename:version
where version is something likelatest
if you are actively tracking version history). - if you are compiling on an arm based machine like an M1 Mac, make sure you build an x86 version of the image (see Jaimyn Mayer's guide linked below).
- push to docker hub using the docker push command you got earlier
- sign up for the free tier of a hosting service like oracle cloud, google cloud run, etc.
- I used google cloud run, so for that, once you are logged in, create a new project and name it whatever, then go to Google Cloud Run, hit create new service
- for the container URL just put in your docker hub repo name, i.e
yourdockerusername/yourreponame
. It should automatically pull the docker image from there (again, important that it is a public repo) - change the container port to 8501 (or whatever you changed it to in the dockerfile)
- create the service, and it should eventually give you a URL. Go to that URL and you should have a public instance running.
- Make a docker hub account and create a public repository. Name it whatever you want (ex:
- I can do a more thorough write-up of how to deploy this as a public instance if there is interest but the general steps are:
-
Note on debugging seg faults and pyarrow
- one of Streamlit's dependencies is pyarrow, and as of the time of this readme being updated, pyarrow has been quite finicky. If you are getting segfaults or weird errors running Streamlit, it may be due to pyarrow. As of this update to the readme, the current version of pyarrow is 14.0.0. After installing streamlit, manually overwriting pyarrow with an older version (12.0.1 for example) made the app run perfectly after experiencing some seg faults while running the
streamlit run
command.
- one of Streamlit's dependencies is pyarrow, and as of the time of this readme being updated, pyarrow has been quite finicky. If you are getting segfaults or weird errors running Streamlit, it may be due to pyarrow. As of this update to the readme, the current version of pyarrow is 14.0.0. After installing streamlit, manually overwriting pyarrow with an older version (12.0.1 for example) made the app run perfectly after experiencing some seg faults while running the
π€ fleetwoodmac
- Website: https://github.com/fleetwoodmac/
- Github: @fleetwoodmac
Contributions, issues and feature requests are welcome! Please also feel free to fork and start developing on it more on your own!
Feel free to check issues page.
As mentioned, please feel free to fork this and start developing it more if you want--it's pretty barebones and sorta buggy in its current state. Give it a βοΈ if you thought it was cool!
- Streamlit's documentation
- PokeAPI's documentation
- ZeroMQ's documentation
- Image and misc. resources
- Kelsey Oshiro's Team Builder project for type images. Their Github.
- Bulbapedia for Pokedex image here, and move data when not available on PokeAPI.
- Smogon Strategy Pokedex for competitive analysis
- Docker resources
- Isha Terdal's streamlit app deployment guide. Their Github.
- Streamlit's Docker guide
- Jaimyn Mayer's guide on how to build x86 and arm64 on M1 Macs. Their Github
- FayZ676's guide on deploying Streamlit docker images to Google Cloude Run.
- Carlos D Serrano's Streamlit repeatable items guide. Their Github (I think?).
- kefranagb's readme-md-generator
Copyright Β© 2023 fleetwoodmac.
This project is MIT licensed.
This README was generated with β€οΈ by readme-md-generator