# fangyy-alt/deepseak-switch architecture

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

- Interactive diagram: https://gitdiagram.com/fangyy-alt/deepseak-switch
- Repository: https://github.com/fangyy-alt/deepseak-switch

## Overview

This is a local Claude Code configuration switcher with a Flask web interface and a command-line alternative. The main workflow is to inspect the current settings, switch to DeepSeek or restore the prior settings, then have Claude Code use the resulting configuration. The shell script and templates are documented in the tree but were not sampled, so their internal behavior and detailed page-to-endpoint wiring are not shown.

Main entry points: [`app.py`](https://github.com/fangyy-alt/deepseak-switch/blob/main/app.py) (Flask app), [`switch-deepseek.sh`](https://github.com/fangyy-alt/deepseak-switch/blob/main/switch-deepseek.sh) (Switch script), [`templates/help.html`](https://github.com/fangyy-alt/deepseak-switch/blob/main/templates/help.html) (Help page), [`templates/index.html`](https://github.com/fangyy-alt/deepseak-switch/blob/main/templates/index.html) (Switch UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_app["Flask app<br/>[app.py]"]
  node_help["Help page<br/>[help.html]"]
  node_tool["Switch UI<br/>[index.html]"]
end

subgraph group_config["Configuration switching"]
  node_switch_script["Switch script<br/>[switch-deepseek.sh]"]
  node_settings[("Claude settings")]
  node_backup[("Settings backup")]
end

subgraph group_clients["Claude Code integration"]
  node_claude["Claude Code"]
  node_deepseek["DeepSeek API"]
end

node_user(("User"))
node_browser["Browser"]

node_user -->|"uses"| node_browser
node_browser -->|"requests pages"| node_app
node_app -->|"renders"| node_help
node_app -->|"renders"| node_tool
node_browser -->|"requests status"| node_app
node_app -->|"reads status"| node_settings
node_app -->|"reads metadata"| node_backup
node_browser -->|"requests switch or restore"| node_app
node_app -->|"runs command"| node_switch_script
node_switch_script -->|"reads and updates"| node_settings
node_switch_script -->|"backs up or restores"| node_backup
node_user -->|"runs CLI commands"| node_switch_script
node_claude -->|"reads configuration"| node_settings
node_claude -.->|"sends API requests"| node_deepseek

click node_app "https://github.com/fangyy-alt/deepseak-switch/blob/main/app.py"
click node_help "https://github.com/fangyy-alt/deepseak-switch/blob/main/templates/help.html"
click node_tool "https://github.com/fangyy-alt/deepseak-switch/blob/main/templates/index.html"
click node_switch_script "https://github.com/fangyy-alt/deepseak-switch/blob/main/switch-deepseek.sh"

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,node_help,node_tool,node_user,node_browser toneBlue
class node_switch_script,node_settings,node_backup toneAmber
class node_claude,node_deepseek toneMint
```

## Components

### Web interface

- [Flask app](https://github.com/fangyy-alt/deepseak-switch/blob/main/app.py): `app.py`
- [Help page](https://github.com/fangyy-alt/deepseak-switch/blob/main/templates/help.html): `templates/help.html`
- [Switch UI](https://github.com/fangyy-alt/deepseak-switch/blob/main/templates/index.html): `templates/index.html`

### Configuration switching

- [Switch script](https://github.com/fangyy-alt/deepseak-switch/blob/main/switch-deepseek.sh): `switch-deepseek.sh`
- **Claude settings**
- **Settings backup**

### Claude Code integration

- **Claude Code**
- **DeepSeek API**

### Other components

- **User**
- **Browser**

## Connections

- User → Browser: uses
- Browser → Flask app: requests pages
- Flask app → Help page: renders
- Flask app → Switch UI: renders
- Browser → Flask app: requests status
- Flask app → Claude settings: reads status
- Flask app → Settings backup: reads metadata
- Browser → Flask app: requests switch or restore
- Flask app → Switch script: runs command
- Switch script → Claude settings: reads and updates
- Switch script → Settings backup: backs up or restores
- User → Switch script: runs CLI commands
- Claude Code → Claude settings: reads configuration
- Claude Code → DeepSeek API: sends API requests
