# kevinvdweert/flarecms architecture

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

- Interactive diagram: https://gitdiagram.com/kevinvdweert/flarecms
- Repository: https://github.com/kevinvdweert/flarecms

## Overview

FlareCMS is a Firebase-backed CMS for publishing public pages and administering content, media, users, and site settings. Visitors enter through public routes to view the home page or a slug page; staff sign in, then use protected admin workflows to manage pages and blocks, media, settings, and users. The frontend and callable Cloud Functions form the server-operation boundary, with Firestore as the documented application store and a separate local upload server for image files. Detailed wiring is shown only where the excerpts or README support it.

Main entry points: [`functions/src/index.ts`](https://github.com/kevinvdweert/flarecms/blob/main/functions/src/index.ts) (Callable functions), [`apps/web/src/app/App.jsx`](https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/app/App.jsx) (App routes), [`apps/web/src/lib/auth.js`](https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/lib/auth.js) (Firebase auth), [`apps/web/src/features/pages/PublicPage.jsx`](https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/pages/PublicPage.jsx) (Public page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["App routes<br/>[App.jsx]"]
  node_authui["Sign-in<br/>[Login.jsx]"]
  node_authcontext["Auth state<br/>[AuthContext.jsx]"]
  node_authlib["Firebase auth<br/>[auth.js]"]
end

subgraph group_content["Content publishing"]
  node_publichome["Public home<br/>[PublicHome.jsx]"]
  node_publicpage["Public page<br/>[PublicPage.jsx]"]
  node_pagelist["Page library<br/>[PageList.jsx]"]
  node_pageeditor["Page editor<br/>[PageEditor.jsx]"]
  node_blocks["Block editing<br/>[BlockEditor.jsx]"]
  node_blockrender["Block rendering<br/>[BlockRenderer.jsx]"]
end

subgraph group_admin["Administration"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_users["User management<br/>[UserList.jsx]"]
  node_settings["Site settings<br/>[SettingsLayout.jsx]"]
end

subgraph group_backend["Cloud services"]
  node_functions["Callable functions<br/>[index.ts]"]
  node_authfunctions["Auth functions<br/>[auth.ts]"]
  node_contentfunctions["Content functions<br/>[content.ts]"]
  node_mediafunctions["Media functions<br/>[media.ts]"]
  node_userfunctions["User functions<br/>[users.ts]"]
  node_dashfunctions["Dashboard functions<br/>[dashboard.ts]"]
  node_settingsfunctions["Settings functions<br/>[settings.ts]"]
  node_firestore[("Firestore")]
  node_firebaseauth[("Firebase Auth")]
end

subgraph group_media["Media assets"]
  node_mediaui["Media manager<br/>[MediaManager.jsx]"]
  node_storageclient["Upload client<br/>[storage.js]"]
  node_uploadserver["Local upload server<br/>[index.js]"]
  node_assets[("Image files")]
end

node_visitor(("Visitor"))
node_staff(("Staff user"))

node_visitor -->|"opens site"| node_app
node_app -->|"routes home"| node_publichome
node_app -->|"routes slug"| node_publicpage
node_staff -->|"opens admin"| node_app
node_app -->|"routes login"| node_authui
node_authui -->|"signs in"| node_authlib
node_authlib -->|"authenticates"| node_firebaseauth
node_authlib -->|"observes state"| node_authcontext
node_authcontext -->|"loads profile"| node_firestore
node_app -->|"routes pages"| node_pagelist
node_app -->|"routes editor"| node_pageeditor
node_pageeditor -->|"edits blocks"| node_blocks
node_publicpage -->|"renders blocks"| node_blockrender
node_app -->|"routes dashboard"| node_dashboard
node_app -->|"routes users"| node_users
node_app -->|"routes settings"| node_settings
node_pagelist -->|"requests content"| node_functions
node_pageeditor -->|"submits content"| node_functions
node_publicpage -->|"reads published pages"| node_firestore
node_publichome -->|"reads homepage"| node_firestore
node_dashboard -->|"requests stats"| node_functions
node_users -->|"manages users"| node_functions
node_settings -->|"saves settings"| node_functions
node_functions -->|"dispatches content"| node_contentfunctions
node_functions -->|"dispatches media"| node_mediafunctions
node_functions -->|"dispatches users"| node_userfunctions
node_functions -->|"dispatches dashboard"| node_dashfunctions
node_functions -->|"dispatches settings"| node_settingsfunctions
node_functions -->|"exports triggers"| node_authfunctions
node_authfunctions -->|"updates profiles"| node_firestore
node_authfunctions -->|"sets claims"| node_firebaseauth
node_contentfunctions -->|"manages pages"| node_firestore
node_mediafunctions -->|"manages metadata"| node_firestore
node_userfunctions -->|"manages users"| node_firestore
node_dashfunctions -->|"reads metrics"| node_firestore
node_settingsfunctions -->|"stores settings"| node_firestore
node_app -->|"routes media"| node_mediaui
node_mediaui -->|"manages asset records"| node_functions
node_mediaui -->|"uploads files"| node_storageclient
node_storageclient -.->|"sends image request"| node_uploadserver
node_uploadserver -.->|"stores files"| node_assets
node_storageclient -.->|"deletes image"| node_uploadserver

click node_app "https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/app/App.jsx"
click node_authui "https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/auth/Login.jsx"
click node_authcontext "https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/auth/AuthContext.jsx"
click node_authlib "https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/lib/auth.js"
click node_publichome "https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/pages/PublicHome.jsx"
click node_publicpage "https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/pages/PublicPage.jsx"
click node_pagelist "https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/pages/PageList.jsx"
click node_pageeditor "https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/pages/PageEditor.jsx"
click node_blocks "https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/blocks/BlockEditor.jsx"
click node_blockrender "https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/blocks/BlockRenderer.jsx"
click node_dashboard "https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/dashboard/Dashboard.jsx"
click node_users "https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/users/UserList.jsx"
click node_settings "https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/settings/SettingsLayout.jsx"
click node_mediaui "https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/media/MediaManager.jsx"
click node_storageclient "https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/lib/storage.js"
click node_uploadserver "https://github.com/kevinvdweert/flarecms/blob/main/server/index.js"
click node_functions "https://github.com/kevinvdweert/flarecms/blob/main/functions/src/index.ts"
click node_authfunctions "https://github.com/kevinvdweert/flarecms/blob/main/functions/src/auth.ts"
click node_contentfunctions "https://github.com/kevinvdweert/flarecms/blob/main/functions/src/content.ts"
click node_mediafunctions "https://github.com/kevinvdweert/flarecms/blob/main/functions/src/media.ts"
click node_userfunctions "https://github.com/kevinvdweert/flarecms/blob/main/functions/src/users.ts"
click node_dashfunctions "https://github.com/kevinvdweert/flarecms/blob/main/functions/src/dashboard.ts"
click node_settingsfunctions "https://github.com/kevinvdweert/flarecms/blob/main/functions/src/settings.ts"

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_authui,node_authcontext,node_authlib,node_staff toneBlue
class node_publichome,node_publicpage,node_pagelist,node_pageeditor,node_blocks,node_blockrender toneAmber
class node_dashboard,node_users,node_settings toneMint
class node_functions,node_authfunctions,node_contentfunctions,node_mediafunctions,node_userfunctions,node_dashfunctions,node_settingsfunctions,node_firestore,node_firebaseauth toneRose
class node_mediaui,node_storageclient,node_uploadserver,node_assets,node_visitor toneIndigo
```

## Components

### Web experience

- [App routes](https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/app/App.jsx): `apps/web/src/app/App.jsx`
- [Sign-in](https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/auth/Login.jsx): `apps/web/src/features/auth/Login.jsx`
- [Auth state](https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/auth/AuthContext.jsx): `apps/web/src/features/auth/AuthContext.jsx`
- [Firebase auth](https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/lib/auth.js): `apps/web/src/lib/auth.js`

### Content publishing

- [Public home](https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/pages/PublicHome.jsx): `apps/web/src/features/pages/PublicHome.jsx`
- [Public page](https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/pages/PublicPage.jsx): `apps/web/src/features/pages/PublicPage.jsx`
- [Page library](https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/pages/PageList.jsx): `apps/web/src/features/pages/PageList.jsx`
- [Page editor](https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/pages/PageEditor.jsx): `apps/web/src/features/pages/PageEditor.jsx`
- [Block editing](https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/blocks/BlockEditor.jsx): `apps/web/src/features/blocks/BlockEditor.jsx`
- [Block rendering](https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/blocks/BlockRenderer.jsx): `apps/web/src/features/blocks/BlockRenderer.jsx`

### Administration

- [Dashboard](https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/dashboard/Dashboard.jsx): `apps/web/src/features/dashboard/Dashboard.jsx`
- [User management](https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/users/UserList.jsx): `apps/web/src/features/users/UserList.jsx`
- [Site settings](https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/settings/SettingsLayout.jsx): `apps/web/src/features/settings/SettingsLayout.jsx`

### Cloud services

- [Callable functions](https://github.com/kevinvdweert/flarecms/blob/main/functions/src/index.ts): `functions/src/index.ts`
- [Auth functions](https://github.com/kevinvdweert/flarecms/blob/main/functions/src/auth.ts): `functions/src/auth.ts`
- [Content functions](https://github.com/kevinvdweert/flarecms/blob/main/functions/src/content.ts): `functions/src/content.ts`
- [Media functions](https://github.com/kevinvdweert/flarecms/blob/main/functions/src/media.ts): `functions/src/media.ts`
- [User functions](https://github.com/kevinvdweert/flarecms/blob/main/functions/src/users.ts): `functions/src/users.ts`
- [Dashboard functions](https://github.com/kevinvdweert/flarecms/blob/main/functions/src/dashboard.ts): `functions/src/dashboard.ts`
- [Settings functions](https://github.com/kevinvdweert/flarecms/blob/main/functions/src/settings.ts): `functions/src/settings.ts`
- **Firestore**
- **Firebase Auth**

### Media assets

- [Media manager](https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/features/media/MediaManager.jsx): `apps/web/src/features/media/MediaManager.jsx`
- [Upload client](https://github.com/kevinvdweert/flarecms/blob/main/apps/web/src/lib/storage.js): `apps/web/src/lib/storage.js`
- [Local upload server](https://github.com/kevinvdweert/flarecms/blob/main/server/index.js): `server/index.js`
- **Image files**

### Other components

- **Visitor**
- **Staff user**

## Connections

- Visitor → App routes: opens site
- App routes → Public home: routes home
- App routes → Public page: routes slug
- Staff user → App routes: opens admin
- App routes → Sign-in: routes login
- Sign-in → Firebase auth: signs in
- Firebase auth → Firebase Auth: authenticates
- Firebase auth → Auth state: observes state
- Auth state → Firestore: loads profile
- App routes → Page library: routes pages
- App routes → Page editor: routes editor
- Page editor → Block editing: edits blocks
- Public page → Block rendering: renders blocks
- App routes → Dashboard: routes dashboard
- App routes → User management: routes users
- App routes → Site settings: routes settings
- Page library → Callable functions: requests content
- Page editor → Callable functions: submits content
- Public page → Firestore: reads published pages
- Public home → Firestore: reads homepage
- Dashboard → Callable functions: requests stats
- User management → Callable functions: manages users
- Site settings → Callable functions: saves settings
- Callable functions → Content functions: dispatches content
- Callable functions → Media functions: dispatches media
- Callable functions → User functions: dispatches users
- Callable functions → Dashboard functions: dispatches dashboard
- Callable functions → Settings functions: dispatches settings
- Callable functions → Auth functions: exports triggers
- Auth functions → Firestore: updates profiles
- Auth functions → Firebase Auth: sets claims
- Content functions → Firestore: manages pages
- Media functions → Firestore: manages metadata
- User functions → Firestore: manages users
- Dashboard functions → Firestore: reads metrics
- Settings functions → Firestore: stores settings
- App routes → Media manager: routes media
- Media manager → Callable functions: manages asset records
- Media manager → Upload client: uploads files
- Upload client → Local upload server: sends image request
- Local upload server → Image files: stores files
- Upload client → Local upload server: deletes image
