# vizzaq23/interview-test architecture

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

- Interactive diagram: https://gitdiagram.com/vizzaq23/interview-test
- Repository: https://github.com/vizzaq23/interview-test

## Overview

This is a small TypeScript exercise for deterministically tagging diary entries. Its main workflow takes entries, checks transcript text for desire, intention, and goal keywords, and returns entries with replacement tags. The repository also includes CSV-backed mock-entry loading and a separate optional embedding helper; the README says tagging does not call an AI provider. The graph shows those as distinct capabilities. The sample runner and tests are excluded as exercise infrastructure; no connection from them to runtime components is inferred.

Main entry points: [`src/lib/mockData.ts`](https://github.com/vizzaq23/interview-test/blob/main/src/lib/mockData.ts) (Load mock entries), [`src/lib/sampleFunction.ts`](https://github.com/vizzaq23/interview-test/blob/main/src/lib/sampleFunction.ts) (Tag entries), [`src/lib/types.ts`](https://github.com/vizzaq23/interview-test/blob/main/src/lib/types.ts) (Entry schema), [`src/lib/openai.ts`](https://github.com/vizzaq23/interview-test/blob/main/src/lib/openai.ts) (Create embedding)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tagging["Tagging"]
  node_process_entries["Tag entries<br/>[sampleFunction.ts]"]
  node_voice_entry["Entry schema<br/>[types.ts]"]
end

subgraph group_mock_data["Mock data"]
  node_mock_loader["Load mock entries<br/>[mockData.ts]"]
  node_diary_csv["Diary CSV"]
end

subgraph group_embedding["Embedding helper"]
  node_embed_helper["Create embedding<br/>[openai.ts]"]
end

node_caller(("Entry caller"))
node_openai_service["OpenAI embeddings"]

node_caller -->|"submits entries"| node_process_entries
node_process_entries -->|"uses schema"| node_voice_entry
node_mock_loader -->|"reads rows"| node_diary_csv
node_mock_loader -->|"builds entries"| node_voice_entry
node_embed_helper -.->|"requests embeddings"| node_openai_service

click node_process_entries "https://github.com/vizzaq23/interview-test/blob/main/src/lib/sampleFunction.ts"
click node_voice_entry "https://github.com/vizzaq23/interview-test/blob/main/src/lib/types.ts"
click node_mock_loader "https://github.com/vizzaq23/interview-test/blob/main/src/lib/mockData.ts"
click node_diary_csv "https://github.com/vizzaq23/interview-test/blob/main/src/lib/Expanded_Diary_Entries.csv"
click node_embed_helper "https://github.com/vizzaq23/interview-test/blob/main/src/lib/openai.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_process_entries,node_voice_entry toneBlue
class node_mock_loader,node_diary_csv toneAmber
class node_embed_helper toneMint
class node_caller,node_openai_service toneIndigo
```

## Components

### Tagging

- [Tag entries](https://github.com/vizzaq23/interview-test/blob/main/src/lib/sampleFunction.ts): `src/lib/sampleFunction.ts`
- [Entry schema](https://github.com/vizzaq23/interview-test/blob/main/src/lib/types.ts): `src/lib/types.ts`

### Mock data

- [Load mock entries](https://github.com/vizzaq23/interview-test/blob/main/src/lib/mockData.ts): `src/lib/mockData.ts`
- [Diary CSV](https://github.com/vizzaq23/interview-test/blob/main/src/lib/Expanded_Diary_Entries.csv): `src/lib/Expanded_Diary_Entries.csv`

### Embedding helper

- [Create embedding](https://github.com/vizzaq23/interview-test/blob/main/src/lib/openai.ts): `src/lib/openai.ts`

### Other components

- **Entry caller**
- **OpenAI embeddings**

## Connections

- Entry caller → Tag entries: submits entries (evidence: `README.md`)
- Tag entries → Entry schema: uses schema (evidence: `src/lib/sampleFunction.ts`)
- Load mock entries → Diary CSV: reads rows (evidence: `src/lib/mockData.ts`)
- Load mock entries → Entry schema: builds entries (evidence: `src/lib/mockData.ts`)
- Create embedding → OpenAI embeddings: requests embeddings (evidence: `src/lib/openai.ts`)
