# iphirix/pokeprice architecture

> Architecture diagram of the GitHub repository iphirix/pokeprice, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/iphirix/pokeprice
- Repository: https://github.com/iphirix/pokeprice

## Overview

PokePrice is a Pokémon card price-tracking product with web and desktop clients. The main web workflow is to search cards or sealed products, add them to a collection or watchlist, and use portfolio and pricing features to track value. Other product areas include card-show listings, trades, activity, alerts, account settings, and a Pokédex. The sampled web code shows the tRPC entry point and search/add calls; unsampled router and desktop internals are represented only at paths supported by the tree.

Main entry points: [`apps/web/src/app/api/trpc/[trpc]/route.ts`](https://github.com/iphirix/pokeprice/blob/main/apps/web/src/app/api/trpc/%5Btrpc%5D/route.ts) (tRPC endpoint), [`apps/web/src/server/router.ts`](https://github.com/iphirix/pokeprice/blob/main/apps/web/src/server/router.ts) (Application router), [`apps/web/src/app/(app)/layout.tsx`](https://github.com/iphirix/pokeprice/blob/main/apps/web/src/app/(app)/layout.tsx) (Web app), [`apps/web/src/components/SealedSearchClient.tsx`](https://github.com/iphirix/pokeprice/blob/main/apps/web/src/components/SealedSearchClient.tsx) (Sealed search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Client applications"]
  node_web["Web app<br/>[layout.tsx]"]
  node_desktop["Desktop app<br/>[App.jsx]"]
end

subgraph group_collection["Discovery and collection"]
  node_search["Card search<br/>[SearchClient.tsx]"]
  node_advanced["Advanced search"]
  node_sealed["Sealed search"]
  node_detail["Card details"]
  node_dashboard["Portfolio dashboard"]
end

subgraph group_tracking["Tracking and community"]
  node_shows["Card shows<br/>[card-shows.ts]"]
  node_trades["Trade service<br/>[trades.ts]"]
  node_activity["Activity service<br/>[activity.ts]"]
  node_profiles["Profiles and settings<br/>[profiles.ts]"]
  node_alerts["Price alerts<br/>[index.ts]"]
  node_price_refresh["Price refresh<br/>[index.ts]"]
end

subgraph group_server["Web service"]
  node_portfolio["Portfolio service<br/>[portfolio.ts]"]
  node_cards["Card service<br/>[cards.ts]"]
  node_api["tRPC endpoint<br/>[route.ts]"]
  node_router["Application router<br/>[router.ts]"]
  node_pricing["Price service<br/>[prices.ts]"]
  node_desktop_backend["Desktop backend<br/>[lib.rs]"]
end

subgraph group_integrations["Data and integrations"]
  node_db["Supabase client<br/>[client.ts]"]
  node_pokemon["Pokémon data package<br/>[index.ts]"]
  node_shows_pkg["Show data package<br/>[index.ts]"]
end

node_user(("Collector"))
node_supabase[("Supabase")]
node_tcgdex["TCGdex"]

node_user -->|"uses"| node_web
node_user -->|"uses"| node_desktop
node_web -->|"opens"| node_search
node_web -->|"opens"| node_advanced
node_web -->|"opens"| node_sealed
node_web -->|"opens"| node_dashboard
node_search -->|"queries cards"| node_api
node_search -->|"adds card"| node_api
node_advanced -->|"queries cards"| node_api
node_advanced -->|"adds card"| node_api
node_sealed -->|"queries products"| node_api
node_sealed -->|"adds product"| node_api
node_sealed -->|"reads profile"| node_api
node_detail -->|"loads details"| node_api
node_dashboard -->|"loads portfolio"| node_api
node_api -->|"dispatches"| node_router
node_router -->|"routes cards"| node_cards
node_router -->|"routes portfolio"| node_portfolio
node_router -->|"routes prices"| node_pricing
node_router -->|"routes shows"| node_shows
node_router -->|"routes trades"| node_trades
node_router -->|"routes activity"| node_activity
node_router -->|"routes profiles"| node_profiles
node_cards -.->|"uses Pokémon data"| node_pokemon
node_shows -.->|"uses show data"| node_shows_pkg
node_desktop -->|"invokes backend"| node_desktop_backend
node_db -->|"connects"| node_supabase
node_alerts -->|"checks alerts"| node_supabase
node_price_refresh -->|"refreshes prices"| node_supabase

click node_web "https://github.com/iphirix/pokeprice/blob/main/apps/web/src/app/(app)/layout.tsx"
click node_desktop "https://github.com/iphirix/pokeprice/blob/main/apps/desktop/src/renderer/src/App.jsx"
click node_search "https://github.com/iphirix/pokeprice/blob/main/apps/web/src/components/SearchClient.tsx"
click node_advanced "https://github.com/iphirix/pokeprice/blob/main/apps/web/src/components/AdvancedSearchClient.tsx"
click node_sealed "https://github.com/iphirix/pokeprice/blob/main/apps/web/src/components/SealedSearchClient.tsx"
click node_detail "https://github.com/iphirix/pokeprice/blob/main/apps/web/src/components/CardDetailClient.tsx"
click node_dashboard "https://github.com/iphirix/pokeprice/blob/main/apps/web/src/components/DashboardClient.tsx"
click node_portfolio "https://github.com/iphirix/pokeprice/blob/main/apps/web/src/server/routers/portfolio.ts"
click node_cards "https://github.com/iphirix/pokeprice/blob/main/apps/web/src/server/routers/cards.ts"
click node_api "https://github.com/iphirix/pokeprice/blob/main/apps/web/src/app/api/trpc/%5Btrpc%5D/route.ts"
click node_router "https://github.com/iphirix/pokeprice/blob/main/apps/web/src/server/router.ts"
click node_pricing "https://github.com/iphirix/pokeprice/blob/main/apps/web/src/server/routers/prices.ts"
click node_shows "https://github.com/iphirix/pokeprice/blob/main/apps/web/src/server/routers/card-shows.ts"
click node_trades "https://github.com/iphirix/pokeprice/blob/main/apps/web/src/server/routers/trades.ts"
click node_activity "https://github.com/iphirix/pokeprice/blob/main/apps/web/src/server/routers/activity.ts"
click node_profiles "https://github.com/iphirix/pokeprice/blob/main/apps/web/src/server/routers/profiles.ts"
click node_alerts "https://github.com/iphirix/pokeprice/blob/main/supabase/functions/check-alerts/index.ts"
click node_price_refresh "https://github.com/iphirix/pokeprice/blob/main/supabase/functions/refresh-prices/index.ts"
click node_db "https://github.com/iphirix/pokeprice/blob/main/packages/database/src/client.ts"
click node_pokemon "https://github.com/iphirix/pokeprice/blob/main/packages/pokemon/src/index.ts"
click node_shows_pkg "https://github.com/iphirix/pokeprice/blob/main/packages/card-shows/src/index.ts"
click node_desktop_backend "https://github.com/iphirix/pokeprice/blob/main/apps/desktop/src-tauri/src/lib.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web,node_desktop toneBlue
class node_search,node_advanced,node_sealed,node_detail,node_dashboard,node_supabase toneAmber
class node_shows,node_trades,node_activity,node_profiles,node_alerts,node_price_refresh toneMint
class node_portfolio,node_cards,node_api,node_router,node_pricing,node_desktop_backend toneRose
class node_db,node_pokemon,node_shows_pkg,node_user,node_tcgdex toneIndigo
```

## Components

### Client applications

- [Web app](https://github.com/iphirix/pokeprice/blob/main/apps/web/src/app/(app)/layout.tsx): `apps/web/src/app/(app)/layout.tsx`
- [Desktop app](https://github.com/iphirix/pokeprice/blob/main/apps/desktop/src/renderer/src/App.jsx): `apps/desktop/src/renderer/src/App.jsx`

### Discovery and collection

- [Card search](https://github.com/iphirix/pokeprice/blob/main/apps/web/src/components/SearchClient.tsx): `apps/web/src/components/SearchClient.tsx`
- [Advanced search](https://github.com/iphirix/pokeprice/blob/main/apps/web/src/components/AdvancedSearchClient.tsx): `apps/web/src/components/AdvancedSearchClient.tsx`
- [Sealed search](https://github.com/iphirix/pokeprice/blob/main/apps/web/src/components/SealedSearchClient.tsx): `apps/web/src/components/SealedSearchClient.tsx`
- [Card details](https://github.com/iphirix/pokeprice/blob/main/apps/web/src/components/CardDetailClient.tsx): `apps/web/src/components/CardDetailClient.tsx`
- [Portfolio dashboard](https://github.com/iphirix/pokeprice/blob/main/apps/web/src/components/DashboardClient.tsx): `apps/web/src/components/DashboardClient.tsx`

### Tracking and community

- [Card shows](https://github.com/iphirix/pokeprice/blob/main/apps/web/src/server/routers/card-shows.ts): `apps/web/src/server/routers/card-shows.ts`
- [Trade service](https://github.com/iphirix/pokeprice/blob/main/apps/web/src/server/routers/trades.ts): `apps/web/src/server/routers/trades.ts`
- [Activity service](https://github.com/iphirix/pokeprice/blob/main/apps/web/src/server/routers/activity.ts): `apps/web/src/server/routers/activity.ts`
- [Profiles and settings](https://github.com/iphirix/pokeprice/blob/main/apps/web/src/server/routers/profiles.ts): `apps/web/src/server/routers/profiles.ts`
- [Price alerts](https://github.com/iphirix/pokeprice/blob/main/supabase/functions/check-alerts/index.ts): `supabase/functions/check-alerts/index.ts`
- [Price refresh](https://github.com/iphirix/pokeprice/blob/main/supabase/functions/refresh-prices/index.ts): `supabase/functions/refresh-prices/index.ts`

### Web service

- [Portfolio service](https://github.com/iphirix/pokeprice/blob/main/apps/web/src/server/routers/portfolio.ts): `apps/web/src/server/routers/portfolio.ts`
- [Card service](https://github.com/iphirix/pokeprice/blob/main/apps/web/src/server/routers/cards.ts): `apps/web/src/server/routers/cards.ts`
- [tRPC endpoint](https://github.com/iphirix/pokeprice/blob/main/apps/web/src/app/api/trpc/%5Btrpc%5D/route.ts): `apps/web/src/app/api/trpc/[trpc]/route.ts`
- [Application router](https://github.com/iphirix/pokeprice/blob/main/apps/web/src/server/router.ts): `apps/web/src/server/router.ts`
- [Price service](https://github.com/iphirix/pokeprice/blob/main/apps/web/src/server/routers/prices.ts): `apps/web/src/server/routers/prices.ts`
- [Desktop backend](https://github.com/iphirix/pokeprice/blob/main/apps/desktop/src-tauri/src/lib.rs): `apps/desktop/src-tauri/src/lib.rs`

### Data and integrations

- [Supabase client](https://github.com/iphirix/pokeprice/blob/main/packages/database/src/client.ts): `packages/database/src/client.ts`
- [Pokémon data package](https://github.com/iphirix/pokeprice/blob/main/packages/pokemon/src/index.ts): `packages/pokemon/src/index.ts`
- [Show data package](https://github.com/iphirix/pokeprice/blob/main/packages/card-shows/src/index.ts): `packages/card-shows/src/index.ts`

### Other components

- **Collector**
- **Supabase**
- **TCGdex**

## Connections

- Collector → Web app: uses
- Collector → Desktop app: uses
- Web app → Card search: opens
- Web app → Advanced search: opens
- Web app → Sealed search: opens
- Web app → Portfolio dashboard: opens
- Card search → tRPC endpoint: queries cards
- Card search → tRPC endpoint: adds card
- Advanced search → tRPC endpoint: queries cards
- Advanced search → tRPC endpoint: adds card
- Sealed search → tRPC endpoint: queries products
- Sealed search → tRPC endpoint: adds product
- Sealed search → tRPC endpoint: reads profile
- Card details → tRPC endpoint: loads details
- Portfolio dashboard → tRPC endpoint: loads portfolio
- tRPC endpoint → Application router: dispatches
- Application router → Card service: routes cards
- Application router → Portfolio service: routes portfolio
- Application router → Price service: routes prices
- Application router → Card shows: routes shows
- Application router → Trade service: routes trades
- Application router → Activity service: routes activity
- Application router → Profiles and settings: routes profiles
- Card service → Pokémon data package: uses Pokémon data
- Card shows → Show data package: uses show data
- Desktop app → Desktop backend: invokes backend
- Supabase client → Supabase: connects
- Price alerts → Supabase: checks alerts
- Price refresh → Supabase: refreshes prices
