# yyt6801/dict architecture

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

- Interactive diagram: https://gitdiagram.com/yyt6801/dict
- Repository: https://github.com/yyt6801/dict

## Overview

Dict is a text-backed English–Chinese dictionary exposed through a C++ HTTP server. The main workflow is a word-query request, URL parsing, dictionary lookup through the DLL, and an HTTP translation response; the server also forwards request details to a Python logging service. The README documents the lookup and logging capabilities, but dictionary and DLL implementation details were not sampled, so those relationships are based on the README rather than inspected code.

Main entry points: [`http_server1.cpp`](https://github.com/yyt6801/dict/blob/master/http_server1.cpp) (Request handler), [`TCP_socket_server.py`](https://github.com/yyt6801/dict/blob/master/TCP_socket_server.py) (Log receiver), [`test_dll.cpp`](https://github.com/yyt6801/dict/blob/master/test_dll.cpp) (Dictionary DLL), [`DICT`](https://github.com/yyt6801/dict/tree/master/DICT) (Dictionary text)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP query service"]
  node_server["HTTP listener<br/>[http_server1.cpp]"]
  node_handler["Request handler<br/>[http_server1.cpp]"]
  node_parser["Word URL parser<br/>[http_server1.cpp]"]
  node_response["HTTP translation<br/>[http_server1.cpp]"]
end

subgraph group_lookup["Dictionary lookup"]
  node_dll["Dictionary DLL<br/>[test_dll.cpp]"]
  node_dict[("Dictionary text")]
end

subgraph group_logging["Request logging"]
  node_logserver["Log receiver"]
  node_logfile[("Request log")]
end

node_user(("HTTP client"))

node_user -->|"sends query"| node_server
node_server -->|"dispatches request"| node_handler
node_handler -->|"parses URL"| node_parser
node_handler -->|"looks up word"| node_dll
node_dll -.->|"searches entries"| node_dict
node_handler -->|"sends translation"| node_response
node_handler -->|"forwards request"| node_logserver
node_server -->|"forwards client info"| node_logserver
node_logserver -->|"appends records"| node_logfile

click node_server "https://github.com/yyt6801/dict/blob/master/http_server1.cpp"
click node_handler "https://github.com/yyt6801/dict/blob/master/http_server1.cpp"
click node_parser "https://github.com/yyt6801/dict/blob/master/http_server1.cpp"
click node_response "https://github.com/yyt6801/dict/blob/master/http_server1.cpp"
click node_dll "https://github.com/yyt6801/dict/blob/master/test_dll.cpp"
click node_dict "https://github.com/yyt6801/dict/tree/master/DICT"
click node_logserver "https://github.com/yyt6801/dict/blob/master/TCP_socket_server.py"

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_server,node_handler,node_parser,node_response,node_user toneBlue
class node_dll,node_dict toneAmber
class node_logserver,node_logfile toneMint
```

## Components

### HTTP query service

- [HTTP listener](https://github.com/yyt6801/dict/blob/master/http_server1.cpp): `http_server1.cpp`
- [Request handler](https://github.com/yyt6801/dict/blob/master/http_server1.cpp): `http_server1.cpp`
- [Word URL parser](https://github.com/yyt6801/dict/blob/master/http_server1.cpp): `http_server1.cpp`
- [HTTP translation](https://github.com/yyt6801/dict/blob/master/http_server1.cpp): `http_server1.cpp`

### Dictionary lookup

- [Dictionary DLL](https://github.com/yyt6801/dict/blob/master/test_dll.cpp): `test_dll.cpp`
- [Dictionary text](https://github.com/yyt6801/dict/tree/master/DICT): `DICT`

### Request logging

- [Log receiver](https://github.com/yyt6801/dict/blob/master/TCP_socket_server.py): `TCP_socket_server.py`
- **Request log**

### Other components

- **HTTP client**

## Connections

- HTTP client → HTTP listener: sends query (evidence: `README.md`)
- HTTP listener → Request handler: dispatches request (evidence: `http_server1.cpp`)
- Request handler → Word URL parser: parses URL (evidence: `http_server1.cpp`)
- Request handler → Dictionary DLL: looks up word (evidence: `http_server1.cpp`)
- Dictionary DLL → Dictionary text: searches entries (evidence: `README.md`)
- Request handler → HTTP translation: sends translation (evidence: `http_server1.cpp`)
- Request handler → Log receiver: forwards request (evidence: `http_server1.cpp`)
- HTTP listener → Log receiver: forwards client info (evidence: `http_server1.cpp`)
- Log receiver → Request log: appends records (evidence: `TCP_socket_server.py`)
