# aceakira1017/aternos-afkbot architecture

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

- Interactive diagram: https://gitdiagram.com/aceakira1017/aternos-afkbot
- Repository: https://github.com/aceakira1017/aternos-afkbot

## Overview

#### Purpose and Entry Point
This is a Node.js AFK bot deployment for keeping an offline-mode Minecraft/Aternos server occupied. The process entry point is `index.js`; deployment is intended to run it as a long-lived Render web service.

#### Bot Runtime
`index.js` is the central runtime boundary: it loads connection settings, creates and maintains the Minecraft bot connection, and must expose or host enough HTTP behavior for the deployment platform to remain reachable. The Node dependency/runtime definition is in `package.json`.

Relevant paths: `index.js`, `package.json`

#### Minecraft Connection Configuration
`config.json` supplies server-specific connection inputs: target host/IP, port, bot username, and likely protocol version. This separates user-provided server identity from the bot runtime.

Relevant paths: `config.json`, `index.js`

#### Connection and AFK Lifecycle
The main control flow is: process startup → read configuration → connect bot to the target Minecraft server → keep the client present/active → handle disconnects or errors sufficiently for a hosted process to remain operational. Minecraft server compatibility, especially protocol version support, is a material operational boundary.

Relevant paths: `index.js`, `config.json`

#### Hosting Keep-Alive Boundary
The application is deployed as a web service on Render, not merely as a standalone bot process. Render can spin down idle free-tier services, so an external HTTP monitor is expected to periodically contact the service URL and keep the Node process available.

Relevant paths: `Procfile`, `package.json`, `index.js`

#### External Services and Constraints
- **Minecraft/Aternos:** destination server; requires `online-mode=false` according to the operating model.
- **Render:** hosts and runs the Node service.
- **UptimeRobot:** sends scheduled HTTP probes to prevent Render free-tier idling.
- **GitHub:** source/fork and deployment integration path.

#### Deployment Contract
The repository’s deployable unit is the Node process configured through `package.json` and potentially `Procfile`. User customization is limited primarily to `config.json`; code changes should preserve that configuration boundary and the HTTP reachability needed by external uptime monitoring.

Relevant paths: `package.json`, `Procfile`, `config.json`

Main entry points: [`index.js`](https://github.com/aceakira1017/aternos-afkbot/blob/main/index.js) (Bot Runtime), [`package.json`](https://github.com/aceakira1017/aternos-afkbot/blob/main/package.json) (Package Runtime), [`Procfile`](https://github.com/aceakira1017/aternos-afkbot/blob/main/Procfile) (Process Declaration), [`config.json`](https://github.com/aceakira1017/aternos-afkbot/blob/main/config.json) (Connection Config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_repo["Node Bot Service"]
  node_package["Package Runtime<br/>Node manifest<br/>[package.json]"]
  node_procfile["Process Declaration<br/>host process config"]
  node_config["Connection Config<br/>server settings<br/>[config.json]"]
  node_runtime["Bot Runtime<br/>Node entry point<br/>[index.js]"]
  node_http["HTTP Keep-Alive Endpoint<br/>HTTP surface<br/>[index.js]"]
  node_connection["Minecraft Connection<br/>bot client lifecycle<br/>[index.js]"]
  node_afk["AFK Presence<br/>activity loop<br/>[index.js]"]
end

subgraph group_external["External Platforms"]
  node_github[("GitHub<br/>source hosting")]
  node_render{{"Render<br/>web-service host"}}
  node_uptimerobot(("UptimeRobot<br/>HTTP monitor"))
  node_minecraft{{"Minecraft / Aternos<br/>game server"}}
end

node_github -->|"deploy integration"| node_render
node_render -->|"runs Node service"| node_package
node_render -->|"uses process command"| node_procfile
node_package -->|"starts"| node_runtime
node_procfile -->|"declares process"| node_runtime
node_config -->|"loads settings"| node_runtime
node_runtime -->|"hosts"| node_http
node_runtime -->|"creates and maintains"| node_connection
node_connection -->|"maintains presence"| node_afk
node_connection -->|"connects using configured protocol"| node_minecraft
node_uptimerobot -->|"scheduled HTTP probes"| node_http

click node_package "https://github.com/aceakira1017/aternos-afkbot/blob/main/package.json"
click node_procfile "https://github.com/aceakira1017/aternos-afkbot/blob/main/Procfile"
click node_config "https://github.com/aceakira1017/aternos-afkbot/blob/main/config.json"
click node_runtime "https://github.com/aceakira1017/aternos-afkbot/blob/main/index.js"
click node_http "https://github.com/aceakira1017/aternos-afkbot/blob/main/index.js"
click node_connection "https://github.com/aceakira1017/aternos-afkbot/blob/main/index.js"
click node_afk "https://github.com/aceakira1017/aternos-afkbot/blob/main/index.js"

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_package,node_procfile,node_config,node_runtime,node_http,node_connection,node_afk toneBlue
class node_github,node_render,node_uptimerobot,node_minecraft toneAmber
```

## Components

### Node Bot Service

- [Package Runtime](https://github.com/aceakira1017/aternos-afkbot/blob/main/package.json): Node manifest · Defines dependencies and process startup contract. · `package.json`
- [Process Declaration](https://github.com/aceakira1017/aternos-afkbot/blob/main/Procfile): host process config · `Procfile`
- [Connection Config](https://github.com/aceakira1017/aternos-afkbot/blob/main/config.json): server settings · Provides host, port, username, and protocol version. · `config.json`
- [Bot Runtime](https://github.com/aceakira1017/aternos-afkbot/blob/main/index.js): Node entry point · Hosts HTTP reachability and manages the Minecraft bot lifecycle. · `index.js`
- [HTTP Keep-Alive Endpoint](https://github.com/aceakira1017/aternos-afkbot/blob/main/index.js): HTTP surface · Keeps the hosted web service reachable. · `index.js`
- [Minecraft Connection](https://github.com/aceakira1017/aternos-afkbot/blob/main/index.js): bot client lifecycle · Connects, stays active, and handles disconnects or errors. · `index.js`
- [AFK Presence](https://github.com/aceakira1017/aternos-afkbot/blob/main/index.js): activity loop · Keeps the bot present on the target server. · `index.js`

### External Platforms

- **GitHub**: source hosting · Fork and deployment integration source.
- **Render**: web-service host · Runs the long-lived Node web service.
- **UptimeRobot**: HTTP monitor · Periodically probes the service to prevent idling.
- **Minecraft / Aternos**: game server · Offline-mode destination server.

## Connections

- GitHub → Render: deploy integration
- Render → Package Runtime: runs Node service
- Render → Process Declaration: uses process command
- Package Runtime → Bot Runtime: starts
- Process Declaration → Bot Runtime: declares process
- Connection Config → Bot Runtime: loads settings
- Bot Runtime → HTTP Keep-Alive Endpoint: hosts
- Bot Runtime → Minecraft Connection: creates and maintains
- Minecraft Connection → AFK Presence: maintains presence
- Minecraft Connection → Minecraft / Aternos: connects using configured protocol
- UptimeRobot → HTTP Keep-Alive Endpoint: scheduled HTTP probes
