# sdohuajia/arc-bot architecture

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

- Interactive diagram: https://gitdiagram.com/sdohuajia/arc-bot
- Repository: https://github.com/sdohuajia/arc-bot

## Overview

1. **Repository purpose**
   - This is a very small, single-purpose automation repo centered on `arc_daily.py`.
   - The repo appears to automate a recurring “daily” action for Arc, likely against the Arc web app or service, rather than providing a user-facing application.

2. **Main execution unit**
   - `arc_daily.py` is the only visible code entrypoint.
   - There is no sign of a multi-module package, server, or worker system; the architecture is essentially one script plus input files.

3. **Runtime and browser automation stack**
   - The bot uses **Python** with **Playwright**.
   - The README requires `playwright install chromium`, which indicates the automation runs in a bundled **Chromium** browser, not via direct HTTP calls alone.
   - The browser is likely the main execution environment for login/session handling and daily task execution.

4. **Operational flow**
   - The expected run sequence is:
     - install Python dependencies from `requirements.txt`
     - install Chromium for Playwright
     - execute `python arc_daily.py`
   - This suggests a local, operator-run job rather than a continuously running service.

5. **Input/configuration files**
   - `accounts.txt` likely provides account identifiers or login credentials for one or more Arc accounts.
   - `gmail_passes.txt` likely contains Gmail passwords or mailbox credentials, implying email-based verification, recovery, or account management.
   - `proxies.txt` suggests the bot can route traffic through one or more proxies.

6. **Data and control boundaries**
   - The main boundary is between **local files** and **external web services**.
   - The script reads plaintext lists from disk, then uses a browser session to interact with remote sites.
   - Proxy support indicates each browser session may be isolated by network identity.

7. **External systems involved**
   - **Arc service/site**: the primary target of automation.
   - **Gmail**: likely a secondary dependency if the bot needs email access for verification, sign-in, or recovery.
   - **Proxy infrastructure**: used to mediate outbound connections and possibly spread requests across IPs.

8. **Likely session model**
   - The script probably processes accounts one by one, opening browser instances or contexts per account.
   - Each account/session may be paired with a proxy entry, which is common when running many accounts or avoiding rate limits.

9. **Security and operational implications**
   - The plaintext credential files indicate a local, operator-managed setup with sensitive data stored on disk.
   - The architecture is optimized for simple batch automation, not for secure secret management or centralized orchestration.

10. **What a diagram should show**
   - A single Python automation script at the center.
   - Inputs from `accounts.txt`, `gmail_passes.txt`, and `proxies.txt`.
   - Playwright launching Chromium.
   - Outbound interactions to Arc and possibly Gmail, with optional proxy routing in between.
   - No backend service, database, queue, or API layer is evident from the repository layout.

Main entry points: [`arc_daily.py`](https://github.com/sdohuajia/arc-bot/blob/main/arc_daily.py) (Arc daily), [`README.md`](https://github.com/sdohuajia/arc-bot/blob/main/README.md) (README), [`requirements.txt`](https://github.com/sdohuajia/arc-bot/blob/main/requirements.txt) (Deps), [`accounts.txt`](https://github.com/sdohuajia/arc-bot/blob/main/accounts.txt) (Accounts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_local["Local repo"]
  node_readme["README<br/>usage docs<br/>[README.md]"]
  node_requirements["Deps<br/>[requirements.txt]"]
  node_accounts["Accounts<br/>account list<br/>[accounts.txt]"]
  node_gmail_passes["Gmail creds<br/>secret list<br/>[gmail_passes.txt]"]
  node_proxies["Proxies<br/>proxy list<br/>[proxies.txt]"]
end

subgraph group_runtime["Automation runtime"]
  node_arc_daily["Arc daily<br/>python script<br/>[arc_daily.py]"]
  node_playwright["Playwright<br/>browser automation"]
  node_chromium["Chromium<br/>browser"]
  node_session_loop(("Session loop<br/>account runner"))
  node_proxy_layer{{"Proxy routing<br/>network layer"}}
end

subgraph group_external["External services"]
  node_arc_site[("Arc site<br/>target service")]
  node_gmail[("Gmail<br/>email service")]
end

node_readme -->|"run"| node_arc_daily
node_readme -->|"install"| node_requirements
node_requirements -->|"provides"| node_playwright
node_accounts -->|"input"| node_arc_daily
node_gmail_passes -->|"input"| node_arc_daily
node_proxies -->|"input"| node_arc_daily
node_arc_daily -->|"orchestrates"| node_session_loop
node_session_loop -->|"drives"| node_playwright
node_playwright -->|"launches"| node_chromium
node_session_loop -->|"routes via"| node_proxy_layer
node_proxy_layer -->|"connects to"| node_arc_site
node_chromium -->|"interacts with"| node_arc_site
node_session_loop -.->|"may use"| node_gmail
node_arc_daily -->|"acts on"| node_arc_site

click node_readme "https://github.com/sdohuajia/arc-bot/blob/main/README.md"
click node_requirements "https://github.com/sdohuajia/arc-bot/blob/main/requirements.txt"
click node_accounts "https://github.com/sdohuajia/arc-bot/blob/main/accounts.txt"
click node_gmail_passes "https://github.com/sdohuajia/arc-bot/blob/main/gmail_passes.txt"
click node_proxies "https://github.com/sdohuajia/arc-bot/blob/main/proxies.txt"
click node_arc_daily "https://github.com/sdohuajia/arc-bot/blob/main/arc_daily.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_readme,node_requirements,node_accounts,node_gmail_passes,node_proxies toneBlue
class node_arc_daily,node_playwright,node_chromium,node_session_loop,node_proxy_layer toneAmber
class node_arc_site,node_gmail toneMint
```

## Components

### Local repo

Operator-run script and plaintext input files on disk

- [README](https://github.com/sdohuajia/arc-bot/blob/main/README.md): usage docs · Run instructions and setup notes · `README.md`
- [Deps](https://github.com/sdohuajia/arc-bot/blob/main/requirements.txt): python deps · Python packages needed to run the bot · `requirements.txt`
- [Accounts](https://github.com/sdohuajia/arc-bot/blob/main/accounts.txt): account list · Plaintext account identifiers or credentials · `accounts.txt`
- [Gmail creds](https://github.com/sdohuajia/arc-bot/blob/main/gmail_passes.txt): secret list · Email passwords or mailbox credentials · `gmail_passes.txt`
- [Proxies](https://github.com/sdohuajia/arc-bot/blob/main/proxies.txt): proxy list · Proxy endpoints for session routing · `proxies.txt`

### Automation runtime

Python process and browser automation stack

- [Arc daily](https://github.com/sdohuajia/arc-bot/blob/main/arc_daily.py): python script · Main automation entrypoint · `arc_daily.py`
- **Playwright**: browser automation · Automation library used to drive the browser
- **Chromium**: browser · Bundled browser launched by Playwright
- **Session loop**: account runner · Processes accounts one by one and manages per-account runs
- **Proxy routing**: network layer · Optional network identity layer for browser sessions

### External services

Remote sites and network infrastructure the script interacts with

- **Arc site**: target service · Primary remote service being automated
- **Gmail**: email service · Secondary service likely used for verification or recovery

## Connections

- README → Arc daily: run · Documents the main execution path
- README → Deps: install · Setup instructions for Python dependencies
- Deps → Playwright: provides · Declares the browser automation dependency
- Accounts → Arc daily: input · Account data consumed by the script
- Gmail creds → Arc daily: input · Email credentials consumed by the script
- Proxies → Arc daily: input · Proxy endpoints consumed by the script
- Arc daily → Session loop: orchestrates · Main script coordinates per-account execution
- Session loop → Playwright: drives · Uses the automation library to control sessions
- Playwright → Chromium: launches · Starts and manages browser instances
- Session loop → Proxy routing: routes via · Applies optional proxy settings per session
- Proxy routing → Arc site: connects to · Outbound traffic is mediated through proxies
- Chromium → Arc site: interacts with · Browser-based automation targets Arc
- Session loop → Gmail: may use · Secondary dependency for email access or verification
- Arc daily → Arc site: acts on · Primary remote target of the automation
