# cataragamihai/apa_course_project architecture

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

- Interactive diagram: https://gitdiagram.com/cataragamihai/apa_course_project
- Repository: https://github.com/cataragamihai/apa_course_project

## Overview

Intercept & Decode is a bilingual Vigenère cryptanalysis demo. Users choose an archived transmission, run three cracking methods with live progress, and compare results; they can also reveal ground truth, encrypt custom text, and run archive or scaling experiments. The backend is stateless and reads its archive and wordlist from files. Edges reflect shown imports/calls or README-documented HTTP behavior; some experiment and data wiring is documented but not visible in the excerpts.

Main entry points: [`frontend/src/App.tsx`](https://github.com/cataragamihai/apa_course_project/blob/main/frontend/src/App.tsx) (App workflow), [`backend/app/main.py`](https://github.com/cataragamihai/apa_course_project/blob/main/backend/app/main.py) (FastAPI endpoints), [`backend/app/cracking/dictionary_attack.py`](https://github.com/cataragamihai/apa_course_project/blob/main/backend/app/cracking/dictionary_attack.py) (Dictionary attack), [`backend/app/cracking/brute_force.py`](https://github.com/cataragamihai/apa_course_project/blob/main/backend/app/cracking/brute_force.py) (Brute-force search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_app["App workflow<br/>[App.tsx]"]
  node_mission["Mission selection<br/>[MissionSelect.tsx]"]
  node_ciphertext["Transmission view<br/>[Ciphertext.tsx]"]
  node_algorithm_panel["Algorithm controls<br/>[AlgorithmPanel.tsx]"]
  node_archive_ui["Archive mode<br/>[ArchiveMode.tsx]"]
end

subgraph group_service["API and data"]
  node_api_client["HTTP client<br/>[api.ts]"]
  node_backend_api["FastAPI endpoints<br/>[main.py]"]
  node_archive_data["Message archive"]
  node_wordlist["Candidate wordlist<br/>[wordlist.txt]"]
end

subgraph group_analysis["Cryptanalysis"]
  node_brute["Brute-force search<br/>[brute_force.py]"]
  node_dictionary["Dictionary attack"]
  node_frequency["Frequency analysis"]
  node_cipher["Vigenère cipher<br/>[cipher.py]"]
  node_scoring["English scoring<br/>[scoring.py]"]
end

subgraph group_presentation["Results and localization"]
  node_progress_i18n["Backend progress text<br/>[i18n.py]"]
  node_results["Results and charts<br/>[ResultsTable.tsx]"]
  node_comparison["Comparison chart"]
  node_language["Language context"]
  node_translations["UI translations<br/>[translations.ts]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_mission
node_app -->|"renders"| node_ciphertext
node_app -->|"renders"| node_algorithm_panel
node_app -->|"loads"| node_archive_ui
node_app -->|"renders"| node_results
node_app -->|"loads"| node_comparison
node_app -->|"provides"| node_language
node_mission -->|"fetches messages"| node_api_client
node_ciphertext -->|"requests reveal"| node_api_client
node_algorithm_panel -->|"runs via callbacks"| node_app
node_app -->|"streams cracks"| node_api_client
node_archive_ui -->|"runs archive"| node_api_client
node_api_client -->|"HTTP requests"| node_backend_api
node_backend_api -->|"reads archive"| node_archive_data
node_backend_api -->|"loads candidates"| node_wordlist
node_backend_api -->|"dispatches"| node_brute
node_backend_api -->|"dispatches"| node_dictionary
node_backend_api -->|"dispatches"| node_frequency
node_brute -->|"decrypts candidates"| node_cipher
node_brute -->|"scores candidates"| node_scoring
node_dictionary -->|"decrypts candidates"| node_cipher
node_dictionary -->|"scores candidates"| node_scoring
node_dictionary -.->|"tests words"| node_wordlist
node_frequency -->|"extracts and decrypts"| node_cipher
node_frequency -->|"scores shifts"| node_scoring
node_brute -->|"formats progress"| node_progress_i18n
node_dictionary -->|"formats progress"| node_progress_i18n
node_frequency -->|"formats progress"| node_progress_i18n
node_language -->|"selects copy"| node_translations
node_results -->|"reads translations"| node_language
node_archive_ui -->|"reads translations"| node_language
node_backend_api -->|"runs text-length experiments"| node_frequency
node_backend_api -->|"runs key-length experiments"| node_brute

click node_app "https://github.com/cataragamihai/apa_course_project/blob/main/frontend/src/App.tsx"
click node_mission "https://github.com/cataragamihai/apa_course_project/blob/main/frontend/src/components/MissionSelect.tsx"
click node_ciphertext "https://github.com/cataragamihai/apa_course_project/blob/main/frontend/src/components/Ciphertext.tsx"
click node_algorithm_panel "https://github.com/cataragamihai/apa_course_project/blob/main/frontend/src/components/AlgorithmPanel.tsx"
click node_archive_ui "https://github.com/cataragamihai/apa_course_project/blob/main/frontend/src/components/ArchiveMode.tsx"
click node_api_client "https://github.com/cataragamihai/apa_course_project/blob/main/frontend/src/api.ts"
click node_backend_api "https://github.com/cataragamihai/apa_course_project/blob/main/backend/app/main.py"
click node_archive_data "https://github.com/cataragamihai/apa_course_project/tree/main/backend/app/data"
click node_wordlist "https://github.com/cataragamihai/apa_course_project/blob/main/backend/app/data/wordlist.txt"
click node_brute "https://github.com/cataragamihai/apa_course_project/blob/main/backend/app/cracking/brute_force.py"
click node_dictionary "https://github.com/cataragamihai/apa_course_project/blob/main/backend/app/cracking/dictionary_attack.py"
click node_frequency "https://github.com/cataragamihai/apa_course_project/blob/main/backend/app/cracking/frequency_analysis.py"
click node_cipher "https://github.com/cataragamihai/apa_course_project/blob/main/backend/app/cipher.py"
click node_scoring "https://github.com/cataragamihai/apa_course_project/blob/main/backend/app/scoring.py"
click node_progress_i18n "https://github.com/cataragamihai/apa_course_project/blob/main/backend/app/i18n.py"
click node_results "https://github.com/cataragamihai/apa_course_project/blob/main/frontend/src/components/ResultsTable.tsx"
click node_comparison "https://github.com/cataragamihai/apa_course_project/blob/main/frontend/src/components/ComparisonChart.tsx"
click node_language "https://github.com/cataragamihai/apa_course_project/blob/main/frontend/src/i18n/LanguageContext.tsx"
click node_translations "https://github.com/cataragamihai/apa_course_project/blob/main/frontend/src/i18n/translations.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,node_mission,node_ciphertext,node_algorithm_panel,node_archive_ui,node_user toneBlue
class node_api_client,node_backend_api,node_archive_data,node_wordlist toneAmber
class node_brute,node_dictionary,node_frequency,node_cipher,node_scoring toneMint
class node_progress_i18n,node_results,node_comparison,node_language,node_translations toneRose
```

## Components

### User interface

- [App workflow](https://github.com/cataragamihai/apa_course_project/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Mission selection](https://github.com/cataragamihai/apa_course_project/blob/main/frontend/src/components/MissionSelect.tsx): `frontend/src/components/MissionSelect.tsx`
- [Transmission view](https://github.com/cataragamihai/apa_course_project/blob/main/frontend/src/components/Ciphertext.tsx): `frontend/src/components/Ciphertext.tsx`
- [Algorithm controls](https://github.com/cataragamihai/apa_course_project/blob/main/frontend/src/components/AlgorithmPanel.tsx): `frontend/src/components/AlgorithmPanel.tsx`
- [Archive mode](https://github.com/cataragamihai/apa_course_project/blob/main/frontend/src/components/ArchiveMode.tsx): `frontend/src/components/ArchiveMode.tsx`

### API and data

- [HTTP client](https://github.com/cataragamihai/apa_course_project/blob/main/frontend/src/api.ts): `frontend/src/api.ts`
- [FastAPI endpoints](https://github.com/cataragamihai/apa_course_project/blob/main/backend/app/main.py): `backend/app/main.py`
- [Message archive](https://github.com/cataragamihai/apa_course_project/tree/main/backend/app/data): `backend/app/data`
- [Candidate wordlist](https://github.com/cataragamihai/apa_course_project/blob/main/backend/app/data/wordlist.txt): `backend/app/data/wordlist.txt`

### Cryptanalysis

- [Brute-force search](https://github.com/cataragamihai/apa_course_project/blob/main/backend/app/cracking/brute_force.py): `backend/app/cracking/brute_force.py`
- [Dictionary attack](https://github.com/cataragamihai/apa_course_project/blob/main/backend/app/cracking/dictionary_attack.py): `backend/app/cracking/dictionary_attack.py`
- [Frequency analysis](https://github.com/cataragamihai/apa_course_project/blob/main/backend/app/cracking/frequency_analysis.py): `backend/app/cracking/frequency_analysis.py`
- [Vigenère cipher](https://github.com/cataragamihai/apa_course_project/blob/main/backend/app/cipher.py): `backend/app/cipher.py`
- [English scoring](https://github.com/cataragamihai/apa_course_project/blob/main/backend/app/scoring.py): `backend/app/scoring.py`

### Results and localization

- [Backend progress text](https://github.com/cataragamihai/apa_course_project/blob/main/backend/app/i18n.py): `backend/app/i18n.py`
- [Results and charts](https://github.com/cataragamihai/apa_course_project/blob/main/frontend/src/components/ResultsTable.tsx): `frontend/src/components/ResultsTable.tsx`
- [Comparison chart](https://github.com/cataragamihai/apa_course_project/blob/main/frontend/src/components/ComparisonChart.tsx): `frontend/src/components/ComparisonChart.tsx`
- [Language context](https://github.com/cataragamihai/apa_course_project/blob/main/frontend/src/i18n/LanguageContext.tsx): `frontend/src/i18n/LanguageContext.tsx`
- [UI translations](https://github.com/cataragamihai/apa_course_project/blob/main/frontend/src/i18n/translations.ts): `frontend/src/i18n/translations.ts`

### Other components

- **User**

## Connections

- User → App workflow: uses (evidence: `frontend/src/App.tsx`)
- App workflow → Mission selection: renders (evidence: `frontend/src/App.tsx`)
- App workflow → Transmission view: renders (evidence: `frontend/src/App.tsx`)
- App workflow → Algorithm controls: renders (evidence: `frontend/src/App.tsx`)
- App workflow → Archive mode: loads (evidence: `frontend/src/App.tsx`)
- App workflow → Results and charts: renders (evidence: `frontend/src/App.tsx`)
- App workflow → Comparison chart: loads (evidence: `frontend/src/App.tsx`)
- App workflow → Language context: provides (evidence: `frontend/src/App.tsx`)
- Mission selection → HTTP client: fetches messages (evidence: `frontend/src/components/MissionSelect.tsx`)
- Transmission view → HTTP client: requests reveal (evidence: `frontend/src/components/Ciphertext.tsx`)
- Algorithm controls → App workflow: runs via callbacks (evidence: `frontend/src/App.tsx`)
- App workflow → HTTP client: streams cracks (evidence: `frontend/src/App.tsx`)
- Archive mode → HTTP client: runs archive (evidence: `frontend/src/components/ArchiveMode.tsx`)
- HTTP client → FastAPI endpoints: HTTP requests (evidence: `README.md`)
- FastAPI endpoints → Message archive: reads archive (evidence: `README.md`)
- FastAPI endpoints → Candidate wordlist: loads candidates (evidence: `README.md`)
- FastAPI endpoints → Brute-force search: dispatches (evidence: `backend/app/main.py`)
- FastAPI endpoints → Dictionary attack: dispatches (evidence: `backend/app/main.py`)
- FastAPI endpoints → Frequency analysis: dispatches (evidence: `backend/app/main.py`)
- Brute-force search → Vigenère cipher: decrypts candidates (evidence: `backend/app/cracking/brute_force.py`)
- Brute-force search → English scoring: scores candidates (evidence: `backend/app/cracking/brute_force.py`)
- Dictionary attack → Vigenère cipher: decrypts candidates (evidence: `backend/app/cracking/dictionary_attack.py`)
- Dictionary attack → English scoring: scores candidates (evidence: `backend/app/cracking/dictionary_attack.py`)
- Dictionary attack → Candidate wordlist: tests words
- Frequency analysis → Vigenère cipher: extracts and decrypts (evidence: `backend/app/cracking/frequency_analysis.py`)
- Frequency analysis → English scoring: scores shifts (evidence: `backend/app/cracking/frequency_analysis.py`)
- Brute-force search → Backend progress text: formats progress (evidence: `backend/app/cracking/brute_force.py`)
- Dictionary attack → Backend progress text: formats progress (evidence: `backend/app/cracking/dictionary_attack.py`)
- Frequency analysis → Backend progress text: formats progress (evidence: `backend/app/cracking/frequency_analysis.py`)
- Language context → UI translations: selects copy (evidence: `frontend/src/i18n/LanguageContext.tsx`)
- Results and charts → Language context: reads translations (evidence: `frontend/src/components/ResultsTable.tsx`)
- Archive mode → Language context: reads translations (evidence: `frontend/src/components/ArchiveMode.tsx`)
- FastAPI endpoints → Frequency analysis: runs text-length experiments (evidence: `README.md`)
- FastAPI endpoints → Brute-force search: runs key-length experiments (evidence: `README.md`)
