Changeset 37edecd in Klonkt for src/server.js


Ignore:
Timestamp:
06/19/2026 03:46:42 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
1794fac
Parents:
91094a4
Message:

Link-in-bio + click stats (premium feature #6)

Linktree-style page from the existing sites.profile_links (JSON [{platform,url}])
+ PLATFORMS icons. Clicks counted per url.

  • DB: link_clicks (site_id, url, clicks), PK (site_id,url).
  • routes/linkbio.js (premium-gated): GET /links (page with profile_links as buttons), GET /links/go/:i (counts click per url + 302 redirect). Open-redirect safe: only redirects to a url in the site's own profile_links; http(s)/mailto only.
  • view pages/linkbio.ejs (photo/name/bio + brand-coloured buttons with SVG icons).
  • admin-stats: link-clicks section (top 50, per url) for the current site.
  • admin dashboard: 🔗 Link-in-bio link (premium, non-hub).

node --check passed.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/server.js

    r91094a4 r37edecd  
    5656import adminNewsletterRoutes from './routes/admin-newsletter.js';
    5757import downloadRoutes from './routes/download.js';
     58import linkbioRoutes from './routes/linkbio.js';
    5859
    5960if (!process.env.SESSION_SECRET) {
     
    273274app.use('/', newsletterRoutes); // /nieuwsbrief in/uitschrijven (premium; niet-premium: next())
    274275app.use('/', downloadRoutes); // /downloads + /download/:id download-voor-email (premium)
     276app.use('/', linkbioRoutes); // /links link-in-bio + klikstats (premium)
    275277app.use('/', postsRoutes);
    276278
Note: See TracChangeset for help on using the changeset viewer.