Changeset c9c6a2d in Klonkt for src/config


Ignore:
Timestamp:
06/21/2026 06:38:24 PM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
9a34d31
Parents:
d41f4be
Message:

feat(meldingen): notifications — reply on comment, comment on post, like on post

For every logged-in user (Google visitors/fans and admin). Bell icon in the
header with unread counter + notifications page /notifications (via user menu
desktop + profile sheet mobile; badge also on the mobile Profile tab). Opening =
read. Triggers in comments (reply→comment author, top-level→post author) and
like (→post author); notify() skips notifying yourself. Table notifications
+ NotificationService. NL/EN/DE.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/config/database.js

    rd41f4be rc9c6a2d  
    252252  `);
    253253
     254  // Meldingen: iemand reageert op je reactie / post, of liket je post. Snapshots
     255  // van naam/titel zodat de lijst goedkoop te tonen is zonder joins.
     256  db.exec(`
     257    CREATE TABLE IF NOT EXISTS notifications (
     258      id TEXT PRIMARY KEY,
     259      user_id TEXT NOT NULL,
     260      type TEXT NOT NULL,
     261      actor_id TEXT,
     262      actor_name TEXT,
     263      post_slug TEXT,
     264      post_title TEXT,
     265      url TEXT,
     266      read INTEGER DEFAULT 0,
     267      created_at DATETIME DEFAULT CURRENT_TIMESTAMP
     268    );
     269    CREATE INDEX IF NOT EXISTS idx_notif_user ON notifications(user_id, read, created_at);
     270  `);
     271
    254272  // Link-in-bio klikstatistiek (premium #6). Per (site, url) een teller; de
    255273  // link-in-bio-pagina linkt via /links/go/:i dat de klik telt en doorstuurt.
Note: See TracChangeset for help on using the changeset viewer.