# joaomlneto/jitaspace architecture

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

- Interactive diagram: https://gitdiagram.com/joaomlneto/jitaspace
- Repository: https://github.com/joaomlneto/jitaspace

## Overview

Jita Space is an EVE Online companion app. The main user workflow is to browse or search EVE data, optionally authenticate with an EVE account, and use the resulting information in features such as mail, contracts, market, wallet, and killmails. Separate product branches provide icon/blueprint rendering and developer CLI utilities. The graph retains documented capabilities and sampled search, auth, killmail, and SDE-ingestion internals; unsampled feature wiring is represented only where the README documents it.

Main entry points: [`apps/web/app`](https://github.com/joaomlneto/jitaspace/tree/main/apps/web/app) (Web experience), [`packages/background-jobs/helpers/ingestSdeTable.ts`](https://github.com/joaomlneto/jitaspace/blob/main/packages/background-jobs/helpers/ingestSdeTable.ts) (SDE ingestion), [`packages/esi-client/src/client.ts`](https://github.com/joaomlneto/jitaspace/blob/main/packages/esi-client/src/client.ts) (ESI client and hooks), [`apps/web/app/war/[warId]/useWarKillmailFeed.ts`](https://github.com/joaomlneto/jitaspace/blob/main/apps/web/app/war/%5BwarId%5D/useWarKillmailFeed.ts) (Killmail exploration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web companion"]
  node_webapp["Web experience"]
  node_search["Entity search"]
  node_auth["EVE sign-in"]
  node_authstate["Auth state<br/>[useAuthStore.ts]"]
  node_contracts["Contracts"]
  node_mail["In-game mail"]
  node_market["Market and wallet"]
  node_killmails["Killmail exploration"]
end

subgraph group_data["EVE data services"]
  node_esi["ESI client and hooks<br/>[client.ts]"]
  node_sde["EVE static data<br/>[build.ts]"]
  node_database[("PostgreSQL data<br/>[index.ts]")]
end

subgraph group_jobs["Data ingestion"]
  node_jobs["Scheduled data jobs"]
  node_ingest["SDE ingestion<br/>[ingestSdeTable.ts]"]
  node_composite["Composite ingestion"]
  node_loadfile["SDE file loader<br/>[loadSdeFile.ts]"]
  node_update["Table diff updates<br/>[updateTable.ts]"]
end

subgraph group_support["Product support"]
  node_iconserver["Icon and blueprint service"]
  node_cli["Developer CLI<br/>[index.ts]"]
end

node_user(("EVE player"))
node_eve(("EVE Online"))
node_zkill(("zKillboard"))
node_discord(("Discord community"))
node_externaldata(("EVE data source"))

node_user -->|"uses"| node_webapp
node_webapp -.->|"offers search"| node_search
node_search -->|"queries entities"| node_esi
node_esi -->|"requests ESI"| node_eve
node_user -->|"signs in"| node_auth
node_authstate -->|"loads affiliation"| node_esi
node_auth -->|"authenticates"| node_eve
node_webapp -->|"browses"| node_contracts
node_webapp -->|"reads and sends"| node_mail
node_webapp -->|"browses"| node_market
node_webapp -->|"explores"| node_killmails
node_killmails -->|"fetches killmails"| node_zkill
node_killmails -->|"loads war kills"| node_esi
node_jobs -->|"runs ingestion"| node_ingest
node_ingest -->|"loads SDE"| node_loadfile
node_ingest -->|"diffs records"| node_update
node_composite -->|"diffs records"| node_update
node_ingest -->|"writes rows"| node_database
node_composite -->|"reads and writes"| node_database
node_jobs -->|"scrapes EVE data"| node_externaldata
node_user -->|"requests renders"| node_iconserver
node_user -.->|"runs utilities"| node_cli
node_webapp -.->|"community integration"| node_discord

click node_webapp "https://github.com/joaomlneto/jitaspace/tree/main/apps/web/app"
click node_search "https://github.com/joaomlneto/jitaspace/blob/main/apps/web/components/Spotlight/useSearchActions.tsx"
click node_auth "https://github.com/joaomlneto/jitaspace/tree/main/apps/web/app/api/auth"
click node_authstate "https://github.com/joaomlneto/jitaspace/blob/main/packages/hooks/src/hooks/auth/useAuthStore.ts"
click node_contracts "https://github.com/joaomlneto/jitaspace/tree/main/apps/web/app/contracts"
click node_mail "https://github.com/joaomlneto/jitaspace/tree/main/apps/web/app/mail"
click node_market "https://github.com/joaomlneto/jitaspace/tree/main/apps/web/app/market"
click node_killmails "https://github.com/joaomlneto/jitaspace/blob/main/apps/web/app/war/%5BwarId%5D/useWarKillmailFeed.ts"
click node_esi "https://github.com/joaomlneto/jitaspace/blob/main/packages/esi-client/src/client.ts"
click node_sde "https://github.com/joaomlneto/jitaspace/blob/main/packages/sde-utils/src/build.ts"
click node_database "https://github.com/joaomlneto/jitaspace/blob/main/packages/db/index.ts"
click node_jobs "https://github.com/joaomlneto/jitaspace/tree/main/packages/background-jobs/jobs"
click node_ingest "https://github.com/joaomlneto/jitaspace/blob/main/packages/background-jobs/helpers/ingestSdeTable.ts"
click node_composite "https://github.com/joaomlneto/jitaspace/blob/main/packages/background-jobs/helpers/ingestSdeCompositeTable.ts"
click node_loadfile "https://github.com/joaomlneto/jitaspace/blob/main/packages/background-jobs/helpers/loadSdeFile.ts"
click node_update "https://github.com/joaomlneto/jitaspace/blob/main/packages/background-jobs/utils/updateTable.ts"
click node_iconserver "https://github.com/joaomlneto/jitaspace/tree/main/apps/icon-server/routes"
click node_cli "https://github.com/joaomlneto/jitaspace/blob/main/apps/cli/index.ts"

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_webapp,node_search,node_auth,node_authstate,node_contracts,node_mail,node_market,node_killmails toneBlue
class node_esi,node_sde,node_database toneAmber
class node_jobs,node_ingest,node_composite,node_loadfile,node_update toneMint
class node_iconserver,node_cli toneRose
class node_user,node_eve,node_zkill,node_discord,node_externaldata toneIndigo
```

## Components

### Web companion

- [Web experience](https://github.com/joaomlneto/jitaspace/tree/main/apps/web/app): `apps/web/app`
- [Entity search](https://github.com/joaomlneto/jitaspace/blob/main/apps/web/components/Spotlight/useSearchActions.tsx): `apps/web/components/Spotlight/useSearchActions.tsx`
- [EVE sign-in](https://github.com/joaomlneto/jitaspace/tree/main/apps/web/app/api/auth): `apps/web/app/api/auth`
- [Auth state](https://github.com/joaomlneto/jitaspace/blob/main/packages/hooks/src/hooks/auth/useAuthStore.ts): `packages/hooks/src/hooks/auth/useAuthStore.ts`
- [Contracts](https://github.com/joaomlneto/jitaspace/tree/main/apps/web/app/contracts): `apps/web/app/contracts`
- [In-game mail](https://github.com/joaomlneto/jitaspace/tree/main/apps/web/app/mail): `apps/web/app/mail`
- [Market and wallet](https://github.com/joaomlneto/jitaspace/tree/main/apps/web/app/market): `apps/web/app/market`
- [Killmail exploration](https://github.com/joaomlneto/jitaspace/blob/main/apps/web/app/war/%5BwarId%5D/useWarKillmailFeed.ts): `apps/web/app/war/[warId]/useWarKillmailFeed.ts`

### EVE data services

- [ESI client and hooks](https://github.com/joaomlneto/jitaspace/blob/main/packages/esi-client/src/client.ts): `packages/esi-client/src/client.ts`
- [EVE static data](https://github.com/joaomlneto/jitaspace/blob/main/packages/sde-utils/src/build.ts): `packages/sde-utils/src/build.ts`
- [PostgreSQL data](https://github.com/joaomlneto/jitaspace/blob/main/packages/db/index.ts): `packages/db/index.ts`

### Data ingestion

- [Scheduled data jobs](https://github.com/joaomlneto/jitaspace/tree/main/packages/background-jobs/jobs): `packages/background-jobs/jobs`
- [SDE ingestion](https://github.com/joaomlneto/jitaspace/blob/main/packages/background-jobs/helpers/ingestSdeTable.ts): `packages/background-jobs/helpers/ingestSdeTable.ts`
- [Composite ingestion](https://github.com/joaomlneto/jitaspace/blob/main/packages/background-jobs/helpers/ingestSdeCompositeTable.ts): `packages/background-jobs/helpers/ingestSdeCompositeTable.ts`
- [SDE file loader](https://github.com/joaomlneto/jitaspace/blob/main/packages/background-jobs/helpers/loadSdeFile.ts): `packages/background-jobs/helpers/loadSdeFile.ts`
- [Table diff updates](https://github.com/joaomlneto/jitaspace/blob/main/packages/background-jobs/utils/updateTable.ts): `packages/background-jobs/utils/updateTable.ts`

### Product support

- [Icon and blueprint service](https://github.com/joaomlneto/jitaspace/tree/main/apps/icon-server/routes): `apps/icon-server/routes`
- [Developer CLI](https://github.com/joaomlneto/jitaspace/blob/main/apps/cli/index.ts): `apps/cli/index.ts`

### Other components

- **EVE player**
- **EVE Online**
- **zKillboard**
- **Discord community**
- **EVE data source**

## Connections

- EVE player → Web experience: uses (evidence: `README.md`)
- Web experience → Entity search: offers search
- Entity search → ESI client and hooks: queries entities (evidence: `apps/web/components/Spotlight/useSearchActions.tsx`)
- ESI client and hooks → EVE Online: requests ESI
- EVE player → EVE sign-in: signs in (evidence: `README.md`)
- Auth state → ESI client and hooks: loads affiliation (evidence: `packages/hooks/src/hooks/auth/useAuthStore.ts`)
- EVE sign-in → EVE Online: authenticates (evidence: `README.md`)
- Web experience → Contracts: browses (evidence: `README.md`)
- Web experience → In-game mail: reads and sends (evidence: `README.md`)
- Web experience → Market and wallet: browses (evidence: `README.md`)
- Web experience → Killmail exploration: explores (evidence: `README.md`)
- Killmail exploration → zKillboard: fetches killmails (evidence: `apps/web/app/war/[warId]/useWarKillmailFeed.ts`)
- Killmail exploration → ESI client and hooks: loads war kills (evidence: `apps/web/app/war/[warId]/useWarKillmailFeed.ts`)
- Scheduled data jobs → SDE ingestion: runs ingestion (evidence: `packages/background-jobs/jobs/scrape/sde/ingestSdeStationServices.ts`)
- SDE ingestion → SDE file loader: loads SDE (evidence: `packages/background-jobs/helpers/ingestSdeTable.ts`)
- SDE ingestion → Table diff updates: diffs records (evidence: `packages/background-jobs/helpers/ingestSdeTable.ts`)
- Composite ingestion → Table diff updates: diffs records (evidence: `packages/background-jobs/helpers/ingestSdeCompositeTable.ts`)
- SDE ingestion → PostgreSQL data: writes rows (evidence: `packages/background-jobs/helpers/ingestSdeTable.ts`)
- Composite ingestion → PostgreSQL data: reads and writes (evidence: `packages/background-jobs/helpers/ingestSdeCompositeTable.ts`)
- Scheduled data jobs → EVE data source: scrapes EVE data (evidence: `README.md`)
- EVE player → Icon and blueprint service: requests renders (evidence: `README.md`)
- EVE player → Developer CLI: runs utilities
- Web experience → Discord community: community integration (evidence: `README.md`)
