# ejajaka/vector architecture

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

- Interactive diagram: https://gitdiagram.com/ejajaka/vector
- Repository: https://github.com/ejajaka/vector

## Overview

Vector diagnoses natural-language cloud-infrastructure prompts before code generation: its rule-based engine identifies resources and controls, reports omissions and risky statements, and can produce security clauses for an improved prompt. The CLI also exposes verification, compliance, cloud-specific analysis, and optional semantic, coreference, and LLM reasoning modes. The README documents extension, web, web-app, Expo, Capacitor, and native Android clients. Client internals are only partly sampled, so their detailed runtime links are not inferred beyond documented engine use.

Main entry points: [`engine/src/analyzer.js`](https://github.com/ejajaka/vector/blob/main/engine/src/analyzer.js) (Prompt analyzer), [`engine/cli/vector-cli.js`](https://github.com/ejajaka/vector/blob/main/engine/cli/vector-cli.js) (CLI commands), [`engine/src/cloud-analysis.js`](https://github.com/ejajaka/vector/blob/main/engine/src/cloud-analysis.js) (Cloud analysis), [`ui/mobile-expo/App.js`](https://github.com/ejajaka/vector/blob/main/ui/mobile-expo/App.js) (Expo mobile app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_engine["Analysis engine"]
  node_core["Prompt analyzer<br/>[analyzer.js]"]
  node_taxonomy["Security taxonomy<br/>[taxonomy.js]"]
  node_cloud["Cloud analysis<br/>[cloud-analysis.js]"]
  node_cloudtax["Cloud controls<br/>[taxonomy-clouds.js]"]
  node_improve["Prompt improvement<br/>[analyzer.js]"]
  node_verify["Infrastructure checks<br/>[tfcheck.js]"]
  node_compliance["Compliance checks<br/>[compliance.js]"]
end

subgraph group_extensions["Analysis extensions"]
  node_deepnlp["Deep NLP<br/>[deep-nlp.js]"]
  node_coref["Coreference linking<br/>[coref-link.js]"]
  node_semantic["Semantic matching<br/>[semantic-embed.js]"]
  node_reasoning["LLM reasoning<br/>[llm-reasoning.js]"]
  node_deep["Optional deep scan<br/>[llm.js]"]
end

subgraph group_interfaces["User interfaces"]
  node_extension["Browser extension<br/>[popup.js]"]
end

subgraph group_mobile["Mobile clients"]
  node_expo["Expo mobile app<br/>[App.js]"]
  node_mobilehistory[("Mobile history<br/>[storage.js]")]
  node_capacitor["Capacitor client<br/>[app.js]"]
  node_android["Native Android"]
end

subgraph group_web["Web clients"]
  node_demo["Static web demo<br/>[app.js]"]
  node_webapp["React web app<br/>[App.tsx]"]
  node_history[("Web history<br/>[historyStorage.ts]")]
end

node_user(("Prompt author"))
node_cli["CLI commands<br/>[vector-cli.js]"]
node_ai{{"Configured AI service"}}

node_user -->|"enters prompt"| node_cli
node_cli -->|"analyzes"| node_core
node_cli -->|"runs cloud scan"| node_cloud
node_cli -->|"verifies output"| node_verify
node_cli -->|"checks standards"| node_compliance
node_cli -->|"requests reasoning"| node_reasoning
node_cli -->|"requests deep scan"| node_deep
node_core -->|"uses controls"| node_taxonomy
node_core -->|"uses semantic pass"| node_semantic
node_core -->|"builds clauses"| node_improve
node_cloud -->|"uses analysis"| node_core
node_cloud -->|"uses controls"| node_cloudtax
node_coref -->|"resolves references"| node_deepnlp
node_coref -->|"reanalyzes prompt"| node_core
node_reasoning -->|"calls configured model"| node_ai
node_deep -->|"calls hosted model"| node_ai
node_user -->|"uses"| node_extension
node_user -->|"uses"| node_demo
node_user -->|"uses"| node_webapp
node_user -->|"uses"| node_expo
node_user -->|"uses"| node_capacitor
node_user -->|"uses"| node_android
node_extension -->|"uses shared engine"| node_core
node_demo -->|"uses shared engine"| node_core
node_webapp -->|"uses shared engine"| node_core
node_expo -->|"uses shared engine"| node_core
node_capacitor -->|"wraps web client"| node_core
node_android -->|"uses shared engine"| node_core
node_webapp -.->|"stores analyses"| node_history
node_expo -->|"stores analyses"| node_mobilehistory

click node_cli "https://github.com/ejajaka/vector/blob/main/engine/cli/vector-cli.js"
click node_core "https://github.com/ejajaka/vector/blob/main/engine/src/analyzer.js"
click node_taxonomy "https://github.com/ejajaka/vector/blob/main/engine/src/taxonomy.js"
click node_cloud "https://github.com/ejajaka/vector/blob/main/engine/src/cloud-analysis.js"
click node_cloudtax "https://github.com/ejajaka/vector/blob/main/engine/src/taxonomy-clouds.js"
click node_improve "https://github.com/ejajaka/vector/blob/main/engine/src/analyzer.js"
click node_verify "https://github.com/ejajaka/vector/blob/main/engine/src/tfcheck.js"
click node_compliance "https://github.com/ejajaka/vector/blob/main/engine/src/compliance.js"
click node_deepnlp "https://github.com/ejajaka/vector/blob/main/engine/src/deep-nlp.js"
click node_coref "https://github.com/ejajaka/vector/blob/main/engine/src/coref-link.js"
click node_semantic "https://github.com/ejajaka/vector/blob/main/engine/src/semantic-embed.js"
click node_reasoning "https://github.com/ejajaka/vector/blob/main/engine/src/llm-reasoning.js"
click node_deep "https://github.com/ejajaka/vector/blob/main/engine/src/llm.js"
click node_extension "https://github.com/ejajaka/vector/blob/main/ui/extension/popup.js"
click node_demo "https://github.com/ejajaka/vector/blob/main/ui/web/app.js"
click node_webapp "https://github.com/ejajaka/vector/blob/main/ui/web-app/src/App.tsx"
click node_history "https://github.com/ejajaka/vector/blob/main/ui/web-app/src/services/historyStorage.ts"
click node_expo "https://github.com/ejajaka/vector/blob/main/ui/mobile-expo/App.js"
click node_mobilehistory "https://github.com/ejajaka/vector/blob/main/ui/mobile-expo/src/storage.js"
click node_capacitor "https://github.com/ejajaka/vector/blob/main/ui/mobile-native/www/app.js"

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_core,node_taxonomy,node_cloud,node_cloudtax,node_improve,node_verify,node_compliance toneBlue
class node_deepnlp,node_coref,node_semantic,node_reasoning,node_deep toneAmber
class node_extension toneMint
class node_expo,node_mobilehistory,node_capacitor,node_android toneRose
class node_demo,node_webapp,node_history,node_user,node_ai toneIndigo
class node_cli toneTeal
```

## Components

### Analysis engine

- [Prompt analyzer](https://github.com/ejajaka/vector/blob/main/engine/src/analyzer.js): `engine/src/analyzer.js`
- [Security taxonomy](https://github.com/ejajaka/vector/blob/main/engine/src/taxonomy.js): `engine/src/taxonomy.js`
- [Cloud analysis](https://github.com/ejajaka/vector/blob/main/engine/src/cloud-analysis.js): `engine/src/cloud-analysis.js`
- [Cloud controls](https://github.com/ejajaka/vector/blob/main/engine/src/taxonomy-clouds.js): `engine/src/taxonomy-clouds.js`
- [Prompt improvement](https://github.com/ejajaka/vector/blob/main/engine/src/analyzer.js): `engine/src/analyzer.js`
- [Infrastructure checks](https://github.com/ejajaka/vector/blob/main/engine/src/tfcheck.js): `engine/src/tfcheck.js`
- [Compliance checks](https://github.com/ejajaka/vector/blob/main/engine/src/compliance.js): `engine/src/compliance.js`

### Analysis extensions

- [Deep NLP](https://github.com/ejajaka/vector/blob/main/engine/src/deep-nlp.js): `engine/src/deep-nlp.js`
- [Coreference linking](https://github.com/ejajaka/vector/blob/main/engine/src/coref-link.js): `engine/src/coref-link.js`
- [Semantic matching](https://github.com/ejajaka/vector/blob/main/engine/src/semantic-embed.js): `engine/src/semantic-embed.js`
- [LLM reasoning](https://github.com/ejajaka/vector/blob/main/engine/src/llm-reasoning.js): `engine/src/llm-reasoning.js`
- [Optional deep scan](https://github.com/ejajaka/vector/blob/main/engine/src/llm.js): `engine/src/llm.js`

### User interfaces

- [Browser extension](https://github.com/ejajaka/vector/blob/main/ui/extension/popup.js): `ui/extension/popup.js`

### Mobile clients

- [Expo mobile app](https://github.com/ejajaka/vector/blob/main/ui/mobile-expo/App.js): `ui/mobile-expo/App.js`
- [Mobile history](https://github.com/ejajaka/vector/blob/main/ui/mobile-expo/src/storage.js): `ui/mobile-expo/src/storage.js`
- [Capacitor client](https://github.com/ejajaka/vector/blob/main/ui/mobile-native/www/app.js): `ui/mobile-native/www/app.js`
- **Native Android**

### Web clients

- [Static web demo](https://github.com/ejajaka/vector/blob/main/ui/web/app.js): `ui/web/app.js`
- [React web app](https://github.com/ejajaka/vector/blob/main/ui/web-app/src/App.tsx): `ui/web-app/src/App.tsx`
- [Web history](https://github.com/ejajaka/vector/blob/main/ui/web-app/src/services/historyStorage.ts): `ui/web-app/src/services/historyStorage.ts`

### Other components

- **Prompt author**
- [CLI commands](https://github.com/ejajaka/vector/blob/main/engine/cli/vector-cli.js): `engine/cli/vector-cli.js`
- **Configured AI service**

## Connections

- Prompt author → CLI commands: enters prompt (evidence: `README.md`)
- CLI commands → Prompt analyzer: analyzes (evidence: `engine/cli/vector-cli.js`)
- CLI commands → Cloud analysis: runs cloud scan (evidence: `engine/cli/vector-cli.js`)
- CLI commands → Infrastructure checks: verifies output (evidence: `engine/cli/vector-cli.js`)
- CLI commands → Compliance checks: checks standards (evidence: `engine/cli/vector-cli.js`)
- CLI commands → LLM reasoning: requests reasoning (evidence: `engine/cli/vector-cli.js`)
- CLI commands → Optional deep scan: requests deep scan (evidence: `engine/cli/vector-cli.js`)
- Prompt analyzer → Security taxonomy: uses controls (evidence: `engine/src/analyzer.js`)
- Prompt analyzer → Semantic matching: uses semantic pass (evidence: `engine/src/analyzer.js`)
- Prompt analyzer → Prompt improvement: builds clauses (evidence: `README.md`)
- Cloud analysis → Prompt analyzer: uses analysis (evidence: `engine/src/cloud-analysis.js`)
- Cloud analysis → Cloud controls: uses controls (evidence: `engine/src/cloud-analysis.js`)
- Coreference linking → Deep NLP: resolves references (evidence: `engine/src/coref-link.js`)
- Coreference linking → Prompt analyzer: reanalyzes prompt (evidence: `engine/src/coref-link.js`)
- LLM reasoning → Configured AI service: calls configured model (evidence: `engine/src/llm-reasoning.js`)
- Optional deep scan → Configured AI service: calls hosted model (evidence: `engine/src/llm.js`)
- Prompt author → Browser extension: uses (evidence: `README.md`)
- Prompt author → Static web demo: uses (evidence: `README.md`)
- Prompt author → React web app: uses (evidence: `README.md`)
- Prompt author → Expo mobile app: uses (evidence: `README.md`)
- Prompt author → Capacitor client: uses (evidence: `README.md`)
- Prompt author → Native Android: uses (evidence: `README.md`)
- Browser extension → Prompt analyzer: uses shared engine (evidence: `README.md`)
- Static web demo → Prompt analyzer: uses shared engine (evidence: `README.md`)
- React web app → Prompt analyzer: uses shared engine (evidence: `README.md`)
- Expo mobile app → Prompt analyzer: uses shared engine (evidence: `README.md`)
- Capacitor client → Prompt analyzer: wraps web client (evidence: `README.md`)
- Native Android → Prompt analyzer: uses shared engine (evidence: `README.md`)
- React web app → Web history: stores analyses
- Expo mobile app → Mobile history: stores analyses (evidence: `ui/mobile-expo/App.js`)
