# l1angk1ng/l1angk1ng_website architecture

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

- Interactive diagram: https://gitdiagram.com/l1angk1ng/l1angk1ng_website
- Repository: https://github.com/l1angk1ng/l1angk1ng_website

## Overview

This is a static Astro blog paired with a Node/Express CMS. The main workflow is administrator login → edit Markdown or site data → build and atomically publish a static release; visitors then browse the generated site and use its search, comments, and other interactive features. The README documents the overall deployment and capabilities, while the source index identifies major modules and some call relationships. Many frontend routes and admin subsystems were not excerpted, so their internal wiring is not inferred.

Main entry points: [`admin/server.mjs`](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/server.mjs) (Admin server), [`admin/lib/routes.mjs`](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/routes.mjs) (Feature API routes), [`admin/lib/store.mjs`](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/store.mjs) (Runtime JSON store), [`admin/lib/music.mjs`](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/music.mjs) (Music management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["CMS administration"]
  node_admin_server["Admin server<br/>[server.mjs]"]
  node_admin_ui["Admin interface<br/>[views.mjs]"]
  node_auth["Login and sessions<br/>[auth.mjs]"]
  node_content_admin["Content editing<br/>[content.mjs]"]
  node_preview["Markdown preview<br/>[preview.mjs]"]
  node_dynamic_routes["Feature API routes<br/>[routes.mjs]"]
  node_site_data["Site data management<br/>[site-data.mjs]"]
  node_comments_admin["Comment moderation<br/>[comments.mjs]"]
  node_projects_admin["Project management<br/>[projects.mjs]"]
  node_music_admin["Music management<br/>[music.mjs]"]
  node_stats_admin["Visit analytics<br/>[stats.mjs]"]
  node_safe_fetch["Safe outbound fetch<br/>[safe-fetch.mjs]"]
  node_geo["IP geolocation<br/>[geo.mjs]"]
end

subgraph group_publish["Publishing and storage"]
  node_build["Build and release<br/>[build.mjs]"]
  node_backup["Remote data backup<br/>[backup.mjs]"]
  node_runtime_store[("Runtime JSON store<br/>[store.mjs]")]
  node_markdown_source["Markdown content<br/>[content.config.ts]"]
end

subgraph group_web["Static blog"]
  node_static_site["Generated static site<br/>[index.astro]"]
  node_post_helpers["Post and note queries<br/>[posts.ts]"]
  node_site_content["Shared site content<br/>[site-content.ts]"]
  node_shortcodes["Legacy shortcode rendering"]
  node_search["Client-side search<br/>[search.astro]"]
  node_feed_map["RSS and sitemap<br/>[rss.xml.ts]"]
  node_projects_front["Project pages<br/>[index.astro]"]
end

subgraph group_engagement["Visitor features"]
  node_comments_front["Comments<br/>[comments.js]"]
  node_music_front["Music player<br/>[MusicPlayer.astro]"]
  node_public_api["Visitor feature API<br/>[routes.mjs]"]
end

node_administrator(("Administrator"))
node_visitor(("Visitor"))
node_external_music["Music providers"]

node_administrator -->|"uses"| node_admin_server
node_admin_server -->|"authenticates"| node_auth
node_admin_server -->|"renders"| node_admin_ui
node_admin_server -->|"handles content"| node_content_admin
node_admin_server -->|"starts build"| node_build
node_admin_server -->|"uses preview"| node_preview
node_admin_server -->|"mounts routes"| node_dynamic_routes
node_administrator -->|"edits Markdown"| node_content_admin
node_content_admin -->|"writes files"| node_markdown_source
node_preview -->|"converts shortcodes"| node_shortcodes
node_admin_server -->|"serves management"| node_site_data
node_dynamic_routes -->|"calls"| node_site_data
node_dynamic_routes -->|"calls"| node_comments_admin
node_dynamic_routes -->|"calls"| node_projects_admin
node_dynamic_routes -->|"calls"| node_music_admin
node_dynamic_routes -->|"calls"| node_stats_admin
node_site_data -->|"reads and writes"| node_runtime_store
node_comments_admin -->|"uses"| node_runtime_store
node_projects_admin -->|"uses"| node_runtime_store
node_music_admin -->|"reads and writes"| node_runtime_store
node_music_admin -->|"fetches remotely"| node_safe_fetch
node_geo -->|"fetches remotely"| node_safe_fetch
node_stats_admin -->|"looks up location"| node_geo
node_stats_admin -->|"uses"| node_runtime_store
node_build -->|"builds"| node_static_site
node_build -->|"backs up after publish"| node_backup
node_backup -->|"reads configuration"| node_runtime_store
node_backup -->|"mirrors content"| node_markdown_source
node_static_site -.->|"queries posts"| node_post_helpers
node_static_site -.->|"loads shared data"| node_site_content
node_static_site -->|"renders shortcodes"| node_shortcodes
node_visitor -->|"browses"| node_static_site
node_search -.->|"searches posts"| node_post_helpers
node_feed_map -->|"collects posts"| node_post_helpers
node_projects_front -.->|"loads project data"| node_site_content
node_visitor -->|"comments"| node_comments_front
node_comments_front -.->|"uses API"| node_public_api
node_visitor -->|"plays music"| node_music_front
node_music_front -.->|"requests playlist"| node_public_api
node_public_api -->|"resolves tracks"| node_music_admin
node_music_admin -->|"resolves playback"| node_external_music

click node_admin_server "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/server.mjs"
click node_admin_ui "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/views.mjs"
click node_auth "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/auth.mjs"
click node_content_admin "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/content.mjs"
click node_preview "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/preview.mjs"
click node_dynamic_routes "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/routes.mjs"
click node_site_data "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/site-data.mjs"
click node_comments_admin "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/comments.mjs"
click node_projects_admin "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/projects.mjs"
click node_music_admin "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/music.mjs"
click node_stats_admin "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/stats.mjs"
click node_safe_fetch "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/safe-fetch.mjs"
click node_geo "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/geo.mjs"
click node_build "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/build.mjs"
click node_backup "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/backup.mjs"
click node_runtime_store "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/store.mjs"
click node_markdown_source "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/src/content.config.ts"
click node_static_site "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/src/pages/index.astro"
click node_post_helpers "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/src/lib/posts.ts"
click node_site_content "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/src/lib/site-content.ts"
click node_shortcodes "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/src/lib/remark-legacy-shortcodes.mjs"
click node_search "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/src/pages/search.astro"
click node_feed_map "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/src/pages/rss.xml.ts"
click node_projects_front "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/src/pages/projects/index.astro"
click node_comments_front "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/src/lib/comments.js"
click node_music_front "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/src/components/MusicPlayer.astro"
click node_public_api "https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/routes.mjs"

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_admin_server,node_admin_ui,node_auth,node_content_admin,node_preview,node_dynamic_routes,node_site_data,node_comments_admin,node_projects_admin,node_music_admin,node_stats_admin,node_safe_fetch,node_geo toneBlue
class node_build,node_backup,node_runtime_store,node_markdown_source toneAmber
class node_static_site,node_post_helpers,node_site_content,node_shortcodes,node_search,node_feed_map,node_projects_front toneMint
class node_comments_front,node_music_front,node_public_api toneRose
class node_administrator,node_visitor,node_external_music toneIndigo
```

## Components

### CMS administration

- [Admin server](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/server.mjs): `admin/server.mjs`
- [Admin interface](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/views.mjs): `admin/views.mjs`
- [Login and sessions](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/auth.mjs): `admin/lib/auth.mjs`
- [Content editing](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/content.mjs): `admin/lib/content.mjs`
- [Markdown preview](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/preview.mjs): `admin/lib/preview.mjs`
- [Feature API routes](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/routes.mjs): `admin/lib/routes.mjs`
- [Site data management](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/site-data.mjs): `admin/lib/site-data.mjs`
- [Comment moderation](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/comments.mjs): `admin/lib/comments.mjs`
- [Project management](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/projects.mjs): `admin/lib/projects.mjs`
- [Music management](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/music.mjs): `admin/lib/music.mjs`
- [Visit analytics](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/stats.mjs): `admin/lib/stats.mjs`
- [Safe outbound fetch](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/safe-fetch.mjs): `admin/lib/safe-fetch.mjs`
- [IP geolocation](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/geo.mjs): `admin/lib/geo.mjs`

### Publishing and storage

- [Build and release](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/build.mjs): `admin/lib/build.mjs`
- [Remote data backup](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/backup.mjs): `admin/lib/backup.mjs`
- [Runtime JSON store](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/store.mjs): `admin/lib/store.mjs`
- [Markdown content](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/src/content.config.ts): `src/content.config.ts`

### Static blog

- [Generated static site](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/src/pages/index.astro): `src/pages/index.astro`
- [Post and note queries](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/src/lib/posts.ts): `src/lib/posts.ts`
- [Shared site content](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/src/lib/site-content.ts): `src/lib/site-content.ts`
- [Legacy shortcode rendering](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/src/lib/remark-legacy-shortcodes.mjs): `src/lib/remark-legacy-shortcodes.mjs`
- [Client-side search](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/src/pages/search.astro): `src/pages/search.astro`
- [RSS and sitemap](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/src/pages/rss.xml.ts): `src/pages/rss.xml.ts`
- [Project pages](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/src/pages/projects/index.astro): `src/pages/projects/index.astro`

### Visitor features

- [Comments](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/src/lib/comments.js): `src/lib/comments.js`
- [Music player](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/src/components/MusicPlayer.astro): `src/components/MusicPlayer.astro`
- [Visitor feature API](https://github.com/l1angk1ng/l1angk1ng_website/blob/main/admin/lib/routes.mjs): `admin/lib/routes.mjs`

### Other components

- **Administrator**
- **Visitor**
- **Music providers**

## Connections

- Administrator → Admin server: uses (evidence: `README.md`)
- Admin server → Login and sessions: authenticates (evidence: `admin/server.mjs`)
- Admin server → Admin interface: renders (evidence: `admin/server.mjs`)
- Admin server → Content editing: handles content (evidence: `admin/server.mjs`)
- Admin server → Build and release: starts build (evidence: `admin/server.mjs`)
- Admin server → Markdown preview: uses preview (evidence: `admin/server.mjs`)
- Admin server → Feature API routes: mounts routes (evidence: `admin/lib/routes.mjs`)
- Administrator → Content editing: edits Markdown (evidence: `README.md`)
- Content editing → Markdown content: writes files (evidence: `README.md`)
- Markdown preview → Legacy shortcode rendering: converts shortcodes (evidence: `admin/lib/preview.mjs`)
- Admin server → Site data management: serves management (evidence: `admin/server.mjs`)
- Feature API routes → Site data management: calls (evidence: `admin/lib/routes.mjs`)
- Feature API routes → Comment moderation: calls (evidence: `admin/lib/routes.mjs`)
- Feature API routes → Project management: calls (evidence: `admin/lib/routes.mjs`)
- Feature API routes → Music management: calls (evidence: `admin/lib/routes.mjs`)
- Feature API routes → Visit analytics: calls (evidence: `admin/lib/routes.mjs`)
- Site data management → Runtime JSON store: reads and writes (evidence: `admin/lib/site-data.mjs`)
- Comment moderation → Runtime JSON store: uses (evidence: `admin/lib/comments.mjs`)
- Project management → Runtime JSON store: uses (evidence: `admin/lib/projects.mjs`)
- Music management → Runtime JSON store: reads and writes (evidence: `admin/lib/music.mjs`)
- Music management → Safe outbound fetch: fetches remotely (evidence: `admin/lib/music.mjs`)
- IP geolocation → Safe outbound fetch: fetches remotely (evidence: `admin/lib/geo.mjs`)
- Visit analytics → IP geolocation: looks up location (evidence: `admin/lib/stats.mjs`)
- Visit analytics → Runtime JSON store: uses (evidence: `admin/lib/stats.mjs`)
- Build and release → Generated static site: builds (evidence: `README.md`)
- Build and release → Remote data backup: backs up after publish (evidence: `admin/lib/build.mjs`)
- Remote data backup → Runtime JSON store: reads configuration (evidence: `admin/lib/backup.mjs`)
- Remote data backup → Markdown content: mirrors content (evidence: `admin/lib/backup.mjs`)
- Generated static site → Post and note queries: queries posts
- Generated static site → Shared site content: loads shared data
- Generated static site → Legacy shortcode rendering: renders shortcodes (evidence: `README.md`)
- Visitor → Generated static site: browses (evidence: `README.md`)
- Client-side search → Post and note queries: searches posts
- RSS and sitemap → Post and note queries: collects posts (evidence: `src/pages/rss.xml.ts`)
- Project pages → Shared site content: loads project data
- Visitor → Comments: comments (evidence: `README.md`)
- Comments → Visitor feature API: uses API
- Visitor → Music player: plays music (evidence: `README.md`)
- Music player → Visitor feature API: requests playlist
- Visitor feature API → Music management: resolves tracks (evidence: `admin/lib/routes.mjs`)
- Music management → Music providers: resolves playback (evidence: `admin/lib/music.mjs`)
