# lmeszinc/azurlaneautoscript architecture

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

- Interactive diagram: https://gitdiagram.com/lmeszinc/azurlaneautoscript
- Repository: https://github.com/lmeszinc/azurlaneautoscript

## Overview

##### Project’s essence
- It is not a “typical” client–server full stack app; instead, it is an automation bot built to control a mobile game (Azur Lane) 24/7.
- The README explains multiple core features like “出击”, “收获”, “每日”, and “大世界” tasks plus advanced scheduling and mood control. This tells you that the system must manage concurrent task execution, timed scheduling, and state management for gameplay.
- The wide-ranging file tree shows a highly modular codebase that separates concerns among tasks, device control, campaign logic, configuration, GUI interfaces, deployment scripts, and even “submodules” bridging with external tools.

##### File structure for architectural insights
- Directories like “module/” contain many purpose-built submodules (campaign, combat, commission, device, config, map, etc.) that encapsulate the game automation logic.
- “deploy/” and “bin/” folders contain deployment and binary assets (e.g., Android APKs, device-specific tools, Docker-related files). This shows that the bot runs on different platforms and communicates with mobile devices via ADB, scrcpy, and other device methods.
- “webapp/” suggests there is also a web-based or electron-based GUI component.
- “dev_tools/” and “submodule/” provide utilities and bridges (e.g., AlasFpyBridge, AlasMaaBridge) that help extend functionality or interface with related projects.
- The presence of multiple internationalized asset directories (assets\cn, assets\en, etc.) along with i18n JSON files in “module/config/i18n” underscores support for multilingual interfaces.

##### Main system components
a. GUI/Front End:
- This as the user’s interaction entry point.

b. Scheduler / Task Management:
- A “Scheduler” component that receives tasks (for “科研”, “出击”, “收获”, etc.) and dispatches them based on timing and current game state.

c. Core Bot Modules:
- Core “module/” folder as a collection of submodules. Group them logically (for example, Campaign, Combat, Guild, Equipment, Event, Daily, MapDetection, etc.).

d. Device Interface and Communication:
- A “Device Management” or “Interface Layer” (covered in module/device along with methods for adb, scrcpy, etc.) showing how the system commands and receives feedback from emulators and real devices.
- This component to the core modules to represent that various tasks use these interfaces to interact with the game.

e. Configuration & I18n:
- That configuration information flows to the Scheduler and core task modules, affecting behavior (for example, mood thresholds and scheduling delays).

f. Deployment & External Utilities:
- External integration points such as Discord notifications and remote control.

##### Representing relationships and interactions
– User interactions via the GUI trigger the Scheduler.
– Scheduler dispatches tasks to the appropriate core modules (each task with distinct logic for different game features).
– Core modules use the Device Interface to command device interactions (and then receive status feedback that may go back to the Scheduler).
– Configuration is read by both the Scheduler and modules to manage parameters like timing delays and international settings.
– External Deployment components (Docker, Windows utilities, etc.) provide additional infrastructure support but are isolated from core task execution.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "User Interface"
        GUI1["Electron/Vue GUI"]:::gui
        GUI2["Python GUI (gui.py)"]:::gui
    end

    Scheduler["Scheduler/Task Manager"]:::scheduler
    Core["Core Bot Modules"]:::core
    Device["Device Interface (ADB/Scrcpy)"]:::device
    Config["Configuration & i18n"]:::config

    subgraph "Deployment & External Utilities"
        Deploy["Deployment Tools"]:::deploy
        DevTools["Dev Tools"]:::deploy
    end

    subgraph "External Integration"
        Bridge1["AlasFpyBridge"]:::external
        Bridge2["AlasMaaBridge"]:::external
    end

    GUI1 -->|"triggers"| Scheduler
    GUI2 -->|"triggers"| Scheduler
    Config -->|"configures"| Scheduler
    Config -->|"configures"| Core
    Scheduler -->|"dispatches"| Core
    Core -->|"commands"| Device
    Device -->|"feedback"| Scheduler
    Deploy ---|"support"| Scheduler
    DevTools ---|"support"| Scheduler
    Bridge1 ---|"integration"| Scheduler
    Bridge2 ---|"integration"| Scheduler

    click GUI1 "https://github.com/lmeszinc/azurlaneautoscript/tree/master/webapp/"
    click GUI2 "https://github.com/lmeszinc/azurlaneautoscript/blob/master/gui.py"
    click Scheduler "https://github.com/lmeszinc/azurlaneautoscript/blob/master/module/daemon/game_manager.py"
    click Core "https://github.com/lmeszinc/azurlaneautoscript/tree/master/module/"
    click Device "https://github.com/lmeszinc/azurlaneautoscript/tree/master/module/device/"
    click Config "https://github.com/lmeszinc/azurlaneautoscript/tree/master/module/config/"
    click Deploy "https://github.com/lmeszinc/azurlaneautoscript/tree/master/deploy/"
    click DevTools "https://github.com/lmeszinc/azurlaneautoscript/tree/master/dev_tools/"
    click Bridge1 "https://github.com/lmeszinc/azurlaneautoscript/tree/master/submodule/AlasFpyBridge"
    click Bridge2 "https://github.com/lmeszinc/azurlaneautoscript/tree/master/submodule/AlasMaaBridge"

    classDef gui fill:#87CEEB,stroke:#000,stroke-width:1px;
    classDef scheduler fill:#FFD700,stroke:#000,stroke-width:1px;
    classDef core fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef device fill:#FFA500,stroke:#000,stroke-width:1px;
    classDef config fill:#DA70D6,stroke:#000,stroke-width:1px;
    classDef deploy fill:#D3D3D3,stroke:#000,stroke-width:1px;
    classDef external fill:#FFC0CB,stroke:#000,stroke-width:1px;
```
