{"id":31378704,"url":"https://github.com/uggla/pokemon-app","last_synced_at":"2025-09-28T06:56:40.618Z","repository":{"id":311255593,"uuid":"1042177015","full_name":"uggla/pokemon-app","owner":"uggla","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-21T15:51:49.000Z","size":112,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-23T17:59:54.078Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uggla.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-21T15:47:22.000Z","updated_at":"2025-08-21T15:51:56.000Z","dependencies_parsed_at":"2025-08-23T09:08:27.498Z","dependency_job_id":"29ca74e6-99cf-4d17-bb42-d7224eccf498","html_url":"https://github.com/uggla/pokemon-app","commit_stats":null,"previous_names":["uggla/pokemon-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/uggla/pokemon-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uggla%2Fpokemon-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uggla%2Fpokemon-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uggla%2Fpokemon-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uggla%2Fpokemon-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uggla","download_url":"https://codeload.github.com/uggla/pokemon-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uggla%2Fpokemon-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277335329,"owners_count":25800966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-28T02:00:08.834Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-28T06:56:39.625Z","updated_at":"2025-09-28T06:56:40.613Z","avatar_url":"https://github.com/uggla.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pokemon App — Tyradex Pokemons UI (Vite + TypeScript)\n\nSmall frontend app (\"pokemon-app\") to browse a Pokemon dataset (built with Vite + TypeScript). This repository contains the UI, a small in-memory store and utilities, tests driven with Vitest, and a few DOM-driven components (table, chart, modal).\n\n## Quick start\n\n- Prerequisites: `node` (16+ recommended), `pnpm` installed globally.\n- Install dependencies: `pnpm install`\n- Start dev server: `pnpm dev` (Vite + HMR)\n- Build (type-checks then production build): `pnpm build`\n- Preview production build: `pnpm preview`\n- Run tests: `pnpm test`\n- Run tests with coverage: `pnpm run coverage`\n\n## Project structure\n\n- `index.html` — application entry (Vite mounts `#app`)\n- `src/` — TypeScript source files\n  - `main.ts` — app bootstrap and DOM wiring\n  - `pokemons.ts` — API types + `Pokemons.load()` (remote fetch)\n  - `pokemonStore.ts` — in-memory store helpers (`setAllPokemons`, `getPokemonById`, `getAllPokemons`)\n  - `pokemonTable.ts` — table rendering, sorting, filtering, pagination\n  - `pokemonChart.ts` — chart rendering when `pokemons:visible` is emitted\n  - `pokemonModal.ts` — modal rendering and evolution lookups\n  - `style.css` — styles\n- `public/` — static assets served at root (e.g. `/vite.svg`)\n- `tests/` — Vitest unit tests\n\n## Developer notes\n\n- TypeScript uses strict mode; the project prefers explicit `./file.ts` imports when modifying code.\n- Conventions: `camelCase` for functions/vars, `PascalCase` for types/classes.\n- Use `pnpm build` locally before opening PRs to surface TypeScript issues.\n\n## Useful DOM hooks \u0026 events\n\nComponents in this app expose DOM hooks and dispatch events to keep things decoupled.\n\n- Table / filters / pagination\n  - Table: `#pokemons-table`\n  - Table body: `#pokemons-body`\n  - Search input: `#search-name`, clear button: `#search-clear`\n  - Generation select: `#filter-gen`\n  - Sort buttons: `#sort-name`, `#sort-category`, `#sort-hp`, `#sort-atk`, `#sort-def`, `#sort-spa`, `#sort-spd`, `#sort-vit`\n  - Pagination: `#page-prev`, `#page-next`, page info: `#page-info`\n\n- Events\n  - `pokemon:show` — dispatched with `detail = pokemon` to open the modal\n  - `pokemons:visible` — dispatched with `detail = visibleList` when the table renders a page (used by chart)\n\n- Modal / Chart\n  - Modal renders radar inside a `div.modal-stats` and exposes img click handlers to navigate evolutions\n  - Chart listens to `pokemons:visible` and renders an SVG polyline + clickable images which dispatch `pokemon:show`\n\n## Store API\n\nUse the helpers from `src/pokemonStore.ts` when you need cached data:\n\n- `setAllPokemons(list: Pokemon[])` — set the store\n- `getAllPokemons(): Pokemon[]` — get all cached pokemons\n- `getPokemonById(id: number): Pokemon | undefined` — lookup by pokedex id\n\n## Data source / API\n\n- The app (via `Pokemons.load()`) fetches data from `https://tyradex.vercel.app/api/v1/pokemon`.\n- Network calls should be treated as untrusted — do not inject raw HTML from API responses into the DOM.\n\n## Testing\n\n- Tests are written using Vitest and live in the `tests/` folder.\n- Run unit tests: `pnpm test`.\n- Coverage: `pnpm run coverage` (v8 collector in this project).\n\n## Commits \u0026 PRs\n\n- Use Conventional Commits (e.g. `feat:`, `fix:`, `test:`) for clarity.\n- Keep PRs focused and small; run `pnpm build` and tests before opening a PR.\n\n## Security \u0026 environment\n\n- Client-exposed env vars for Vite must be prefixed with `VITE_`.\n- Do not commit `.env*` files.\n\n---\n\nThis README is a starting point — we can expand command examples, architecture diagrams, or developer onboarding steps next. If you want, I can also open a PR for this file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuggla%2Fpokemon-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuggla%2Fpokemon-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuggla%2Fpokemon-app/lists"}