Changeset 6351545 in Klonkt for src/config


Ignore:
Timestamp:
06/14/2026 08:18:50 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
07775b7
Parents:
9e27d64
Message:

tenancy: runtime Solo/Hub mode + mode-aware /admin (Phase 1)

Admin can switch live between modes in Admin -> Settings:

  • solo: exactly one site (the primary/owner site), no /sites routing, leaner /admin.
  • hub: main site + /sites/:slug routing (company; /gebruikers + assignment flow = Phase 2).

Switching is non-destructive (hides only, deletes nothing).

  • app_settings (key/value singleton) + SettingsService (cached getTenancy/setTenancy).
  • resolveSite: solo pins to the primary site + disables /sites/:slug + host mapping.
  • /admin/settings (god-only) toggle; /admin dashboard rewritten, mode-aware.

Tested on the demo: solo/hub dashboard tiles, /sites routing per mode, toggle back/forth.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/config/database.js

    r9e27d64 r6351545  
    9393      ON playlist_tracks(playlist_id, position);
    9494  `);
     95
     96  // Globale app-instellingen (key/value singleton). O.a. de tenancy-modus
     97  // (solo = één site, hub = bedrijfssite + /gebruikers). Default = solo.
     98  db.exec(`
     99    CREATE TABLE IF NOT EXISTS app_settings (
     100      key TEXT PRIMARY KEY,
     101      value TEXT,
     102      updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
     103    );
     104  `);
     105  db.prepare("INSERT OR IGNORE INTO app_settings (key, value) VALUES ('tenancy', 'solo')").run();
    95106}
    96107
Note: See TracChangeset for help on using the changeset viewer.