# honoured-1-byte/coin architecture

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

- Interactive diagram: https://gitdiagram.com/honoured-1-byte/coin
- Repository: https://github.com/honoured-1-byte/coin

## Overview

C.O.I.N. is a web application for multi-agent LLM deliberation. Users authenticate, submit an inquiry, watch five specialized agents stream drafts, and receive a peer-ranked consensus verdict; they can revisit archived sessions and debrief an agent. The README documents the server’s map/reduce stages, Borda ranking, chairman synthesis, encrypted API-key handling, and MongoDB sessions. Backend internals are represented at the server entry-point level because no server source excerpt was provided; those relationships rely on README documentation.

Main entry points: [`client/src/pages/CouncilRoom.jsx`](https://github.com/honoured-1-byte/coin/blob/main/client/src/pages/CouncilRoom.jsx) (Council room), [`server/index.js`](https://github.com/honoured-1-byte/coin/blob/main/server/index.js) (Express API and auth), [`client/src/App.jsx`](https://github.com/honoured-1-byte/coin/blob/main/client/src/App.jsx) (Route shell), [`client/src/pages/Dashboard.jsx`](https://github.com/honoured-1-byte/coin/blob/main/client/src/pages/Dashboard.jsx) (Session dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Route shell<br/>[App.jsx]"]
  node_landing["Sign-in and registration<br/>[Landing.jsx]"]
  node_dashboard["Session dashboard<br/>[Dashboard.jsx]"]
  node_room["Council room<br/>[CouncilRoom.jsx]"]
  node_control["Inquiry controls<br/>[ControlPanel.jsx]"]
  node_agentcards["Agent draft cards<br/>[HoloCard.jsx]"]
  node_scoreboard["Council scoreboard"]
  node_verdict["Verdict display<br/>[VerdictDisplay.jsx]"]
  node_debrief["Agent debrief"]
  node_history["Session history<br/>[HistorySidebar.jsx]"]
  node_smarttext["Rich text renderer<br/>[SmartText.jsx]"]
end

subgraph group_server["API and security"]
  node_api["Express API and auth<br/>[index.js]"]
  node_sessions[("Session persistence<br/>[index.js]")]
end

subgraph group_reasoning["Council reasoning"]
  node_map["Parallel agent drafts<br/>[index.js]"]
  node_reduce["Peer ranking and synthesis<br/>[index.js]"]
end

subgraph group_integrations["External services"]
  node_groq["Groq inference"]
  node_mongo[("MongoDB")]
end

node_user(("User"))

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_room
node_landing -->|"authenticates via"| node_api
node_dashboard -->|"loads history"| node_api
node_dashboard -->|"opens session"| node_room
node_room -->|"renders"| node_control
node_room -->|"renders"| node_agentcards
node_room -->|"renders"| node_scoreboard
node_room -->|"renders"| node_verdict
node_room -->|"renders"| node_debrief
node_room -->|"renders"| node_history
node_control -->|"streams drafts"| node_api
node_debrief -->|"sends chat"| node_api
node_agentcards -->|"renders text"| node_smarttext
node_verdict -->|"renders text"| node_smarttext
node_api -->|"dispatches"| node_map
node_map -->|"requests inference"| node_groq
node_api -->|"runs reduce phase"| node_reduce
node_reduce -->|"requests judges and chairman"| node_groq
node_reduce -->|"stores results"| node_sessions
node_api -.->|"loads history"| node_sessions
node_sessions -->|"persists sessions"| node_mongo

click node_app "https://github.com/honoured-1-byte/coin/blob/main/client/src/App.jsx"
click node_landing "https://github.com/honoured-1-byte/coin/blob/main/client/src/pages/Landing.jsx"
click node_dashboard "https://github.com/honoured-1-byte/coin/blob/main/client/src/pages/Dashboard.jsx"
click node_room "https://github.com/honoured-1-byte/coin/blob/main/client/src/pages/CouncilRoom.jsx"
click node_control "https://github.com/honoured-1-byte/coin/blob/main/client/src/components/ControlPanel.jsx"
click node_agentcards "https://github.com/honoured-1-byte/coin/blob/main/client/src/components/HoloCard.jsx"
click node_scoreboard "https://github.com/honoured-1-byte/coin/blob/main/client/src/components/CouncilScoreboard.jsx"
click node_verdict "https://github.com/honoured-1-byte/coin/blob/main/client/src/components/VerdictDisplay.jsx"
click node_debrief "https://github.com/honoured-1-byte/coin/blob/main/client/src/components/DebriefInterface.jsx"
click node_history "https://github.com/honoured-1-byte/coin/blob/main/client/src/components/HistorySidebar.jsx"
click node_smarttext "https://github.com/honoured-1-byte/coin/blob/main/client/src/components/SmartText.jsx"
click node_api "https://github.com/honoured-1-byte/coin/blob/main/server/index.js"
click node_map "https://github.com/honoured-1-byte/coin/blob/main/server/index.js"
click node_reduce "https://github.com/honoured-1-byte/coin/blob/main/server/index.js"
click node_sessions "https://github.com/honoured-1-byte/coin/blob/main/server/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_app,node_landing,node_dashboard,node_room,node_control,node_agentcards,node_scoreboard,node_verdict,node_debrief,node_history,node_smarttext,node_user toneBlue
class node_api,node_sessions toneAmber
class node_map,node_reduce toneMint
class node_groq,node_mongo toneRose
```

## Components

### Web client

- [Route shell](https://github.com/honoured-1-byte/coin/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Sign-in and registration](https://github.com/honoured-1-byte/coin/blob/main/client/src/pages/Landing.jsx): `client/src/pages/Landing.jsx`
- [Session dashboard](https://github.com/honoured-1-byte/coin/blob/main/client/src/pages/Dashboard.jsx): `client/src/pages/Dashboard.jsx`
- [Council room](https://github.com/honoured-1-byte/coin/blob/main/client/src/pages/CouncilRoom.jsx): `client/src/pages/CouncilRoom.jsx`
- [Inquiry controls](https://github.com/honoured-1-byte/coin/blob/main/client/src/components/ControlPanel.jsx): `client/src/components/ControlPanel.jsx`
- [Agent draft cards](https://github.com/honoured-1-byte/coin/blob/main/client/src/components/HoloCard.jsx): `client/src/components/HoloCard.jsx`
- [Council scoreboard](https://github.com/honoured-1-byte/coin/blob/main/client/src/components/CouncilScoreboard.jsx): `client/src/components/CouncilScoreboard.jsx`
- [Verdict display](https://github.com/honoured-1-byte/coin/blob/main/client/src/components/VerdictDisplay.jsx): `client/src/components/VerdictDisplay.jsx`
- [Agent debrief](https://github.com/honoured-1-byte/coin/blob/main/client/src/components/DebriefInterface.jsx): `client/src/components/DebriefInterface.jsx`
- [Session history](https://github.com/honoured-1-byte/coin/blob/main/client/src/components/HistorySidebar.jsx): `client/src/components/HistorySidebar.jsx`
- [Rich text renderer](https://github.com/honoured-1-byte/coin/blob/main/client/src/components/SmartText.jsx): `client/src/components/SmartText.jsx`

### API and security

- [Express API and auth](https://github.com/honoured-1-byte/coin/blob/main/server/index.js): `server/index.js`
- [Session persistence](https://github.com/honoured-1-byte/coin/blob/main/server/index.js): `server/index.js`

### Council reasoning

- [Parallel agent drafts](https://github.com/honoured-1-byte/coin/blob/main/server/index.js): `server/index.js`
- [Peer ranking and synthesis](https://github.com/honoured-1-byte/coin/blob/main/server/index.js): `server/index.js`

### External services

- **Groq inference**
- **MongoDB**

### Other components

- **User**

## Connections

- User → Route shell: opens (evidence: `README.md`)
- Route shell → Sign-in and registration: routes to (evidence: `client/src/App.jsx`)
- Route shell → Session dashboard: routes to (evidence: `client/src/App.jsx`)
- Route shell → Council room: routes to (evidence: `client/src/App.jsx`)
- Sign-in and registration → Express API and auth: authenticates via (evidence: `README.md`)
- Session dashboard → Express API and auth: loads history (evidence: `client/src/pages/Dashboard.jsx`)
- Session dashboard → Council room: opens session (evidence: `client/src/pages/Dashboard.jsx`)
- Council room → Inquiry controls: renders (evidence: `client/src/pages/CouncilRoom.jsx`)
- Council room → Agent draft cards: renders (evidence: `client/src/pages/CouncilRoom.jsx`)
- Council room → Council scoreboard: renders (evidence: `client/src/pages/CouncilRoom.jsx`)
- Council room → Verdict display: renders (evidence: `client/src/pages/CouncilRoom.jsx`)
- Council room → Agent debrief: renders (evidence: `client/src/pages/CouncilRoom.jsx`)
- Council room → Session history: renders (evidence: `client/src/pages/CouncilRoom.jsx`)
- Inquiry controls → Express API and auth: streams drafts (evidence: `client/src/components/ControlPanel.jsx`)
- Agent debrief → Express API and auth: sends chat (evidence: `client/src/components/DebriefInterface.jsx`)
- Agent draft cards → Rich text renderer: renders text (evidence: `client/src/components/HoloCard.jsx`)
- Verdict display → Rich text renderer: renders text (evidence: `client/src/components/VerdictDisplay.jsx`)
- Express API and auth → Parallel agent drafts: dispatches (evidence: `README.md`)
- Parallel agent drafts → Groq inference: requests inference (evidence: `README.md`)
- Express API and auth → Peer ranking and synthesis: runs reduce phase (evidence: `README.md`)
- Peer ranking and synthesis → Groq inference: requests judges and chairman (evidence: `README.md`)
- Peer ranking and synthesis → Session persistence: stores results (evidence: `README.md`)
- Express API and auth → Session persistence: loads history (evidence: `server/index.js`)
- Session persistence → MongoDB: persists sessions (evidence: `README.md`)
