Skip to content

Pokedex - AutoBattler

The idea is to have two tabs:

Pokedex and Battler

Plus a debug tab that shows all databases and tables

The pokedex should be always available (public) and the AutoBattler only for those that have a pin (qrcode for entering a battle) and the debug plus setting up a tournament and the dashboard of the tournament should be only available to people with an admin pin.

Pokedex

Get the data from https://pokeapi.co/ and cache it inside of duck db: https://duckdb.org/docs/lts/clients/rust

The idea is that we know for each pokemon the sprite/picture, attacks at each level, health etc. all batlle relevant stats. Maybe also the description.

We only want to have Pokémon FireRed and LeafGreen generation.

Battler

The Battler is a way to let users fight with Pokemons against each other.

The admin creates a tournament, the users sign up with a qr code (The admin can show that) The users choose a pokemon (or random pokemon) choose the attacks it should have. The admin can start the tournament The users get to fight other people, if they win they get to fight other who won. The tournament default format should be elimination (people that lost can not fight anymore) in the dashboard we see the every fight and if there are only 4 ongoing fights we should see them live with the sprites/live view. Before it should be just cards with the stats.

The maximum time for a turn is 20 seconds otherwise the attack will be random.

The normal effectivness rules should apply of that pokemon generation and all other rules.

There are no items and only one pokemon. After a fight, pokemons are healed for the next fight.

The maximum turn time can be changes by the admin (good for testing purpose) and the admin can add bots (also nice for testing)

Technical

Databases

Sql lite for the active battles/tournament (all moves, actions etc.) For everything else use duck db

As with the https://fig.silenlocatelli.ch/silen/notify project it is important that we do not block on the database setup (see how it is done for the sql lite setup)

UI

Vendored htmx 4: https://cdn.jsdelivr.net/npm/htmx.org@4.0.0/dist/htmx.min.js Htmx extension also vendored: https://cdn.jsdelivr.net/npm/htmx.org@4.0.0/dist/ext/hx-ws.min.js for live updates of the fight. Self written CSS

The Pokedex should not load all pokemons at once but rather window them with this pattern: https://four.htmx.org/patterns/infinite-scroll

Search is done with: https://four.htmx.org/patterns/active-search

Style wise this should be considered: https://trends.daisyui.com/trend/cottagecore/

No extra JS should be written. Just HTMX centric.

Persistence

Everything should in the AutoBattler should be recorded. The idea is that the Admin can replay the best fights. On the dashboard or live view the fight the people are doing on the phone.