# rnmz/amai architecture

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

- Interactive diagram: https://gitdiagram.com/rnmz/amai
- Repository: https://github.com/rnmz/amai

## Overview

Amai is a lightweight Markdown blog: readers browse articles and files, while administrators authenticate and create posts. Four Vue frontends provide Classic, Cyberpunk, Neo, and Y2K themes; the Go backend supplies the application server. The sampled frontend excerpts show bootstrap, shell, Markdown theming, and authentication setup. Backend handler, routing, and persistence files are indexed but their implementation excerpts were not provided, so backend relationships are left unverified rather than inferred.

Main entry points: [`amai-classic/src/router/index.ts`](https://github.com/rnmz/amai/blob/main/amai-classic/src/router/index.ts) (Page routing), [`app/config/routing.go`](https://github.com/rnmz/amai/blob/main/app/config/routing.go) (HTTP API), [`amai-classic/src/utils/marked-render.ts`](https://github.com/rnmz/amai/blob/main/amai-classic/src/utils/marked-render.ts) (Markdown rendering), [`amai-classic/src/App.vue`](https://github.com/rnmz/amai/blob/main/amai-classic/src/App.vue) (Classic app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web themes"]
  node_classic["Classic app<br/>[App.vue]"]
  node_cyber["Cyberpunk app<br/>[App.vue]"]
  node_neo["Neo app<br/>[App.vue]"]
  node_y2k["Y2K app<br/>[App.vue]"]
  node_bootstrap["Vue bootstrap<br/>[main.ts]"]
  node_routing["Page routing<br/>[index.ts]"]
end

subgraph group_content["Content experience"]
  node_articles["Article views<br/>[ArticlesView.vue]"]
  node_article["Article detail"]
  node_authoring["Post authoring"]
  node_markdown["Markdown rendering<br/>[marked-render.ts]"]
  node_filesview["File browsing<br/>[FilesView.vue]"]
end

subgraph group_identity["Authentication"]
  node_authstate["Auth state<br/>[auth.ts]"]
  node_authapi["Auth API<br/>[auth.ts]"]
  node_apiclient["API client<br/>[client.ts]"]
end

subgraph group_server["Go services"]
  node_api["HTTP API<br/>[routing.go]"]
  node_authhandler["Auth handlers<br/>[auth_handler.go]"]
  node_posthandler["Post handlers<br/>[post_handler.go]"]
  node_filehandler["File handlers<br/>[file_handler.go]"]
  node_authdomain["Auth logic<br/>[auth.go]"]
end

subgraph group_persistence["Persistence"]
  node_postdata[("Post data<br/>[Posts.go]")]
  node_filedata[("File data<br/>[File.go]")]
  node_dbconfig[("Database setup<br/>[db.go]")]
end

node_reader(("Reader / admin"))

node_reader -.->|"opens app"| node_bootstrap
node_bootstrap -->|"mounts"| node_classic
node_bootstrap -->|"checks auth"| node_authstate
node_classic -->|"initializes theme"| node_markdown
node_classic -->|"renders routes"| node_routing
node_cyber -.->|"initializes theme"| node_markdown
node_neo -.->|"initializes theme"| node_markdown
node_y2k -.->|"initializes theme"| node_markdown
node_reader -.->|"uses theme"| node_cyber
node_reader -.->|"uses theme"| node_neo
node_reader -.->|"uses theme"| node_y2k
node_routing -.->|"routes to"| node_articles
node_routing -.->|"routes to"| node_article
node_routing -.->|"routes to"| node_authoring
node_routing -.->|"routes to"| node_filesview
node_authstate -->|"calls"| node_authapi
node_authstate -->|"checks identity"| node_apiclient
node_apiclient -.->|"sends requests"| node_api
node_api -.->|"dispatches auth"| node_authhandler
node_api -.->|"dispatches posts"| node_posthandler
node_api -.->|"dispatches files"| node_filehandler
node_authhandler -.->|"delegates"| node_authdomain
node_posthandler -.->|"uses post data"| node_postdata
node_filehandler -.->|"uses file data"| node_filedata
node_postdata -.->|"uses connection"| node_dbconfig
node_filedata -.->|"uses connection"| node_dbconfig

click node_classic "https://github.com/rnmz/amai/blob/main/amai-classic/src/App.vue"
click node_cyber "https://github.com/rnmz/amai/blob/main/amai-cyber/src/App.vue"
click node_neo "https://github.com/rnmz/amai/blob/main/amai-neo/src/App.vue"
click node_y2k "https://github.com/rnmz/amai/blob/main/amai-y2k/src/App.vue"
click node_bootstrap "https://github.com/rnmz/amai/blob/main/amai-classic/src/main.ts"
click node_routing "https://github.com/rnmz/amai/blob/main/amai-classic/src/router/index.ts"
click node_articles "https://github.com/rnmz/amai/blob/main/amai-classic/src/views/ArticlesView.vue"
click node_article "https://github.com/rnmz/amai/blob/main/amai-classic/src/views/ArticlePageView.vue"
click node_authoring "https://github.com/rnmz/amai/blob/main/amai-classic/src/views/CreateArticleView.vue"
click node_markdown "https://github.com/rnmz/amai/blob/main/amai-classic/src/utils/marked-render.ts"
click node_filesview "https://github.com/rnmz/amai/blob/main/amai-classic/src/views/FilesView.vue"
click node_authstate "https://github.com/rnmz/amai/blob/main/amai-classic/src/stores/auth.ts"
click node_authapi "https://github.com/rnmz/amai/blob/main/amai-classic/src/api/auth.ts"
click node_apiclient "https://github.com/rnmz/amai/blob/main/amai-classic/src/api/client.ts"
click node_api "https://github.com/rnmz/amai/blob/main/app/config/routing.go"
click node_authhandler "https://github.com/rnmz/amai/blob/main/app/handler/auth_handler.go"
click node_posthandler "https://github.com/rnmz/amai/blob/main/app/handler/post_handler.go"
click node_filehandler "https://github.com/rnmz/amai/blob/main/app/handler/file_handler.go"
click node_authdomain "https://github.com/rnmz/amai/blob/main/app/auth/auth.go"
click node_postdata "https://github.com/rnmz/amai/blob/main/app/data/Posts.go"
click node_filedata "https://github.com/rnmz/amai/blob/main/app/data/File.go"
click node_dbconfig "https://github.com/rnmz/amai/blob/main/app/config/db.go"

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_classic,node_cyber,node_neo,node_y2k,node_bootstrap,node_routing toneBlue
class node_articles,node_article,node_authoring,node_markdown,node_filesview toneAmber
class node_authstate,node_authapi,node_apiclient toneMint
class node_api,node_authhandler,node_posthandler,node_filehandler,node_authdomain toneRose
class node_postdata,node_filedata,node_dbconfig,node_reader toneIndigo
```

## Components

### Web themes

- [Classic app](https://github.com/rnmz/amai/blob/main/amai-classic/src/App.vue): `amai-classic/src/App.vue`
- [Cyberpunk app](https://github.com/rnmz/amai/blob/main/amai-cyber/src/App.vue): `amai-cyber/src/App.vue`
- [Neo app](https://github.com/rnmz/amai/blob/main/amai-neo/src/App.vue): `amai-neo/src/App.vue`
- [Y2K app](https://github.com/rnmz/amai/blob/main/amai-y2k/src/App.vue): `amai-y2k/src/App.vue`
- [Vue bootstrap](https://github.com/rnmz/amai/blob/main/amai-classic/src/main.ts): `amai-classic/src/main.ts`
- [Page routing](https://github.com/rnmz/amai/blob/main/amai-classic/src/router/index.ts): `amai-classic/src/router/index.ts`

### Content experience

- [Article views](https://github.com/rnmz/amai/blob/main/amai-classic/src/views/ArticlesView.vue): `amai-classic/src/views/ArticlesView.vue`
- [Article detail](https://github.com/rnmz/amai/blob/main/amai-classic/src/views/ArticlePageView.vue): `amai-classic/src/views/ArticlePageView.vue`
- [Post authoring](https://github.com/rnmz/amai/blob/main/amai-classic/src/views/CreateArticleView.vue): `amai-classic/src/views/CreateArticleView.vue`
- [Markdown rendering](https://github.com/rnmz/amai/blob/main/amai-classic/src/utils/marked-render.ts): `amai-classic/src/utils/marked-render.ts`
- [File browsing](https://github.com/rnmz/amai/blob/main/amai-classic/src/views/FilesView.vue): `amai-classic/src/views/FilesView.vue`

### Authentication

- [Auth state](https://github.com/rnmz/amai/blob/main/amai-classic/src/stores/auth.ts): `amai-classic/src/stores/auth.ts`
- [Auth API](https://github.com/rnmz/amai/blob/main/amai-classic/src/api/auth.ts): `amai-classic/src/api/auth.ts`
- [API client](https://github.com/rnmz/amai/blob/main/amai-classic/src/api/client.ts): `amai-classic/src/api/client.ts`

### Go services

- [HTTP API](https://github.com/rnmz/amai/blob/main/app/config/routing.go): `app/config/routing.go`
- [Auth handlers](https://github.com/rnmz/amai/blob/main/app/handler/auth_handler.go): `app/handler/auth_handler.go`
- [Post handlers](https://github.com/rnmz/amai/blob/main/app/handler/post_handler.go): `app/handler/post_handler.go`
- [File handlers](https://github.com/rnmz/amai/blob/main/app/handler/file_handler.go): `app/handler/file_handler.go`
- [Auth logic](https://github.com/rnmz/amai/blob/main/app/auth/auth.go): `app/auth/auth.go`

### Persistence

- [Post data](https://github.com/rnmz/amai/blob/main/app/data/Posts.go): `app/data/Posts.go`
- [File data](https://github.com/rnmz/amai/blob/main/app/data/File.go): `app/data/File.go`
- [Database setup](https://github.com/rnmz/amai/blob/main/app/config/db.go): `app/config/db.go`

### Other components

- **Reader / admin**

## Connections

- Reader / admin → Vue bootstrap: opens app
- Vue bootstrap → Classic app: mounts (evidence: `amai-classic/src/main.ts`)
- Vue bootstrap → Auth state: checks auth (evidence: `amai-classic/src/main.ts`)
- Classic app → Markdown rendering: initializes theme (evidence: `amai-classic/src/App.vue`)
- Classic app → Page routing: renders routes (evidence: `amai-classic/src/App.vue`)
- Cyberpunk app → Markdown rendering: initializes theme
- Neo app → Markdown rendering: initializes theme
- Y2K app → Markdown rendering: initializes theme
- Reader / admin → Cyberpunk app: uses theme
- Reader / admin → Neo app: uses theme
- Reader / admin → Y2K app: uses theme
- Page routing → Article views: routes to
- Page routing → Article detail: routes to
- Page routing → Post authoring: routes to
- Page routing → File browsing: routes to
- Auth state → Auth API: calls (evidence: `amai-classic/src/stores/auth.ts`)
- Auth state → API client: checks identity (evidence: `amai-classic/src/stores/auth.ts`)
- API client → HTTP API: sends requests
- HTTP API → Auth handlers: dispatches auth
- HTTP API → Post handlers: dispatches posts
- HTTP API → File handlers: dispatches files
- Auth handlers → Auth logic: delegates
- Post handlers → Post data: uses post data
- File handlers → File data: uses file data
- Post data → Database setup: uses connection
- File data → Database setup: uses connection
