# termidy/ccar-f-practice architecture

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

- Interactive diagram: https://gitdiagram.com/termidy/ccar-f-practice
- Repository: https://github.com/termidy/ccar-f-practice

## Overview

This repository is course practice material, not one integrated ShopAssist application: learners run independent lesson scripts or use offline notebooks that simulate the Claude SDK. The main documented paths cover chat, extraction and validation, tool use, and agent patterns; evaluation and Claude Code exercises are separate capabilities. Edges reflect README-documented execution or the explicit validation import; source excerpts do not establish broader runtime connections.

Main entry points: [`shopassist/build_extract.py`](https://github.com/termidy/ccar-f-practice/blob/main/shopassist/build_extract.py) (Return extraction), [`shopassist/first_request.py`](https://github.com/termidy/ccar-f-practice/blob/main/shopassist/first_request.py) (First request), [`shopassist/conversation.py`](https://github.com/termidy/ccar-f-practice/blob/main/shopassist/conversation.py) (Conversation), [`shopassist/app.py`](https://github.com/termidy/ccar-f-practice/blob/main/shopassist/app.py) (Chat server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_practice["API practice scripts"]
  node_first["First request<br/>[first_request.py]"]
  node_conversation["Conversation<br/>[conversation.py]"]
  node_rules["Prompt and rules<br/>[rules.py]"]
  node_evaluate["Prompt evaluation<br/>[evaluate.py]"]
  node_toolcall["Tool calls<br/>[tool_call.py]"]
  node_extract["Structured extraction<br/>[extract.py]"]
  node_validate["Output validation<br/>[validate.py]"]
  node_build["Return extraction<br/>[build_extract.py]"]
  node_agentloop["Agent loop<br/>[agent_loop.py]"]
  node_toolerrors["Tool errors<br/>[tool_errors.py]"]
  node_mcp["MCP server<br/>[mcp_server.py]"]
  node_agent["Support agent<br/>[agent.py]"]
  node_coordinator["Coordinator<br/>[coordinator.py]"]
end

subgraph group_labs["Offline lab simulators"]
  node_labloop["Agent-loop lab<br/>[shopassist_lab.py]"]
  node_labchat["Chat-server lab<br/>[shopassist_lab.py]"]
  node_labconversation["Conversation lab<br/>[shopassist_lab.py]"]
  node_labcoordinator["Coordinator lab<br/>[shopassist_lab.py]"]
  node_labevaluation["Evaluation lab<br/>[shopassist_lab.py]"]
  node_labextract["Return-extraction lab<br/>[shopassist_lab.py]"]
  node_labfirst["First-request lab<br/>[shopassist_lab.py]"]
  node_labreview["Human-review lab<br/>[shopassist_lab.py]"]
  node_labsettings["Model-settings lab<br/>[shopassist_lab.py]"]
  node_labstructured["Structured-output lab<br/>[shopassist_lab.py]"]
  node_labsupport["Support-agent lab<br/>[shopassist_lab.py]"]
  node_labsystem["System-prompt lab<br/>[shopassist_lab.py]"]
  node_labtoolcall["Tool-call lab<br/>[shopassist_lab.py]"]
  node_labtoolerrors["Tool-errors lab<br/>[shopassist_lab.py]"]
  node_labvalidation["Validation lab<br/>[shopassist_lab.py]"]
end

subgraph group_interfaces["User interfaces"]
  node_chatapp["Chat server<br/>[app.py]"]
  node_chatui["Chat UI<br/>[index.html]"]
end

node_learner(("Learner"))
node_claude{{"Claude API"}}
node_emails["Sample emails"]

node_learner -->|"runs"| node_first
node_learner -->|"runs"| node_conversation
node_learner -->|"opens"| node_chatui
node_chatui -->|"talks to"| node_chatapp
node_learner -->|"runs"| node_rules
node_learner -->|"runs"| node_evaluate
node_learner -->|"runs"| node_toolcall
node_learner -->|"runs"| node_extract
node_learner -->|"runs"| node_validate
node_learner -->|"runs"| node_build
node_build -->|"reads"| node_emails
node_build -->|"imports"| node_validate
node_learner -->|"runs"| node_agentloop
node_learner -->|"runs"| node_toolerrors
node_learner -->|"runs"| node_mcp
node_learner -->|"runs"| node_agent
node_learner -->|"runs"| node_coordinator
node_first -->|"calls"| node_claude
node_conversation -->|"calls"| node_claude
node_chatapp -->|"uses"| node_claude
node_labloop -->|"practices"| node_learner
node_labchat -->|"practices"| node_learner
node_labconversation -->|"practices"| node_learner
node_labcoordinator -->|"practices"| node_learner
node_labevaluation -->|"practices"| node_learner
node_labextract -->|"practices"| node_learner
node_labfirst -->|"practices"| node_learner
node_labreview -->|"practices"| node_learner
node_labsettings -->|"practices"| node_learner
node_labstructured -->|"practices"| node_learner
node_labsupport -->|"practices"| node_learner
node_labsystem -->|"practices"| node_learner
node_labtoolcall -->|"practices"| node_learner
node_labtoolerrors -->|"practices"| node_learner
node_labvalidation -->|"practices"| node_learner

click node_first "https://github.com/termidy/ccar-f-practice/blob/main/shopassist/first_request.py"
click node_conversation "https://github.com/termidy/ccar-f-practice/blob/main/shopassist/conversation.py"
click node_chatapp "https://github.com/termidy/ccar-f-practice/blob/main/shopassist/app.py"
click node_chatui "https://github.com/termidy/ccar-f-practice/blob/main/shopassist/static/index.html"
click node_rules "https://github.com/termidy/ccar-f-practice/blob/main/shopassist/rules.py"
click node_evaluate "https://github.com/termidy/ccar-f-practice/blob/main/shopassist/evaluate.py"
click node_toolcall "https://github.com/termidy/ccar-f-practice/blob/main/shopassist/tool_call.py"
click node_extract "https://github.com/termidy/ccar-f-practice/blob/main/shopassist/extract.py"
click node_validate "https://github.com/termidy/ccar-f-practice/blob/main/shopassist/validate.py"
click node_build "https://github.com/termidy/ccar-f-practice/blob/main/shopassist/build_extract.py"
click node_agentloop "https://github.com/termidy/ccar-f-practice/blob/main/shopassist/agent_loop.py"
click node_toolerrors "https://github.com/termidy/ccar-f-practice/blob/main/shopassist/tool_errors.py"
click node_mcp "https://github.com/termidy/ccar-f-practice/blob/main/shopassist/mcp_server.py"
click node_agent "https://github.com/termidy/ccar-f-practice/blob/main/shopassist/agent.py"
click node_coordinator "https://github.com/termidy/ccar-f-practice/blob/main/shopassist/coordinator.py"
click node_labloop "https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_agentic_loop/shopassist_lab.py"
click node_labchat "https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_chat_server/shopassist_lab.py"
click node_labconversation "https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_conversation/shopassist_lab.py"
click node_labcoordinator "https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_coordinator/shopassist_lab.py"
click node_labevaluation "https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_evaluation/shopassist_lab.py"
click node_labextract "https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_extract_returns/shopassist_lab.py"
click node_labfirst "https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_first_request/shopassist_lab.py"
click node_labreview "https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_human_review/shopassist_lab.py"
click node_labsettings "https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_model_settings/shopassist_lab.py"
click node_labstructured "https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_structured_output/shopassist_lab.py"
click node_labsupport "https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_support_agent/shopassist_lab.py"
click node_labsystem "https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_system_prompt/shopassist_lab.py"
click node_labtoolcall "https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_tool_call/shopassist_lab.py"
click node_labtoolerrors "https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_tool_errors/shopassist_lab.py"
click node_labvalidation "https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_validation/shopassist_lab.py"
click node_emails "https://github.com/termidy/ccar-f-practice/tree/main/shopassist/emails"

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_first,node_conversation,node_rules,node_evaluate,node_toolcall,node_extract,node_validate,node_build,node_agentloop,node_toolerrors,node_mcp,node_agent,node_coordinator toneBlue
class node_labloop,node_labchat,node_labconversation,node_labcoordinator,node_labevaluation,node_labextract,node_labfirst,node_labreview,node_labsettings,node_labstructured,node_labsupport,node_labsystem,node_labtoolcall,node_labtoolerrors,node_labvalidation toneAmber
class node_chatapp,node_chatui,node_claude toneMint
class node_learner toneIndigo
class node_emails toneTeal
```

## Components

### API practice scripts

- [First request](https://github.com/termidy/ccar-f-practice/blob/main/shopassist/first_request.py): `shopassist/first_request.py`
- [Conversation](https://github.com/termidy/ccar-f-practice/blob/main/shopassist/conversation.py): `shopassist/conversation.py`
- [Prompt and rules](https://github.com/termidy/ccar-f-practice/blob/main/shopassist/rules.py): `shopassist/rules.py`
- [Prompt evaluation](https://github.com/termidy/ccar-f-practice/blob/main/shopassist/evaluate.py): `shopassist/evaluate.py`
- [Tool calls](https://github.com/termidy/ccar-f-practice/blob/main/shopassist/tool_call.py): `shopassist/tool_call.py`
- [Structured extraction](https://github.com/termidy/ccar-f-practice/blob/main/shopassist/extract.py): `shopassist/extract.py`
- [Output validation](https://github.com/termidy/ccar-f-practice/blob/main/shopassist/validate.py): `shopassist/validate.py`
- [Return extraction](https://github.com/termidy/ccar-f-practice/blob/main/shopassist/build_extract.py): `shopassist/build_extract.py`
- [Agent loop](https://github.com/termidy/ccar-f-practice/blob/main/shopassist/agent_loop.py): `shopassist/agent_loop.py`
- [Tool errors](https://github.com/termidy/ccar-f-practice/blob/main/shopassist/tool_errors.py): `shopassist/tool_errors.py`
- [MCP server](https://github.com/termidy/ccar-f-practice/blob/main/shopassist/mcp_server.py): `shopassist/mcp_server.py`
- [Support agent](https://github.com/termidy/ccar-f-practice/blob/main/shopassist/agent.py): `shopassist/agent.py`
- [Coordinator](https://github.com/termidy/ccar-f-practice/blob/main/shopassist/coordinator.py): `shopassist/coordinator.py`

### Offline lab simulators

- [Agent-loop lab](https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_agentic_loop/shopassist_lab.py): `labs/lab_agentic_loop/shopassist_lab.py`
- [Chat-server lab](https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_chat_server/shopassist_lab.py): `labs/lab_chat_server/shopassist_lab.py`
- [Conversation lab](https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_conversation/shopassist_lab.py): `labs/lab_conversation/shopassist_lab.py`
- [Coordinator lab](https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_coordinator/shopassist_lab.py): `labs/lab_coordinator/shopassist_lab.py`
- [Evaluation lab](https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_evaluation/shopassist_lab.py): `labs/lab_evaluation/shopassist_lab.py`
- [Return-extraction lab](https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_extract_returns/shopassist_lab.py): `labs/lab_extract_returns/shopassist_lab.py`
- [First-request lab](https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_first_request/shopassist_lab.py): `labs/lab_first_request/shopassist_lab.py`
- [Human-review lab](https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_human_review/shopassist_lab.py): `labs/lab_human_review/shopassist_lab.py`
- [Model-settings lab](https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_model_settings/shopassist_lab.py): `labs/lab_model_settings/shopassist_lab.py`
- [Structured-output lab](https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_structured_output/shopassist_lab.py): `labs/lab_structured_output/shopassist_lab.py`
- [Support-agent lab](https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_support_agent/shopassist_lab.py): `labs/lab_support_agent/shopassist_lab.py`
- [System-prompt lab](https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_system_prompt/shopassist_lab.py): `labs/lab_system_prompt/shopassist_lab.py`
- [Tool-call lab](https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_tool_call/shopassist_lab.py): `labs/lab_tool_call/shopassist_lab.py`
- [Tool-errors lab](https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_tool_errors/shopassist_lab.py): `labs/lab_tool_errors/shopassist_lab.py`
- [Validation lab](https://github.com/termidy/ccar-f-practice/blob/main/labs/lab_validation/shopassist_lab.py): `labs/lab_validation/shopassist_lab.py`

### User interfaces

- [Chat server](https://github.com/termidy/ccar-f-practice/blob/main/shopassist/app.py): `shopassist/app.py`
- [Chat UI](https://github.com/termidy/ccar-f-practice/blob/main/shopassist/static/index.html): `shopassist/static/index.html`

### Other components

- **Learner**
- **Claude API**
- [Sample emails](https://github.com/termidy/ccar-f-practice/tree/main/shopassist/emails): `shopassist/emails`

## Connections

- Learner → First request: runs (evidence: `README.md`)
- Learner → Conversation: runs (evidence: `README.md`)
- Learner → Chat UI: opens (evidence: `README.md`)
- Chat UI → Chat server: talks to (evidence: `README.md`)
- Learner → Prompt and rules: runs (evidence: `README.md`)
- Learner → Prompt evaluation: runs (evidence: `README.md`)
- Learner → Tool calls: runs (evidence: `README.md`)
- Learner → Structured extraction: runs (evidence: `README.md`)
- Learner → Output validation: runs (evidence: `README.md`)
- Learner → Return extraction: runs (evidence: `README.md`)
- Return extraction → Sample emails: reads (evidence: `README.md`)
- Return extraction → Output validation: imports (evidence: `shopassist/build_extract.py`)
- Learner → Agent loop: runs (evidence: `README.md`)
- Learner → Tool errors: runs (evidence: `README.md`)
- Learner → MCP server: runs (evidence: `README.md`)
- Learner → Support agent: runs (evidence: `README.md`)
- Learner → Coordinator: runs (evidence: `README.md`)
- First request → Claude API: calls (evidence: `README.md`)
- Conversation → Claude API: calls (evidence: `README.md`)
- Chat server → Claude API: uses (evidence: `README.md`)
- Agent-loop lab → Learner: practices (evidence: `README.md`)
- Chat-server lab → Learner: practices (evidence: `README.md`)
- Conversation lab → Learner: practices (evidence: `README.md`)
- Coordinator lab → Learner: practices (evidence: `README.md`)
- Evaluation lab → Learner: practices (evidence: `README.md`)
- Return-extraction lab → Learner: practices (evidence: `README.md`)
- First-request lab → Learner: practices (evidence: `README.md`)
- Human-review lab → Learner: practices (evidence: `README.md`)
- Model-settings lab → Learner: practices (evidence: `README.md`)
- Structured-output lab → Learner: practices (evidence: `README.md`)
- Support-agent lab → Learner: practices (evidence: `README.md`)
- System-prompt lab → Learner: practices (evidence: `README.md`)
- Tool-call lab → Learner: practices (evidence: `README.md`)
- Tool-errors lab → Learner: practices (evidence: `README.md`)
- Validation lab → Learner: practices (evidence: `README.md`)
