# jaejuna/s-rank-translator architecture

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

- Interactive diagram: https://gitdiagram.com/jaejuna/s-rank-translator
- Repository: https://github.com/jaejuna/s-rank-translator

## Overview

S-Rank Translator supports the user workflow from signing in, through single or batch translation with a chosen prompt and LLM, to saved translation history and human or LLM quality scoring. Prompt-version management and browser-local provider settings are supporting capabilities. The route, page, store, and LLM relationships below are evidenced by the README or sampled imports and calls; database and provider endpoints are documented or directly visible. Other unsampled UI behavior is not inferred.

Main entry points: [`src/App.tsx`](https://github.com/jaejuna/s-rank-translator/blob/main/src/App.tsx) (Routes and layout), [`src/pages/TranslatePage.tsx`](https://github.com/jaejuna/s-rank-translator/blob/main/src/pages/TranslatePage.tsx) (Single translation), [`src/pages/EvaluatePage.tsx`](https://github.com/jaejuna/s-rank-translator/blob/main/src/pages/EvaluatePage.tsx) (Translation evaluation), [`src/lib/supabase.ts`](https://github.com/jaejuna/s-rank-translator/blob/main/src/lib/supabase.ts) (Supabase client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application flow"]
  node_app_routes["Routes and layout<br/>[App.tsx]"]
  node_auth_page["Sign-in and signup<br/>[AuthPage.tsx]"]
end

subgraph group_translation["Translation workflow"]
  node_translation_page["Single translation<br/>[TranslatePage.tsx]"]
  node_batch["Batch upload<br/>[BatchUpload.tsx]"]
  node_prompts_page["Prompt management<br/>[PromptsPage.tsx]"]
  node_settings_page["LLM settings<br/>[SettingsPage.tsx]"]
  node_llm["LLM prompts and clients<br/>[llm.ts]"]
end

subgraph group_quality["Quality evaluation"]
  node_evaluate_page["Translation evaluation<br/>[EvaluatePage.tsx]"]
  node_column_resize["Resizable columns<br/>[useColumnResize.ts]"]
end

subgraph group_state["State and persistence"]
  node_auth_state["Authentication state<br/>[authStore.ts]"]
  node_prompt_state["Prompt versions<br/>[promptStore.ts]"]
  node_settings_state["Provider settings<br/>[settingsStore.ts]"]
  node_translation_state["Translation and scores"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
end

node_user(("Translator"))
node_providers["OpenAI / Anthropic"]
node_supabase[("Supabase auth and database")]

node_user -->|"opens app"| node_app_routes
node_app_routes -->|"initializes auth"| node_auth_state
node_app_routes -->|"routes to"| node_auth_page
node_app_routes -->|"routes to"| node_translation_page
node_app_routes -->|"routes to"| node_evaluate_page
node_app_routes -->|"routes to"| node_prompts_page
node_app_routes -->|"routes to"| node_settings_page
node_auth_page -->|"signs in/up"| node_auth_state
node_auth_state -->|"uses client"| node_supabase_client
node_supabase_client -->|"connects to"| node_supabase
node_translation_page -->|"builds prompt, calls"| node_llm
node_batch -->|"builds prompt, calls"| node_llm
node_llm -->|"sends requests"| node_providers
node_translation_page -->|"selects prompt"| node_prompt_state
node_batch -->|"gets default prompt"| node_prompt_state
node_translation_page -->|"reads provider settings"| node_settings_state
node_batch -->|"reads provider settings"| node_settings_state
node_translation_page -->|"saves translation"| node_translation_state
node_batch -->|"saves batch rows"| node_translation_state
node_translation_page -->|"reads user"| node_auth_state
node_prompts_page -->|"manages versions"| node_prompt_state
node_settings_page -->|"updates settings"| node_settings_state
node_evaluate_page -->|"loads history, saves scores"| node_translation_state
node_evaluate_page -->|"builds prompt, calls"| node_llm
node_evaluate_page -->|"reads provider settings"| node_settings_state
node_evaluate_page -->|"reads user"| node_auth_state
node_evaluate_page -->|"resizes columns"| node_column_resize
node_prompt_state -->|"reads/writes prompts"| node_supabase_client
node_translation_state -->|"reads/writes records"| node_supabase_client
node_supabase_client -->|"connects to"| node_supabase

click node_app_routes "https://github.com/jaejuna/s-rank-translator/blob/main/src/App.tsx"
click node_auth_page "https://github.com/jaejuna/s-rank-translator/blob/main/src/pages/AuthPage.tsx"
click node_auth_state "https://github.com/jaejuna/s-rank-translator/blob/main/src/store/authStore.ts"
click node_translation_page "https://github.com/jaejuna/s-rank-translator/blob/main/src/pages/TranslatePage.tsx"
click node_batch "https://github.com/jaejuna/s-rank-translator/blob/main/src/components/BatchUpload.tsx"
click node_prompts_page "https://github.com/jaejuna/s-rank-translator/blob/main/src/pages/PromptsPage.tsx"
click node_prompt_state "https://github.com/jaejuna/s-rank-translator/blob/main/src/store/promptStore.ts"
click node_settings_page "https://github.com/jaejuna/s-rank-translator/blob/main/src/pages/SettingsPage.tsx"
click node_settings_state "https://github.com/jaejuna/s-rank-translator/blob/main/src/store/settingsStore.ts"
click node_llm "https://github.com/jaejuna/s-rank-translator/blob/main/src/lib/llm.ts"
click node_evaluate_page "https://github.com/jaejuna/s-rank-translator/blob/main/src/pages/EvaluatePage.tsx"
click node_column_resize "https://github.com/jaejuna/s-rank-translator/blob/main/src/lib/useColumnResize.ts"
click node_translation_state "https://github.com/jaejuna/s-rank-translator/blob/main/src/store/translationStore.ts"
click node_supabase_client "https://github.com/jaejuna/s-rank-translator/blob/main/src/lib/supabase.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_app_routes,node_auth_page toneBlue
class node_translation_page,node_batch,node_prompts_page,node_settings_page,node_llm,node_supabase toneAmber
class node_evaluate_page,node_column_resize toneMint
class node_auth_state,node_prompt_state,node_settings_state,node_translation_state,node_supabase_client toneRose
class node_user,node_providers toneIndigo
```

## Components

### Application flow

- [Routes and layout](https://github.com/jaejuna/s-rank-translator/blob/main/src/App.tsx): `src/App.tsx`
- [Sign-in and signup](https://github.com/jaejuna/s-rank-translator/blob/main/src/pages/AuthPage.tsx): `src/pages/AuthPage.tsx`

### Translation workflow

- [Single translation](https://github.com/jaejuna/s-rank-translator/blob/main/src/pages/TranslatePage.tsx): `src/pages/TranslatePage.tsx`
- [Batch upload](https://github.com/jaejuna/s-rank-translator/blob/main/src/components/BatchUpload.tsx): `src/components/BatchUpload.tsx`
- [Prompt management](https://github.com/jaejuna/s-rank-translator/blob/main/src/pages/PromptsPage.tsx): `src/pages/PromptsPage.tsx`
- [LLM settings](https://github.com/jaejuna/s-rank-translator/blob/main/src/pages/SettingsPage.tsx): `src/pages/SettingsPage.tsx`
- [LLM prompts and clients](https://github.com/jaejuna/s-rank-translator/blob/main/src/lib/llm.ts): `src/lib/llm.ts`

### Quality evaluation

- [Translation evaluation](https://github.com/jaejuna/s-rank-translator/blob/main/src/pages/EvaluatePage.tsx): `src/pages/EvaluatePage.tsx`
- [Resizable columns](https://github.com/jaejuna/s-rank-translator/blob/main/src/lib/useColumnResize.ts): `src/lib/useColumnResize.ts`

### State and persistence

- [Authentication state](https://github.com/jaejuna/s-rank-translator/blob/main/src/store/authStore.ts): `src/store/authStore.ts`
- [Prompt versions](https://github.com/jaejuna/s-rank-translator/blob/main/src/store/promptStore.ts): `src/store/promptStore.ts`
- [Provider settings](https://github.com/jaejuna/s-rank-translator/blob/main/src/store/settingsStore.ts): `src/store/settingsStore.ts`
- [Translation and scores](https://github.com/jaejuna/s-rank-translator/blob/main/src/store/translationStore.ts): `src/store/translationStore.ts`
- [Supabase client](https://github.com/jaejuna/s-rank-translator/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`

### Other components

- **Translator**
- **OpenAI / Anthropic**
- **Supabase auth and database**

## Connections

- Translator → Routes and layout: opens app (evidence: `src/App.tsx`)
- Routes and layout → Authentication state: initializes auth (evidence: `src/App.tsx`)
- Routes and layout → Sign-in and signup: routes to (evidence: `src/App.tsx`)
- Routes and layout → Single translation: routes to (evidence: `src/App.tsx`)
- Routes and layout → Translation evaluation: routes to (evidence: `src/App.tsx`)
- Routes and layout → Prompt management: routes to (evidence: `src/App.tsx`)
- Routes and layout → LLM settings: routes to (evidence: `src/App.tsx`)
- Sign-in and signup → Authentication state: signs in/up (evidence: `src/pages/AuthPage.tsx`)
- Authentication state → Supabase client: uses client (evidence: `src/store/authStore.ts`)
- Supabase client → Supabase auth and database: connects to (evidence: `README.md`)
- Single translation → LLM prompts and clients: builds prompt, calls (evidence: `src/pages/TranslatePage.tsx`)
- Batch upload → LLM prompts and clients: builds prompt, calls (evidence: `src/components/BatchUpload.tsx`)
- LLM prompts and clients → OpenAI / Anthropic: sends requests (evidence: `src/lib/llm.ts`)
- Single translation → Prompt versions: selects prompt (evidence: `src/pages/TranslatePage.tsx`)
- Batch upload → Prompt versions: gets default prompt (evidence: `src/components/BatchUpload.tsx`)
- Single translation → Provider settings: reads provider settings (evidence: `src/pages/TranslatePage.tsx`)
- Batch upload → Provider settings: reads provider settings (evidence: `src/components/BatchUpload.tsx`)
- Single translation → Translation and scores: saves translation (evidence: `src/pages/TranslatePage.tsx`)
- Batch upload → Translation and scores: saves batch rows (evidence: `src/components/BatchUpload.tsx`)
- Single translation → Authentication state: reads user (evidence: `src/pages/TranslatePage.tsx`)
- Prompt management → Prompt versions: manages versions (evidence: `src/pages/PromptsPage.tsx`)
- LLM settings → Provider settings: updates settings (evidence: `src/pages/SettingsPage.tsx`)
- Translation evaluation → Translation and scores: loads history, saves scores (evidence: `src/pages/EvaluatePage.tsx`)
- Translation evaluation → LLM prompts and clients: builds prompt, calls (evidence: `src/pages/EvaluatePage.tsx`)
- Translation evaluation → Provider settings: reads provider settings (evidence: `src/pages/EvaluatePage.tsx`)
- Translation evaluation → Authentication state: reads user (evidence: `src/pages/EvaluatePage.tsx`)
- Translation evaluation → Resizable columns: resizes columns (evidence: `src/pages/EvaluatePage.tsx`)
- Prompt versions → Supabase client: reads/writes prompts (evidence: `src/store/promptStore.ts`)
- Translation and scores → Supabase client: reads/writes records (evidence: `src/store/translationStore.ts`)
- Supabase client → Supabase auth and database: connects to (evidence: `README.md`)
