# mgoldie05/chalk architecture

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

- Interactive diagram: https://gitdiagram.com/mgoldie05/chalk
- Repository: https://github.com/mgoldie05/chalk

## Overview

Chalk is a campus robotics-club announcement wall. Members register or sign in, compose posts, and view the public wall; authors and officers can remove posts, while officers can access a role-gated private desk. Server actions coordinate authentication, post mutations, and SQLite access; the wall formats post bodies as light markdown. The README documents the feature set, and sampled source supports the main request paths. The health endpoint and some infrastructure are omitted as peripheral to the user workflow.

Main entry points: [`lib/actions.js`](https://github.com/mgoldie05/chalk/blob/main/lib/actions.js) (Server actions), [`app/page.js`](https://github.com/mgoldie05/chalk/blob/main/app/page.js) (Public wall), [`lib/db.js`](https://github.com/mgoldie05/chalk/blob/main/lib/db.js) (SQLite database), [`lib/auth.js`](https://github.com/mgoldie05/chalk/blob/main/lib/auth.js) (Sessions and accounts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_layout["App shell<br/>[layout.js]"]
  node_register["Registration<br/>[page.js]"]
  node_login["Sign in<br/>[page.js]"]
  node_compose["Compose post<br/>[page.js]"]
  node_officerdesk["Officer desk<br/>[page.js]"]
end

subgraph group_identity["Identity and actions"]
  node_actions["Server actions<br/>[actions.js]"]
  node_auth["Sessions and accounts<br/>[auth.js]"]
end

subgraph group_content["Wall and content"]
  node_wall["Public wall<br/>[page.js]"]
  node_markdown["Markdown formatting<br/>[markdown.js]"]
  node_postbody["Post renderer<br/>[PostBody.js]"]
end

subgraph group_persistence["Persistence"]
  node_seed["Demo data<br/>[seed.js]"]
  node_db[("SQLite database<br/>[db.js]")]
end

node_member(("Club member"))

node_member -->|"registers"| node_register
node_member -->|"signs in"| node_login
node_member -->|"submits post"| node_compose
node_member -->|"views posts"| node_wall
node_layout -->|"loads user"| node_actions
node_register -->|"submits registration"| node_actions
node_login -->|"submits credentials"| node_actions
node_compose -->|"submits post"| node_actions
node_actions -->|"manages sessions"| node_auth
node_actions -->|"writes posts"| node_db
node_auth -->|"reads and writes"| node_db
node_auth -->|"initializes data"| node_seed
node_seed -->|"seeds records"| node_db
node_wall -->|"loads user"| node_actions
node_wall -->|"reads posts"| node_db
node_wall -->|"formats bodies"| node_markdown
node_wall -->|"renders HTML"| node_postbody
node_officerdesk -->|"checks user"| node_actions
node_officerdesk -->|"reads desk notes"| node_db
node_layout -->|"signs out"| node_actions

click node_layout "https://github.com/mgoldie05/chalk/blob/main/app/layout.js"
click node_register "https://github.com/mgoldie05/chalk/blob/main/app/register/page.js"
click node_login "https://github.com/mgoldie05/chalk/blob/main/app/login/page.js"
click node_compose "https://github.com/mgoldie05/chalk/blob/main/app/compose/page.js"
click node_officerdesk "https://github.com/mgoldie05/chalk/blob/main/app/mod/page.js"
click node_actions "https://github.com/mgoldie05/chalk/blob/main/lib/actions.js"
click node_auth "https://github.com/mgoldie05/chalk/blob/main/lib/auth.js"
click node_wall "https://github.com/mgoldie05/chalk/blob/main/app/page.js"
click node_markdown "https://github.com/mgoldie05/chalk/blob/main/lib/markdown.js"
click node_postbody "https://github.com/mgoldie05/chalk/blob/main/components/PostBody.js"
click node_seed "https://github.com/mgoldie05/chalk/blob/main/lib/seed.js"
click node_db "https://github.com/mgoldie05/chalk/blob/main/lib/db.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_layout,node_register,node_login,node_compose,node_officerdesk toneBlue
class node_actions,node_auth toneAmber
class node_wall,node_markdown,node_postbody toneMint
class node_seed,node_db toneRose
class node_member toneIndigo
```

## Components

### Web experience

- [App shell](https://github.com/mgoldie05/chalk/blob/main/app/layout.js): `app/layout.js`
- [Registration](https://github.com/mgoldie05/chalk/blob/main/app/register/page.js): `app/register/page.js`
- [Sign in](https://github.com/mgoldie05/chalk/blob/main/app/login/page.js): `app/login/page.js`
- [Compose post](https://github.com/mgoldie05/chalk/blob/main/app/compose/page.js): `app/compose/page.js`
- [Officer desk](https://github.com/mgoldie05/chalk/blob/main/app/mod/page.js): `app/mod/page.js`

### Identity and actions

- [Server actions](https://github.com/mgoldie05/chalk/blob/main/lib/actions.js): `lib/actions.js`
- [Sessions and accounts](https://github.com/mgoldie05/chalk/blob/main/lib/auth.js): `lib/auth.js`

### Wall and content

- [Public wall](https://github.com/mgoldie05/chalk/blob/main/app/page.js): `app/page.js`
- [Markdown formatting](https://github.com/mgoldie05/chalk/blob/main/lib/markdown.js): `lib/markdown.js`
- [Post renderer](https://github.com/mgoldie05/chalk/blob/main/components/PostBody.js): `components/PostBody.js`

### Persistence

- [Demo data](https://github.com/mgoldie05/chalk/blob/main/lib/seed.js): `lib/seed.js`
- [SQLite database](https://github.com/mgoldie05/chalk/blob/main/lib/db.js): `lib/db.js`

### Other components

- **Club member**

## Connections

- Club member → Registration: registers (evidence: `app/register/page.js`)
- Club member → Sign in: signs in (evidence: `app/login/page.js`)
- Club member → Compose post: submits post (evidence: `app/compose/page.js`)
- Club member → Public wall: views posts (evidence: `README.md`)
- App shell → Server actions: loads user (evidence: `app/layout.js`)
- Registration → Server actions: submits registration (evidence: `app/register/page.js`)
- Sign in → Server actions: submits credentials (evidence: `app/login/page.js`)
- Compose post → Server actions: submits post (evidence: `app/compose/page.js`)
- Server actions → Sessions and accounts: manages sessions (evidence: `lib/actions.js`)
- Server actions → SQLite database: writes posts (evidence: `lib/actions.js`)
- Sessions and accounts → SQLite database: reads and writes (evidence: `lib/auth.js`)
- Sessions and accounts → Demo data: initializes data (evidence: `lib/auth.js`)
- Demo data → SQLite database: seeds records (evidence: `lib/seed.js`)
- Public wall → Server actions: loads user (evidence: `app/page.js`)
- Public wall → SQLite database: reads posts (evidence: `app/page.js`)
- Public wall → Markdown formatting: formats bodies (evidence: `app/page.js`)
- Public wall → Post renderer: renders HTML (evidence: `app/page.js`)
- Officer desk → Server actions: checks user (evidence: `app/mod/page.js`)
- Officer desk → SQLite database: reads desk notes (evidence: `app/mod/page.js`)
- App shell → Server actions: signs out (evidence: `app/layout.js`)
