# galactickittenss/bards architecture

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

- Interactive diagram: https://gitdiagram.com/galactickittenss/bards
- Repository: https://github.com/galactickittenss/bards

## Overview

BARDS is a Python article-authoring and publishing server. Editors log in, create or edit article records, and preview them; public visitors browse a home page or published articles. The public server can run locally or as an AWS Lambda handler, with filesystem and S3 storage backends represented separately. Source excerpts do not show the Platform backend-selection wiring or all editor routes, so those connections are left out where uncertain.

Main entry points: [`bards/ArticleServer.py`](https://github.com/galactickittenss/bards/blob/main/bards/ArticleServer.py) (Public handler), [`editor.py`](https://github.com/galactickittenss/bards/blob/main/editor.py) (Editor handler), [`Assets/pages/editor`](https://github.com/galactickittenss/bards/tree/main/Assets/pages/editor) (Editor pages), [`bards/Article.py`](https://github.com/galactickittenss/bards/blob/main/bards/Article.py) (Article model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Authoring"]
  node_editor["Editor handler<br/>[editor.py]"]
  node_editor_ui["Editor pages"]
  node_editor_scripts["Editor scripts<br/>[editor.js]"]
  node_edit_script["Article editing script<br/>[edit_article.js]"]
end

subgraph group_publishing["Public publishing"]
  node_article_server["Public handler<br/>[ArticleServer.py]"]
  node_public_templates["Public templates"]
  node_site_assets["Site assets"]
  node_lambda_entry["Lambda handler<br/>[ArticleServer.py]"]
end

subgraph group_content["Article content"]
  node_article_model["Article model<br/>[Article.py]"]
  node_article_data[("Article records")]
  node_json_utils["JSON serialization<br/>[JsonUtils.py]"]
end

subgraph group_platform["Runtime and storage"]
  node_platform["Storage and server interface<br/>[Platform.py]"]
  node_http_server["Local HTTP server<br/>[Server.py]"]
  node_local_files[("Local file storage<br/>[FileUtils.py]")]
  node_aws_server["Lambda request server<br/>[Server.py]"]
  node_s3_files[("S3 storage<br/>[FileUtils.py]")]
  node_main["Local preview entry<br/>[main.py]"]
end

node_visitor(("Browser user"))
node_lambda_service(("AWS Lambda"))

node_visitor -->|"sends requests"| node_editor
node_editor -->|"serves pages"| node_editor_ui
node_editor_ui -->|"loads scripts"| node_editor_scripts
node_editor_ui -->|"loads script"| node_edit_script
node_editor -->|"loads and updates"| node_article_model
node_editor -->|"reads and writes"| node_article_data
node_editor -->|"renders pages"| node_editor_ui
node_visitor -->|"requests pages"| node_article_server
node_main -->|"starts preview"| node_article_server
node_article_server -->|"loads articles"| node_article_model
node_article_server -->|"lists and checks"| node_article_data
node_article_server -->|"renders pages"| node_public_templates
node_article_server -->|"serves resources"| node_site_assets
node_article_model -->|"serializes records"| node_json_utils
node_json_utils -->|"loads and saves"| node_article_data
node_lambda_service -.->|"invokes"| node_lambda_entry
node_lambda_entry -->|"dispatches request"| node_aws_server
node_http_server -->|"dispatches requests"| node_article_server

click node_editor "https://github.com/galactickittenss/bards/blob/main/editor.py"
click node_editor_ui "https://github.com/galactickittenss/bards/tree/main/Assets/pages/editor"
click node_editor_scripts "https://github.com/galactickittenss/bards/blob/main/Assets/scripts/editor.js"
click node_edit_script "https://github.com/galactickittenss/bards/blob/main/Assets/scripts/edit_article.js"
click node_article_server "https://github.com/galactickittenss/bards/blob/main/bards/ArticleServer.py"
click node_public_templates "https://github.com/galactickittenss/bards/tree/main/Assets/pages/templates"
click node_site_assets "https://github.com/galactickittenss/bards/tree/main/Assets"
click node_article_model "https://github.com/galactickittenss/bards/blob/main/bards/Article.py"
click node_article_data "https://github.com/galactickittenss/bards/tree/main/Articles"
click node_json_utils "https://github.com/galactickittenss/bards/blob/main/bards/JsonUtils.py"
click node_platform "https://github.com/galactickittenss/bards/blob/main/bards/Platform.py"
click node_http_server "https://github.com/galactickittenss/bards/blob/main/bards/http_server/Server.py"
click node_local_files "https://github.com/galactickittenss/bards/blob/main/bards/http_server/FileUtils.py"
click node_aws_server "https://github.com/galactickittenss/bards/blob/main/bards/aws/Server.py"
click node_s3_files "https://github.com/galactickittenss/bards/blob/main/bards/aws/FileUtils.py"
click node_main "https://github.com/galactickittenss/bards/blob/main/main.py"
click node_lambda_entry "https://github.com/galactickittenss/bards/blob/main/bards/ArticleServer.py"

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_editor,node_editor_ui,node_editor_scripts,node_edit_script,node_visitor toneBlue
class node_article_server,node_public_templates,node_site_assets,node_lambda_entry toneAmber
class node_article_model,node_article_data,node_json_utils toneMint
class node_platform,node_http_server,node_local_files,node_aws_server,node_s3_files,node_main toneRose
class node_lambda_service toneIndigo
```

## Components

### Authoring

- [Editor handler](https://github.com/galactickittenss/bards/blob/main/editor.py): `editor.py`
- [Editor pages](https://github.com/galactickittenss/bards/tree/main/Assets/pages/editor): `Assets/pages/editor`
- [Editor scripts](https://github.com/galactickittenss/bards/blob/main/Assets/scripts/editor.js): `Assets/scripts/editor.js`
- [Article editing script](https://github.com/galactickittenss/bards/blob/main/Assets/scripts/edit_article.js): `Assets/scripts/edit_article.js`

### Public publishing

- [Public handler](https://github.com/galactickittenss/bards/blob/main/bards/ArticleServer.py): `bards/ArticleServer.py`
- [Public templates](https://github.com/galactickittenss/bards/tree/main/Assets/pages/templates): `Assets/pages/templates`
- [Site assets](https://github.com/galactickittenss/bards/tree/main/Assets): `Assets`
- [Lambda handler](https://github.com/galactickittenss/bards/blob/main/bards/ArticleServer.py): `bards/ArticleServer.py`

### Article content

- [Article model](https://github.com/galactickittenss/bards/blob/main/bards/Article.py): `bards/Article.py`
- [Article records](https://github.com/galactickittenss/bards/tree/main/Articles): `Articles`
- [JSON serialization](https://github.com/galactickittenss/bards/blob/main/bards/JsonUtils.py): `bards/JsonUtils.py`

### Runtime and storage

- [Storage and server interface](https://github.com/galactickittenss/bards/blob/main/bards/Platform.py): `bards/Platform.py`
- [Local HTTP server](https://github.com/galactickittenss/bards/blob/main/bards/http_server/Server.py): `bards/http_server/Server.py`
- [Local file storage](https://github.com/galactickittenss/bards/blob/main/bards/http_server/FileUtils.py): `bards/http_server/FileUtils.py`
- [Lambda request server](https://github.com/galactickittenss/bards/blob/main/bards/aws/Server.py): `bards/aws/Server.py`
- [S3 storage](https://github.com/galactickittenss/bards/blob/main/bards/aws/FileUtils.py): `bards/aws/FileUtils.py`
- [Local preview entry](https://github.com/galactickittenss/bards/blob/main/main.py): `main.py`

### Other components

- **Browser user**
- **AWS Lambda**

## Connections

- Browser user → Editor handler: sends requests
- Editor handler → Editor pages: serves pages
- Editor pages → Editor scripts: loads scripts
- Editor pages → Article editing script: loads script
- Editor handler → Article model: loads and updates
- Editor handler → Article records: reads and writes
- Editor handler → Editor pages: renders pages
- Browser user → Public handler: requests pages
- Local preview entry → Public handler: starts preview
- Public handler → Article model: loads articles
- Public handler → Article records: lists and checks
- Public handler → Public templates: renders pages
- Public handler → Site assets: serves resources
- Article model → JSON serialization: serializes records
- JSON serialization → Article records: loads and saves
- AWS Lambda → Lambda handler: invokes
- Lambda handler → Lambda request server: dispatches request
- Local HTTP server → Public handler: dispatches requests
