# hackerd-825/l3mon architecture

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

- Interactive diagram: https://gitdiagram.com/hackerd-825/l3mon
- Repository: https://github.com/hackerd-825/l3mon

## Overview

L3MON is a Node.js web dashboard and Android remote-management server. An administrator logs in, views device data, and can issue commands or configure GPS polling; connected Android clients send device information and telemetry over Socket.IO. Administrators can also configure and build a client APK. The source excerpts show the server entry point, routes, client manager, persistence, logging, and APK builder. Other device capabilities are documented in the README but their handlers are not fully sampled, so those links are documented rather than source-verified.

Main entry points: [`includes/expressRoutes.js`](https://github.com/hackerd-825/l3mon/blob/main/includes/expressRoutes.js) (Web Routes), [`includes/clientManager.js`](https://github.com/hackerd-825/l3mon/blob/main/includes/clientManager.js) (Client Manager), [`includes/apkBuilder.js`](https://github.com/hackerd-825/l3mon/blob/main/includes/apkBuilder.js) (APK Builder), [`index.js`](https://github.com/hackerd-825/l3mon/blob/main/index.js) (Server Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Admin Control"]
  node_server["Server Entry<br/>[index.js]"]
  node_routes["Web Routes<br/>[expressRoutes.js]"]
  node_dashboard["Dashboard Views"]
  node_config["Runtime Config<br/>[const.js]"]
end

subgraph group_device["Device Management"]
  node_clients["Client Manager<br/>[clientManager.js]"]
  node_commands["Command Dispatch<br/>[clientManager.js]"]
  node_telemetry["Device Telemetry<br/>[clientManager.js]"]
  node_devicefeatures["Device Capabilities"]
  node_maindb[("Admin Database<br/>[databaseGateway.js]")]
  node_clientdb[("Client Databases<br/>[databaseGateway.js]")]
  node_logs["Event Logs<br/>[logManager.js]"]
end

subgraph group_build["Client Build"]
  node_builder["APK Builder<br/>[apkBuilder.js]"]
  node_template["APK Template"]
  node_apk["Built APK"]
end

node_admin(("Administrator"))
node_client(("Android Client"))

node_admin -->|"uses dashboard"| node_routes
node_server -->|"mounts routes"| node_routes
node_server -->|"accepts connections"| node_clients
node_server -->|"configures ports"| node_config
node_routes -->|"checks login"| node_maindb
node_routes -->|"renders views"| node_dashboard
node_routes -->|"requests device data"| node_clients
node_routes -->|"starts build"| node_builder
node_client -->|"connects by socket"| node_server
node_clients -->|"records clients"| node_maindb
node_clients -->|"stores device data"| node_clientdb
node_clients -->|"dispatches commands"| node_commands
node_commands -.->|"sends commands"| node_client
node_client -.->|"sends telemetry"| node_telemetry
node_telemetry -->|"stores telemetry"| node_clientdb
node_clients -->|"records events"| node_logs
node_routes -->|"reads logs"| node_logs
node_admin -->|"configures build"| node_builder
node_builder -->|"uses build settings"| node_config
node_builder -->|"patches template"| node_template
node_builder -->|"builds artifact"| node_apk
node_devicefeatures -.->|"provides capabilities"| node_client

click node_server "https://github.com/hackerd-825/l3mon/blob/main/index.js"
click node_routes "https://github.com/hackerd-825/l3mon/blob/main/includes/expressRoutes.js"
click node_dashboard "https://github.com/hackerd-825/l3mon/tree/main/assets/views"
click node_config "https://github.com/hackerd-825/l3mon/blob/main/includes/const.js"
click node_clients "https://github.com/hackerd-825/l3mon/blob/main/includes/clientManager.js"
click node_commands "https://github.com/hackerd-825/l3mon/blob/main/includes/clientManager.js"
click node_telemetry "https://github.com/hackerd-825/l3mon/blob/main/includes/clientManager.js"
click node_devicefeatures "https://github.com/hackerd-825/l3mon/tree/main/app/factory/decompiled"
click node_maindb "https://github.com/hackerd-825/l3mon/blob/main/includes/databaseGateway.js"
click node_clientdb "https://github.com/hackerd-825/l3mon/blob/main/includes/databaseGateway.js"
click node_logs "https://github.com/hackerd-825/l3mon/blob/main/includes/logManager.js"
click node_builder "https://github.com/hackerd-825/l3mon/blob/main/includes/apkBuilder.js"
click node_template "https://github.com/hackerd-825/l3mon/tree/main/app/factory/decompiled"
click node_apk "https://github.com/hackerd-825/l3mon/tree/main/clientData"

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_routes,node_dashboard,node_config,node_client toneBlue
class node_clients,node_commands,node_telemetry,node_devicefeatures,node_maindb,node_clientdb,node_logs toneAmber
class node_builder,node_template,node_apk toneMint
class node_admin toneIndigo
```

## Components

### Admin Control

- [Server Entry](https://github.com/hackerd-825/l3mon/blob/main/index.js): `index.js`
- [Web Routes](https://github.com/hackerd-825/l3mon/blob/main/includes/expressRoutes.js): `includes/expressRoutes.js`
- [Dashboard Views](https://github.com/hackerd-825/l3mon/tree/main/assets/views): `assets/views`
- [Runtime Config](https://github.com/hackerd-825/l3mon/blob/main/includes/const.js): `includes/const.js`

### Device Management

- [Client Manager](https://github.com/hackerd-825/l3mon/blob/main/includes/clientManager.js): `includes/clientManager.js`
- [Command Dispatch](https://github.com/hackerd-825/l3mon/blob/main/includes/clientManager.js): `includes/clientManager.js`
- [Device Telemetry](https://github.com/hackerd-825/l3mon/blob/main/includes/clientManager.js): `includes/clientManager.js`
- [Device Capabilities](https://github.com/hackerd-825/l3mon/tree/main/app/factory/decompiled): `app/factory/decompiled`
- [Admin Database](https://github.com/hackerd-825/l3mon/blob/main/includes/databaseGateway.js): `includes/databaseGateway.js`
- [Client Databases](https://github.com/hackerd-825/l3mon/blob/main/includes/databaseGateway.js): `includes/databaseGateway.js`
- [Event Logs](https://github.com/hackerd-825/l3mon/blob/main/includes/logManager.js): `includes/logManager.js`

### Client Build

- [APK Builder](https://github.com/hackerd-825/l3mon/blob/main/includes/apkBuilder.js): `includes/apkBuilder.js`
- [APK Template](https://github.com/hackerd-825/l3mon/tree/main/app/factory/decompiled): `app/factory/decompiled`
- [Built APK](https://github.com/hackerd-825/l3mon/tree/main/clientData): `clientData`

### Other components

- **Administrator**
- **Android Client**

## Connections

- Administrator → Web Routes: uses dashboard (evidence: `README.md`)
- Server Entry → Web Routes: mounts routes (evidence: `index.js`)
- Server Entry → Client Manager: accepts connections (evidence: `index.js`)
- Server Entry → Runtime Config: configures ports (evidence: `index.js`)
- Web Routes → Admin Database: checks login (evidence: `includes/expressRoutes.js`)
- Web Routes → Dashboard Views: renders views (evidence: `includes/expressRoutes.js`)
- Web Routes → Client Manager: requests device data (evidence: `includes/expressRoutes.js`)
- Web Routes → APK Builder: starts build (evidence: `includes/expressRoutes.js`)
- Android Client → Server Entry: connects by socket (evidence: `index.js`)
- Client Manager → Admin Database: records clients (evidence: `includes/clientManager.js`)
- Client Manager → Client Databases: stores device data (evidence: `includes/clientManager.js`)
- Client Manager → Command Dispatch: dispatches commands (evidence: `includes/clientManager.js`)
- Command Dispatch → Android Client: sends commands
- Android Client → Device Telemetry: sends telemetry (evidence: `README.md`)
- Device Telemetry → Client Databases: stores telemetry (evidence: `includes/clientManager.js`)
- Client Manager → Event Logs: records events (evidence: `includes/clientManager.js`)
- Web Routes → Event Logs: reads logs (evidence: `includes/expressRoutes.js`)
- Administrator → APK Builder: configures build (evidence: `README.md`)
- APK Builder → Runtime Config: uses build settings (evidence: `includes/apkBuilder.js`)
- APK Builder → APK Template: patches template (evidence: `includes/apkBuilder.js`)
- APK Builder → Built APK: builds artifact
- Device Capabilities → Android Client: provides capabilities (evidence: `README.md`)
