# 3obhan/mantech architecture

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

- Interactive diagram: https://gitdiagram.com/3obhan/mantech
- Repository: https://github.com/3obhan/mantech

## Overview

Mantech is a bilingual browser-based reasoning analyzer. Users choose a language, enter text, and Analyze dispatches it to local WebLLM or—optionally—Groq; the resulting fallacy explanations can be presented as an exam-style PDF and analysis history is retained in browser storage. The app also documents reference examples, informational pages, and feedback/support destinations. Edges reflect visible routing, calls, storage operations, or README claims; unsampled component behavior and connections are not inferred.

Main entry points: [`src/App.tsx`](https://github.com/3obhan/mantech/blob/main/src/App.tsx) (App router), [`src/components/Analyze.tsx`](https://github.com/3obhan/mantech/blob/main/src/components/Analyze.tsx) (Analyze workflow), [`src/webllmAnalyzer.ts`](https://github.com/3obhan/mantech/blob/main/src/webllmAnalyzer.ts) (Local WebLLM), [`src/groqAnalyzer.ts`](https://github.com/3obhan/mantech/blob/main/src/groqAnalyzer.ts) (Groq fallback)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["App and navigation"]
  node_app["App router<br/>[App.tsx]"]
  node_language["Language choice<br/>[LanguageSelect.tsx]"]
  node_home["Home<br/>[Home.tsx]"]
end

subgraph group_analysis["Reasoning analysis"]
  node_analyze["Analyze workflow<br/>[Analyze.tsx]"]
  node_webllm["Local WebLLM<br/>[webllmAnalyzer.ts]"]
  node_groq["Groq fallback<br/>[groqAnalyzer.ts]"]
  node_modelhost["Model distribution"]
  node_groqservice["Groq service"]
end

subgraph group_records["Results and records"]
  node_exam["Exam paper export<br/>[ExamPaper.tsx]"]
  node_history["Analysis history<br/>[History.tsx]"]
  node_state[("App state and storage<br/>[store.tsx]")]
end

subgraph group_reference["Guidance and engagement"]
  node_samples["Logic examples<br/>[Samples.tsx]"]
  node_spiritual["Spiritual feedback<br/>[Spiritual.tsx]"]
  node_about["About and privacy<br/>[About.tsx]"]
  node_translations["Bilingual text<br/>[i18n.ts]"]
end

node_user(("User"))

node_user -->|"opens"| node_app
node_app -->|"selects initially"| node_language
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_analyze
node_app -->|"routes to"| node_history
node_app -->|"routes to"| node_spiritual
node_app -->|"routes to"| node_about
node_app -->|"routes to"| node_samples
node_analyze -->|"runs analysis"| node_webllm
node_analyze -->|"runs fallback"| node_groq
node_webllm -->|"downloads models"| node_modelhost
node_groq -->|"sends text"| node_groqservice
node_analyze -.->|"exports PDF"| node_exam
node_history -->|"reads and deletes"| node_state
node_state -->|"persists history"| node_user

click node_app "https://github.com/3obhan/mantech/blob/main/src/App.tsx"
click node_language "https://github.com/3obhan/mantech/blob/main/src/components/LanguageSelect.tsx"
click node_home "https://github.com/3obhan/mantech/blob/main/src/components/Home.tsx"
click node_analyze "https://github.com/3obhan/mantech/blob/main/src/components/Analyze.tsx"
click node_webllm "https://github.com/3obhan/mantech/blob/main/src/webllmAnalyzer.ts"
click node_groq "https://github.com/3obhan/mantech/blob/main/src/groqAnalyzer.ts"
click node_exam "https://github.com/3obhan/mantech/blob/main/src/components/ExamPaper.tsx"
click node_history "https://github.com/3obhan/mantech/blob/main/src/components/History.tsx"
click node_state "https://github.com/3obhan/mantech/blob/main/src/store.tsx"
click node_samples "https://github.com/3obhan/mantech/blob/main/src/components/Samples.tsx"
click node_spiritual "https://github.com/3obhan/mantech/blob/main/src/components/Spiritual.tsx"
click node_about "https://github.com/3obhan/mantech/blob/main/src/components/About.tsx"
click node_translations "https://github.com/3obhan/mantech/blob/main/src/i18n.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_language,node_home,node_user toneBlue
class node_analyze,node_webllm,node_groq,node_modelhost,node_groqservice toneAmber
class node_exam,node_history,node_state toneMint
class node_samples,node_spiritual,node_about,node_translations toneRose
```

## Components

### App and navigation

- [App router](https://github.com/3obhan/mantech/blob/main/src/App.tsx): `src/App.tsx`
- [Language choice](https://github.com/3obhan/mantech/blob/main/src/components/LanguageSelect.tsx): `src/components/LanguageSelect.tsx`
- [Home](https://github.com/3obhan/mantech/blob/main/src/components/Home.tsx): `src/components/Home.tsx`

### Reasoning analysis

- [Analyze workflow](https://github.com/3obhan/mantech/blob/main/src/components/Analyze.tsx): `src/components/Analyze.tsx`
- [Local WebLLM](https://github.com/3obhan/mantech/blob/main/src/webllmAnalyzer.ts): `src/webllmAnalyzer.ts`
- [Groq fallback](https://github.com/3obhan/mantech/blob/main/src/groqAnalyzer.ts): `src/groqAnalyzer.ts`
- **Model distribution**
- **Groq service**

### Results and records

- [Exam paper export](https://github.com/3obhan/mantech/blob/main/src/components/ExamPaper.tsx): `src/components/ExamPaper.tsx`
- [Analysis history](https://github.com/3obhan/mantech/blob/main/src/components/History.tsx): `src/components/History.tsx`
- [App state and storage](https://github.com/3obhan/mantech/blob/main/src/store.tsx): `src/store.tsx`

### Guidance and engagement

- [Logic examples](https://github.com/3obhan/mantech/blob/main/src/components/Samples.tsx): `src/components/Samples.tsx`
- [Spiritual feedback](https://github.com/3obhan/mantech/blob/main/src/components/Spiritual.tsx): `src/components/Spiritual.tsx`
- [About and privacy](https://github.com/3obhan/mantech/blob/main/src/components/About.tsx): `src/components/About.tsx`
- [Bilingual text](https://github.com/3obhan/mantech/blob/main/src/i18n.ts): `src/i18n.ts`

### Other components

- **User**

## Connections

- User → App router: opens (evidence: `README.md`)
- App router → Language choice: selects initially (evidence: `src/App.tsx`)
- App router → Home: routes to (evidence: `src/App.tsx`)
- App router → Analyze workflow: routes to (evidence: `src/App.tsx`)
- App router → Analysis history: routes to (evidence: `src/App.tsx`)
- App router → Spiritual feedback: routes to (evidence: `src/App.tsx`)
- App router → About and privacy: routes to (evidence: `src/App.tsx`)
- App router → Logic examples: routes to (evidence: `src/App.tsx`)
- Analyze workflow → Local WebLLM: runs analysis (evidence: `src/components/Analyze.tsx`)
- Analyze workflow → Groq fallback: runs fallback (evidence: `src/components/Analyze.tsx`)
- Local WebLLM → Model distribution: downloads models (evidence: `README.md`)
- Groq fallback → Groq service: sends text (evidence: `README.md`)
- Analyze workflow → Exam paper export: exports PDF
- Analysis history → App state and storage: reads and deletes (evidence: `src/components/History.tsx`)
- App state and storage → User: persists history (evidence: `src/store.tsx`)
