# reussio/discord-rich-presence architecture

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

- Interactive diagram: https://gitdiagram.com/reussio/discord-rich-presence
- Repository: https://github.com/reussio/discord-rich-presence

## Overview

The application reads JSON settings, validates them, builds a Discord Rich Presence activity, and sets it through Discord's local RPC connection. The README documents customization for text, images, buttons, timestamps, party size, visibility, and status updates; those feature branches are represented within the activity builder. Source excerpts show the main control flow, but do not establish separate runtime components for the documented features.

Main entry points: [`index.js`](https://github.com/reussio/discord-rich-presence/blob/main/index.js) (Application entry), [`config.json`](https://github.com/reussio/discord-rich-presence/blob/main/config.json) (JSON settings), [`validateConfig.js`](https://github.com/reussio/discord-rich-presence/blob/main/validateConfig.js) (Config validation), [`createPresence.js`](https://github.com/reussio/discord-rich-presence/blob/main/createPresence.js) (Activity builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_configuration["Configuration"]
  node_configfile["JSON settings<br/>[config.json]"]
  node_validator["Config validation<br/>[validateConfig.js]"]
end

subgraph group_presence["Presence construction"]
  node_builder["Activity builder<br/>[createPresence.js]"]
end

subgraph group_discord["Discord connection"]
  node_entry["Application entry<br/>[index.js]"]
end

node_user(("Operator"))
node_discordapp["Discord RPC"]

node_user -->|"edits settings"| node_configfile
node_entry -->|"reads JSON"| node_configfile
node_entry -->|"validates config"| node_validator
node_entry -->|"builds activity"| node_builder
node_entry -->|"sets activity"| node_discordapp

click node_configfile "https://github.com/reussio/discord-rich-presence/blob/main/config.json"
click node_validator "https://github.com/reussio/discord-rich-presence/blob/main/validateConfig.js"
click node_entry "https://github.com/reussio/discord-rich-presence/blob/main/index.js"
click node_builder "https://github.com/reussio/discord-rich-presence/blob/main/createPresence.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_configfile,node_validator toneBlue
class node_builder toneAmber
class node_entry toneMint
class node_user,node_discordapp toneIndigo
```

## Components

### Configuration

- [JSON settings](https://github.com/reussio/discord-rich-presence/blob/main/config.json): `config.json`
- [Config validation](https://github.com/reussio/discord-rich-presence/blob/main/validateConfig.js): `validateConfig.js`

### Presence construction

- [Activity builder](https://github.com/reussio/discord-rich-presence/blob/main/createPresence.js): `createPresence.js`

### Discord connection

- [Application entry](https://github.com/reussio/discord-rich-presence/blob/main/index.js): `index.js`

### Other components

- **Operator**
- **Discord RPC**

## Connections

- Operator → JSON settings: edits settings (evidence: `README.md`)
- Application entry → JSON settings: reads JSON (evidence: `index.js`)
- Application entry → Config validation: validates config (evidence: `index.js`)
- Application entry → Activity builder: builds activity (evidence: `index.js`)
- Application entry → Discord RPC: sets activity (evidence: `index.js`)
