# sussyback99/tollky architecture

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

- Interactive diagram: https://gitdiagram.com/sussyback99/tollky
- Repository: https://github.com/sussyback99/tollky

## Overview

Tollky is a browser-based community feed: visitors load shared content, browse communities, search and vote; registered users can create posts and communities, and delete their own posts. The single runtime module also handles account registration/login, client-side session and vote state, hash routing, and rendering. JSONBin is the remote record store; browser localStorage holds the current username and per-post votes. The repository has no README, so capabilities and relationships here are based on the sampled app.js only.

Main entry points: [`app.js`](https://github.com/sussyback99/tollky/blob/main/app.js) (App runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser application"]
  node_app["App runtime<br/>[app.js]"]
  node_routing["Hash routing<br/>[app.js]"]
end

subgraph group_content["Community content"]
  node_feed["Feed and search<br/>[app.js]"]
  node_community["Community browsing<br/>[app.js]"]
  node_postauthoring["Post authoring<br/>[app.js]"]
  node_voting["Post voting<br/>[app.js]"]
  node_postdeletion["Post deletion<br/>[app.js]"]
end

subgraph group_identity["Accounts and session"]
  node_auth["Registration and login<br/>[app.js]"]
  node_session["Session state<br/>[app.js]"]
end

subgraph group_persistence["Persistence"]
  node_remote[("JSONBin record")]
  node_browserstore[("Browser localStorage")]
end

node_visitor(("Visitor"))

node_visitor -->|"uses"| node_app
node_app -->|"loads and saves"| node_remote
node_app -->|"initializes and renders"| node_session
node_session -->|"reads and writes"| node_browserstore
node_app -->|"registers hash changes"| node_routing
node_routing -->|"selects community"| node_community
node_routing -->|"renders feed"| node_feed
node_app -->|"renders and searches"| node_feed
node_app -->|"creates communities"| node_community
node_app -->|"creates posts"| node_postauthoring
node_app -->|"handles votes"| node_voting
node_voting -->|"saves votes"| node_browserstore
node_app -->|"handles deletion"| node_postdeletion
node_app -->|"submits credentials"| node_auth
node_auth -->|"sets session"| node_session
node_auth -->|"saves new account"| node_remote
node_postauthoring -->|"persists posts"| node_remote
node_community -->|"persists communities"| node_remote
node_voting -->|"persists scores"| node_remote
node_postdeletion -->|"persists deletion"| node_remote

click node_app "https://github.com/sussyback99/tollky/blob/main/app.js"
click node_routing "https://github.com/sussyback99/tollky/blob/main/app.js"
click node_feed "https://github.com/sussyback99/tollky/blob/main/app.js"
click node_community "https://github.com/sussyback99/tollky/blob/main/app.js"
click node_postauthoring "https://github.com/sussyback99/tollky/blob/main/app.js"
click node_voting "https://github.com/sussyback99/tollky/blob/main/app.js"
click node_postdeletion "https://github.com/sussyback99/tollky/blob/main/app.js"
click node_auth "https://github.com/sussyback99/tollky/blob/main/app.js"
click node_session "https://github.com/sussyback99/tollky/blob/main/app.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_routing toneBlue
class node_feed,node_community,node_postauthoring,node_voting,node_postdeletion toneAmber
class node_auth,node_session toneMint
class node_remote,node_browserstore toneRose
class node_visitor toneIndigo
```

## Components

### Browser application

- [App runtime](https://github.com/sussyback99/tollky/blob/main/app.js): `app.js`
- [Hash routing](https://github.com/sussyback99/tollky/blob/main/app.js): `app.js`

### Community content

- [Feed and search](https://github.com/sussyback99/tollky/blob/main/app.js): `app.js`
- [Community browsing](https://github.com/sussyback99/tollky/blob/main/app.js): `app.js`
- [Post authoring](https://github.com/sussyback99/tollky/blob/main/app.js): `app.js`
- [Post voting](https://github.com/sussyback99/tollky/blob/main/app.js): `app.js`
- [Post deletion](https://github.com/sussyback99/tollky/blob/main/app.js): `app.js`

### Accounts and session

- [Registration and login](https://github.com/sussyback99/tollky/blob/main/app.js): `app.js`
- [Session state](https://github.com/sussyback99/tollky/blob/main/app.js): `app.js`

### Persistence

- **JSONBin record**
- **Browser localStorage**

### Other components

- **Visitor**

## Connections

- Visitor → App runtime: uses (evidence: `app.js`)
- App runtime → JSONBin record: loads and saves (evidence: `app.js`)
- App runtime → Session state: initializes and renders (evidence: `app.js`)
- Session state → Browser localStorage: reads and writes (evidence: `app.js`)
- App runtime → Hash routing: registers hash changes (evidence: `app.js`)
- Hash routing → Community browsing: selects community (evidence: `app.js`)
- Hash routing → Feed and search: renders feed (evidence: `app.js`)
- App runtime → Feed and search: renders and searches (evidence: `app.js`)
- App runtime → Community browsing: creates communities (evidence: `app.js`)
- App runtime → Post authoring: creates posts (evidence: `app.js`)
- App runtime → Post voting: handles votes (evidence: `app.js`)
- Post voting → Browser localStorage: saves votes (evidence: `app.js`)
- App runtime → Post deletion: handles deletion (evidence: `app.js`)
- App runtime → Registration and login: submits credentials (evidence: `app.js`)
- Registration and login → Session state: sets session (evidence: `app.js`)
- Registration and login → JSONBin record: saves new account (evidence: `app.js`)
- Post authoring → JSONBin record: persists posts (evidence: `app.js`)
- Community browsing → JSONBin record: persists communities (evidence: `app.js`)
- Post voting → JSONBin record: persists scores (evidence: `app.js`)
- Post deletion → JSONBin record: persists deletion (evidence: `app.js`)
