# gc2000/smarttender-ai architecture

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

- Interactive diagram: https://gitdiagram.com/gc2000/smarttender-ai
- Repository: https://github.com/gc2000/smarttender-ai

## Overview

SmartTender AI turns a buyer’s natural-language purchasing request into an editable, domain-specific tender, then supports review, export, and project management. App.tsx owns the main workflow and project state; Gemini-backed analysis and drafting use configurable templates and clauses. The README documents Word/Markdown export, status tracking, autosave, and responsive layout, though sampled excerpts do not show every implementation detail. Dashed links mark those documented but unsampled capabilities; the graph otherwise follows visible calls and rendering relationships.

Main entry points: [`App.tsx`](https://github.com/gc2000/smarttender-ai/blob/main/App.tsx) (Workflow coordinator), [`services/configManager.ts`](https://github.com/gc2000/smarttender-ai/blob/main/services/configManager.ts) (Configuration access), [`components/AnalysisPanel.tsx`](https://github.com/gc2000/smarttender-ai/blob/main/components/AnalysisPanel.tsx) (Analysis and editor), [`services/geminiService.ts`](https://github.com/gc2000/smarttender-ai/blob/main/services/geminiService.ts) (Draft generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Tender workflow"]
  node_app["Workflow coordinator<br/>[App.tsx]"]
  node_chat["Chat display<br/>[ChatBubble.tsx]"]
  node_analysis_ui["Analysis and editor<br/>[AnalysisPanel.tsx]"]
  node_types["Tender domain types<br/>[types.ts]"]
end

subgraph group_generation["Tender generation"]
  node_analysis["Requirement analysis<br/>[geminiService.ts]"]
  node_drafting["Draft generation<br/>[geminiService.ts]"]
  node_sme_review["SME review<br/>[geminiService.ts]"]
  node_templates["Domain templates<br/>[tenderTemplates.ts]"]
  node_clauses["Standard clauses<br/>[clauseLibrary.ts]"]
end

subgraph group_management["Project management"]
  node_saved_list["Saved projects"]
  node_tender_storage["Project persistence<br/>[tenderStorage.ts]"]
end

subgraph group_configuration["Configuration"]
  node_config_manager["Configuration access<br/>[configManager.ts]"]
  node_config_editor["Configuration editor<br/>[ConfigEditor.tsx]"]
end

node_buyer(("Buyer"))
node_gemini{{"Google Gemini"}}
node_local_storage[("Browser LocalStorage")]

node_buyer -->|"describes needs"| node_app
node_app -->|"renders messages"| node_chat
node_app -->|"analyzes conversation"| node_analysis
node_app -->|"requests review draft"| node_drafting
node_app -->|"requests SME review"| node_sme_review
node_app -->|"renders analysis"| node_analysis_ui
node_analysis_ui -->|"generates tender"| node_drafting
node_analysis_ui -->|"displays clauses"| node_clauses
node_analysis -->|"sends analysis"| node_gemini
node_drafting -->|"generates content"| node_gemini
node_sme_review -->|"requests review"| node_gemini
node_analysis -->|"loads template"| node_config_manager
node_drafting -->|"loads template and clauses"| node_config_manager
node_sme_review -->|"loads review rules"| node_config_manager
node_config_manager -->|"uses defaults"| node_templates
node_config_manager -->|"uses defaults"| node_clauses
node_app -->|"opens settings"| node_config_editor
node_config_editor -->|"reads and saves"| node_config_manager
node_app -->|"renders project list"| node_saved_list
node_app -->|"saves projects"| node_tender_storage
node_tender_storage -->|"reads and writes"| node_local_storage
node_app -.->|"edits and exports draft"| node_analysis_ui
node_app -.->|"autosaves projects"| node_tender_storage
node_app -.->|"tracks review status"| node_analysis_ui

click node_app "https://github.com/gc2000/smarttender-ai/blob/main/App.tsx"
click node_chat "https://github.com/gc2000/smarttender-ai/blob/main/components/ChatBubble.tsx"
click node_analysis_ui "https://github.com/gc2000/smarttender-ai/blob/main/components/AnalysisPanel.tsx"
click node_analysis "https://github.com/gc2000/smarttender-ai/blob/main/services/geminiService.ts"
click node_drafting "https://github.com/gc2000/smarttender-ai/blob/main/services/geminiService.ts"
click node_sme_review "https://github.com/gc2000/smarttender-ai/blob/main/services/geminiService.ts"
click node_templates "https://github.com/gc2000/smarttender-ai/blob/main/config/tenderTemplates.ts"
click node_clauses "https://github.com/gc2000/smarttender-ai/blob/main/config/clauseLibrary.ts"
click node_config_manager "https://github.com/gc2000/smarttender-ai/blob/main/services/configManager.ts"
click node_config_editor "https://github.com/gc2000/smarttender-ai/blob/main/components/ConfigEditor.tsx"
click node_saved_list "https://github.com/gc2000/smarttender-ai/blob/main/components/SavedTendersList.tsx"
click node_tender_storage "https://github.com/gc2000/smarttender-ai/blob/main/services/tenderStorage.ts"
click node_types "https://github.com/gc2000/smarttender-ai/blob/main/types.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_chat,node_analysis_ui,node_types toneBlue
class node_analysis,node_drafting,node_sme_review,node_templates,node_clauses,node_local_storage toneAmber
class node_saved_list,node_tender_storage toneMint
class node_config_manager,node_config_editor toneRose
class node_buyer,node_gemini toneIndigo
```

## Components

### Tender workflow

- [Workflow coordinator](https://github.com/gc2000/smarttender-ai/blob/main/App.tsx): `App.tsx`
- [Chat display](https://github.com/gc2000/smarttender-ai/blob/main/components/ChatBubble.tsx): `components/ChatBubble.tsx`
- [Analysis and editor](https://github.com/gc2000/smarttender-ai/blob/main/components/AnalysisPanel.tsx): `components/AnalysisPanel.tsx`
- [Tender domain types](https://github.com/gc2000/smarttender-ai/blob/main/types.ts): `types.ts`

### Tender generation

- [Requirement analysis](https://github.com/gc2000/smarttender-ai/blob/main/services/geminiService.ts): `services/geminiService.ts`
- [Draft generation](https://github.com/gc2000/smarttender-ai/blob/main/services/geminiService.ts): `services/geminiService.ts`
- [SME review](https://github.com/gc2000/smarttender-ai/blob/main/services/geminiService.ts): `services/geminiService.ts`
- [Domain templates](https://github.com/gc2000/smarttender-ai/blob/main/config/tenderTemplates.ts): `config/tenderTemplates.ts`
- [Standard clauses](https://github.com/gc2000/smarttender-ai/blob/main/config/clauseLibrary.ts): `config/clauseLibrary.ts`

### Project management

- [Saved projects](https://github.com/gc2000/smarttender-ai/blob/main/components/SavedTendersList.tsx): `components/SavedTendersList.tsx`
- [Project persistence](https://github.com/gc2000/smarttender-ai/blob/main/services/tenderStorage.ts): `services/tenderStorage.ts`

### Configuration

- [Configuration access](https://github.com/gc2000/smarttender-ai/blob/main/services/configManager.ts): `services/configManager.ts`
- [Configuration editor](https://github.com/gc2000/smarttender-ai/blob/main/components/ConfigEditor.tsx): `components/ConfigEditor.tsx`

### Other components

- **Buyer**
- **Google Gemini**
- **Browser LocalStorage**

## Connections

- Buyer → Workflow coordinator: describes needs (evidence: `README.md`)
- Workflow coordinator → Chat display: renders messages (evidence: `App.tsx`)
- Workflow coordinator → Requirement analysis: analyzes conversation (evidence: `App.tsx`)
- Workflow coordinator → Draft generation: requests review draft (evidence: `App.tsx`)
- Workflow coordinator → SME review: requests SME review (evidence: `App.tsx`)
- Workflow coordinator → Analysis and editor: renders analysis (evidence: `App.tsx`)
- Analysis and editor → Draft generation: generates tender (evidence: `components/AnalysisPanel.tsx`)
- Analysis and editor → Standard clauses: displays clauses (evidence: `components/AnalysisPanel.tsx`)
- Requirement analysis → Google Gemini: sends analysis (evidence: `services/geminiService.ts`)
- Draft generation → Google Gemini: generates content (evidence: `services/geminiService.ts`)
- SME review → Google Gemini: requests review (evidence: `services/geminiService.ts`)
- Requirement analysis → Configuration access: loads template (evidence: `services/geminiService.ts`)
- Draft generation → Configuration access: loads template and clauses (evidence: `services/geminiService.ts`)
- SME review → Configuration access: loads review rules (evidence: `services/geminiService.ts`)
- Configuration access → Domain templates: uses defaults (evidence: `services/configManager.ts`)
- Configuration access → Standard clauses: uses defaults (evidence: `services/configManager.ts`)
- Workflow coordinator → Configuration editor: opens settings (evidence: `App.tsx`)
- Configuration editor → Configuration access: reads and saves (evidence: `components/ConfigEditor.tsx`)
- Workflow coordinator → Saved projects: renders project list (evidence: `App.tsx`)
- Workflow coordinator → Project persistence: saves projects (evidence: `App.tsx`)
- Project persistence → Browser LocalStorage: reads and writes (evidence: `services/tenderStorage.ts`)
- Workflow coordinator → Analysis and editor: edits and exports draft (evidence: `README.md`)
- Workflow coordinator → Project persistence: autosaves projects (evidence: `README.md`)
- Workflow coordinator → Analysis and editor: tracks review status (evidence: `README.md`)
