# anthropics/anthropic-quickstarts architecture

> Architecture diagram of the GitHub repository anthropics/anthropic-quickstarts, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anthropics/anthropic-quickstarts
- Repository: https://github.com/anthropics/anthropic-quickstarts

## Overview

##### High-Level Architecture Overview

- Customer Support Agent
- Financial Data Analyst
- Computer Use Demo

Each should be represented as a separate module with clear boundaries, as they are independent applications.

##### Individual Application Architecture

A. Customer Support Agent
- Frontend Layer:
- Next.js components (ChatArea, Sidebars, TopNavBar)
- UI components using shadcn/ui
- Backend Layer:
- API routes (/api/chat)
- Integration with Anthropic API
- Data Flow:
- Customer support categories (JSON)
- Chat state management

B. Financial Data Analyst
- Frontend Layer:
- Next.js components (ChartRenderer, FilePreview)
- UI components for data visualization
- Backend Layer:
- Finance API routes
- Data processing logic
- Data Flow:
- File handling utilities
- Chart rendering pipeline

C. Computer Use Demo
- Core Components:
- Python-based tools (bash.py, computer.py, edit.py)
- Streamlit interface
- Container Infrastructure:
- Docker environment
- VNC/NoVNC setup
- X11 display server
- Service Components:
- HTTP server
- Various startup scripts

##### Key Relationships to Highlight

- API Integration:
- How each application connects to the Anthropic API
- Authentication flow
- Data Flow:
- User interactions
- API requests/responses
- State management

##### Infrastructure Elements

Include:
- GitHub Actions workflows
- Docker containers (for Computer Use Demo)
- Development tools (.pre-commit-config.yaml)
- Testing infrastructure

##### Technical Stack Indicators

- Next.js/React
- TypeScript
- Python
- Docker
- Streamlit
- VNC/NoVNC

##### Specific Implementation Details

For each application, highlight unique features:
- Customer Support Agent:
- Chat interface
- Knowledge base integration
- Financial Data Analyst:
- Chart rendering
- File processing
- Computer Use Demo:
- Virtual desktop environment
- Tool integration

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Computer Use Demo"
        CUD_Core[Core Components]
        CUD_Infra[Container Infrastructure]
        CUD_Services[Services]
        
        subgraph "Core Tools"
            Bash["Bash Tool"]:::backend
            Computer["Computer Tool"]:::backend
            Edit["Edit Tool"]:::backend
        end
        
        subgraph "Infrastructure"
            Docker["Docker Container"]:::infra
            Entrypoint["Entrypoint Script"]:::infra
        end
        
        subgraph "Services"
            HttpServer["HTTP Server"]:::backend
            NoVNC["NoVNC Startup"]:::infra
            X11VNC["X11 VNC Startup"]:::infra
            Xvfb["Xvfb Startup"]:::infra
        end
        
        CUD_Core --> Bash & Computer & Edit
        CUD_Infra --> Docker & Entrypoint
        CUD_Services --> HttpServer & NoVNC & X11VNC & Xvfb
    end

    AnthropicAPI[Anthropic API]:::external
    CUD_Core --> AnthropicAPI

    classDef frontend fill:#3b82f6,color:white
    classDef backend fill:#22c55e,color:white
    classDef external fill:#eab308,color:white
    classDef infra fill:#6b7280,color:white

    click Bash "https://github.com/anthropics/anthropic-quickstarts/blob/main/computer-use-demo/computer_use_demo/tools/bash.py"
    click Computer "https://github.com/anthropics/anthropic-quickstarts/blob/main/computer-use-demo/computer_use_demo/tools/computer.py"
    click Edit "https://github.com/anthropics/anthropic-quickstarts/blob/main/computer-use-demo/computer_use_demo/tools/edit.py"
    click Docker "https://github.com/anthropics/anthropic-quickstarts/tree/main/computer-use-demo/Dockerfile"
    click Entrypoint "https://github.com/anthropics/anthropic-quickstarts/blob/main/computer-use-demo/image/entrypoint.sh"
    click HttpServer "https://github.com/anthropics/anthropic-quickstarts/blob/main/computer-use-demo/image/http_server.py"
    click NoVNC "https://github.com/anthropics/anthropic-quickstarts/blob/main/computer-use-demo/image/novnc_startup.sh"
    click X11VNC "https://github.com/anthropics/anthropic-quickstarts/blob/main/computer-use-demo/image/x11vnc_startup.sh"
    click Xvfb "https://github.com/anthropics/anthropic-quickstarts/blob/main/computer-use-demo/image/xvfb_startup.sh"
```
