# zoeaika/chatbot_buddy architecture

> Architecture diagram of the GitHub repository zoeaika/chatbot_buddy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zoeaika/chatbot_buddy
- Repository: https://github.com/zoeaika/chatbot_buddy

## Overview

##### Project type and purpose
- This is an open-source, rule-based chatbot CLI tool written in Python.
- Purpose: take user queries about cryptocurrencies and return advice based on sustainability, profitability, and market trends using predefined data and if-else rules.

##### File structure
- Top-level files:
- crypto_data.py – in-memory “database” of crypto metrics
- crypto_advisor.py – core chatbot logic and rule engine
- main.py – entry point that ties the CLI to the advisor logic
- test_bot.py – unit tests for conversation flows
- cryptobuddy (1).py – likely a duplicate or backup script (can be ignored or merged)
- No external services, no frameworks, purely built-in Python.

##### README for additional insights
- Architecture: monolithic, rule-based decision engine (if-else).
- Data: hard-coded list of crypto assets with sustainability and trend scores.
- Interaction pattern: user input → parsing → rule evaluation → formatted response.
- Future extension points: real-time API connectors, ML modules, GUI/web interface.

##### Essential elements to capture
- Clear labels: “CLI Handler”, “Rule Engine”, “Data Store”, “Test Harness”
- That the monolith runs as a single process

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["User"]:::external

    subgraph "Presentation Layer"
        CLI["CLI Handler"]:::io
    end

    subgraph "Business Logic Layer"
        Engine["Rule Engine"]:::logic
    end

    subgraph "Data Layer"
        DataStore["Data Store"]:::data
    end

    subgraph "Test Harness"
        Test["Test Harness"]:::test
    end

    subgraph "Future Extensions"
        API["API Connector Module"]:::future
        ML["ML Recommender Module"]:::future
        GUI["Web GUI"]:::future
    end

    User -->|enters query| CLI
    CLI -->|forwards query| Engine
    Engine -->|fetch metrics| DataStore
    DataStore -->|returns data| Engine
    Engine -->|produces response| CLI
    CLI -->|outputs response| User

    Test -.->|simulates flow| CLI
    Test -.->|simulates flow| Engine
    Test -.->|simulates flow| DataStore

    API -.->|future integration| DataStore
    ML -.->|future integration| Engine
    GUI -.->|future integration| CLI

    click CLI "https://github.com/zoeaika/chatbot_buddy/blob/main/main.py"
    click Engine "https://github.com/zoeaika/chatbot_buddy/blob/main/crypto_advisor.py"
    click DataStore "https://github.com/zoeaika/chatbot_buddy/blob/main/crypto_data.py"
    click Test "https://github.com/zoeaika/chatbot_buddy/blob/main/test_bot.py"

    classDef io fill:#fef2c0,stroke:#f5d442,stroke-width:2px
    classDef logic fill:#cce5ff,stroke:#66a3ff,stroke-width:2px
    classDef data fill:#d4edda,stroke:#3c763d,stroke-width:2px
    classDef test fill:#eeeeee,stroke:#999999,stroke-width:2px,stroke-dasharray: 4 2
    classDef future fill:#ffffff,stroke:#999999,stroke-width:2px,stroke-dasharray: 4 2
    classDef external fill:#ffffff,stroke:#000000,stroke-width:1px
```
