source: Klonkt/README.md@ 851239c

main
Last change on this file since 851239c was 8afbdd6, checked in by roboburr <roboburr@…>, 3 months ago

feat: viewer role + artists directory + Klonkt Hub Beta rebrand

Viewer role (replaces the separate view-mode/readonly toggle):

  • 'kijker' is now a real role (VALID_ROLES) selectable in Admin. May view EVERYTHING including Admin, but cannot modify anything.
  • isViewer(user) (= role kijker or legacy readonly flag) is the source; requireGod/requireSiteManager(BySlug) let a viewer through (viewing), the global guard 403s every write. Existing readonly accounts are migrated on each role change (readonly=0).
  • Write leaks via GET patched: /prutter/new (INSERT) blocks for viewers, /prutter/:id skips markAsRead (UPDATE); WS upgrade rejects viewers (the HTTP guard doesn't cover WebSockets).
  • Clean "Viewer mode" page (viewer-blocked) instead of raw 403 text; styled sticky banner; account page shows read-only UI instead of an upload button that silently 403s. canMutate hides write buttons.

Scalability (>50 artists):

  • Hub home shows max 24 (most active first) + "All N artists ->".
  • New searchable, paginated /artiesten directory (hub only).
  • 'user' + 'artiesten' reserved as slugs.

Rebrand PrutFolio v1 -> Klonkt Hub Beta (footer, PWA manifest, account/
admin texts, default page title, startup, README; internal package +
PWA id 'prutfolio' remain for stability).

Co-Authored-By: Claude <noreply@…>

  • Property mode set to 100644
File size: 3.4 KB
Line 
1# Klonkt Hub Beta
2
3Persoonlijk multi-site platform met editorial-feel content + sociale community.
4Forked van **PrutCMS v9** (PHP, file-based) naar **Node + SQLite + htmx**.
5
6> **Naam-uitleg.** "PrutCMS v9" is en blijft het file-based PHP-product. Klonkt Hub
7> (intern pakket `prutfolio`) is een nieuw product met andere DNA: het is geen
8> *publishing tool* maar een *persoonlijk canvas* — content, profiel, sociale
9> interactie en realtime in één.
10
11## Filosofie
12
13- **Editorial feel.** Magazine-typografie (Fraunces + Literata + Plus Jakarta), royale spacing, 8 paletten waaronder Sage / Paper / Ocean / Forest / Stone / Midnight / Sunset / Cream. Light + dark per palette.
14- **App-feel waar het telt.** Geen full page reloads — htmx swaps + (binnenkort) View Transitions. Voelt als app, niet als website.
15- **Server-rendered.** Geen build step, geen SPA-tax. EJS + htmx + minimale Alpine.
16- **Realtime ingebouwd.** WebSocket server zit in `src/websocket/`. SSE als alternatief beschikbaar.
17- **Privacy-first.** Self-hosted fonts, geen third-party requests, geen tracking.
18
19## Roadmap
20
21| Fase | Scope | Status |
22|------|-------|--------|
23| **1.0 — v9-feel** | Homepage, profile-header, feed, post-detail visueel matchen met v9 | 🟡 in progress |
24| **1.1 — auth + posts** | Login / register / post CRUD compleet | ✅ klaar |
25| **1.2 — sociale laag** | Comments, Prutter (DMs zonder E2EE), notifications | ⚪ na 1.0 |
26| **1.3 — app-feel** | View Transitions, optimistic UI, swipe-actions, haptics | ⚪ |
27| **1.4 — bottom-tab nav** | Native-app-stijl navigatie op mobiel, sidebar op desktop | ⚪ |
28| **2.0 — E2EE DMs** | MLS protocol via `@openmls/openmls`, single-device first | ⚪ apart project |
29
30## Quick start
31
32```bash
33npm install
34cp .env.example .env
35# zet SESSION_SECRET op iets random (>=32 chars in production)
36npm run migrate
37npm run dev
38```
39
40Open http://localhost:3000
41
42## Stack
43
44- **Runtime:** Node 20+
45- **Web:** Express + Helmet + express-session
46- **DB:** better-sqlite3 (WAL mode)
47- **Templates:** EJS (server-rendered)
48- **Frontend interactie:** htmx 1.9 (vendored)
49- **Realtime:** ws (WebSocket)
50- **Fonts:** self-hosted variable woff2 (Fraunces / Literata / Plus Jakarta Sans)
51
52## Project structure
53
54```
55src/
56├── server.js # Express bootstrap, routes mounting, WS server
57├── config/ # database, env loading
58├── db/migrations/ # SQLite schema (001-init.sql)
59├── middleware/ # auth, render (htmx-aware), site, rate-limit
60├── routes/ # per-resource Express routers
61├── services/ # domain logic (Prutter, Audio, Theme, Permissions, ...)
62├── views/
63│ ├── shell.ejs # outer document (head, nav, footer)
64│ ├── partials/ # topnav, profile-header, post-card, post-tile
65│ └── pages/ # home, post, account, admin, ...
66├── assets/
67│ ├── css/style.css # v9 stylesheet — palette tokens, components
68│ ├── fonts/ # variable woff2
69│ └── js/ # htmx, audio-player
70└── websocket/ # WS server for realtime (notifications, prutter, presence)
71```
72
73## Migratie van PrutCMS v9
74
75Importer is gepland voor v1.1. Pad: `posts/*.md` + `users.json` + `sites/*/config.json` → SQLite.
76
77## License
78
79Persoonlijk project. Niet bedoeld voor publieke distributie tot verder bericht.
80
81## Deployed via git workflow on 2026-04-30
82
Note: See TracBrowser for help on using the repository browser.