# howl-anderson/weatherbot architecture

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

- Interactive diagram: https://gitdiagram.com/howl-anderson/weatherbot
- Repository: https://github.com/howl-anderson/weatherbot

## Overview

##### Project type and purpose
- This is a Rasa‐based chatbot (“WeatherBot”) that answers Chinese weather queries.
- It’s architected as four isolated “micro‐apps” (UI, Dialog Manager, NLU, Action Server) that collaborate at runtime.

##### File structure
- The code for each component lives in its own repository, indicating a service‐oriented / microservices–like architecture rather than a monolith.

##### Extract key architecture details from the README
- Components:
- User Interface (WeatherBot_UI) – web frontend or any chat channel via Rasa Channels
- Dialog Manager (WeatherBot_Core) – Rasa Core for slot‐filling, story handling
- NLU (WeatherBot_NLU) – Rasa NLU for intent classification & entity extraction
- Action Server (WeatherBot_Action) – custom actions that call the external weather API
- External dependency: “心知天气” REST API
- Communication style: HTTP/REST (Rasa’s built‐in HTTP endpoints / webhooks)

##### Components & their interactions
a. User → UI
- UI sends user messages to Rasa Core via a Channel adapter (HTTP webhook).
b. Rasa Core (Dialog Manager)
- Receives message → calls Rasa NLU (HTTP) → gets intent/entities → runs dialogue policy →
- If a custom action is needed → invokes Action Server (HTTP) → Action Server calls weather API → returns weather data → Core constructs bot reply
c. Rasa Core → UI
- Core returns the reply to the UI via the same channel endpoint
d. External Service
- Action Server ↔ Weather API

##### Architectural patterns & principles
- Component isolation (microservices–style)
- Clear separation of concerns: NLU vs dialogue management vs business logic
- HTTP/REST interfaces between all components
- Slot–based frame dialogue management

##### Technologies / frameworks
- Rasa Core (Python)
- Rasa NLU (Python)
- Rasa Core SDK (Action Server, Python)
- Web frontend (any framework; in this repo it’s WeatherBot_UI, likely Node/React or Flask/Jinja)
- External Weather REST API (心知天气)
- Docker containers (recommended)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Entities and Services
    User["User"]:::external
    UI["WeatherBot_UI (UI)"]:::frontend
    Core["WeatherBot_Core (Dialog Manager)"]:::core
    NLU["WeatherBot_NLU (NLU)"]:::core
    Action["WeatherBot_Action (Action Server)"]:::action
    API["心知天气 API"]:::external

    %% Documentation
    README["Project Overview (README.md)"]:::docs
    ARCH["Architecture Diagrams (images/architecture.graffle)"]:::docs

    %% Data Flows
    User -->|"User message"| UI
    UI -->|"HTTP webhook (Rasa Channel)"| Core
    Core -->|"HTTP/REST parse"| NLU
    NLU -->|"Intent & entities"| Core
    Core -->|"Invoke custom action"| Action
    Action -->|"HTTP/REST call"| API
    API -->|"Weather data"| Action
    Action -->|"Action response"| Core
    Core -->|"Bot reply"| UI
    UI -->|"Display reply"| User

    %% Click Events
    click README "https://github.com/howl-anderson/weatherbot/blob/master/README.md"
    click ARCH "https://github.com/howl-anderson/weatherbot/blob/master/images/architecture.graffle"

    %% Styles
    classDef frontend fill:#D0E8F2,stroke:#000,stroke-width:1px
    classDef core fill:#D2F8D2,stroke:#000,stroke-width:1px
    classDef action fill:#FDE2B0,stroke:#000,stroke-width:1px
    classDef external fill:#E0E0E0,stroke:#000,stroke-dasharray: 2 2
    classDef docs fill:#F0F0F0,stroke:#888,stroke-dasharray: 2 2,stroke-width:1px
```
