AISG URL Shortener

AISG URL Shortener

KnowShortener is AI Singapore's enterprise URL shortener — a Laravel 12 application that turns long links into branded short URLs on aisg.sg, with scheduling, password protection, UTM tracking, and rich click analytics.

Staff sign in with a magic link sent to their @aisingapore.org email. Admins manage users, API keys, and platform settings from a central dashboard; editors and members create and monitor links for campaigns, events, and internal sharing.

  • Branded short links — custom slugs on aisg.sg/{code} with optional titles and notes
  • Scheduling — set available-from and expiry dates; visitors see clear messages when a link is not yet active or has expired
  • Password protection — gate sensitive destinations behind a shared password
  • UTM parameters — attach campaign, source, medium, and term fields when creating links
  • Click analytics — per-click records with country, city, device, browser, OS, referrer, and unique-visitor detection
  • REST API — programmatic create/read/update/delete via scoped API keys (kn_ prefix)
  • Public reports — share read-only analytics via tokenised links
  • Optional AI chat — ask questions about a link's performance in natural language

Control when a link is live — set available-from, expiry, and internal notes.

Visitors who open a link before its start time see a friendly "not active yet" page.

Scheduled activation shows the configured available-from date and time.

Optionally require a password before redirecting to the destination URL.

A streamlined create form: destination URL plus slug in one step.

Built-in UTM fields (source, medium, campaign, term) for marketing attribution.

Per-click analytics: geography, device type, browser, referrer, and unique clicks.

Passwordless sign-in: enter your @aisingapore.org email to receive a magic link.

KnowShortener is built on Laravel 12 with SQLite, Tailwind CSS v4, Alpine.js, and Chart.js. Geo lookup uses ip-api.com; permissions use Spatie Laravel Permission with custom admin / editor / member roles.

Short URLs are served from a dedicated base domain (SHORT_URL_BASE), separate from the admin app URL when configured. All platform settings (SMTP, OpenAI, branding) live in a database settings table — not hardcoded in .env.

Integrate via /api/v1 using an X-API-Key header. Keys are scoped for read, write, or delete. Registration and magic-link requests are restricted to domains on the allowlist (e.g. aisingapore.org).

Roles: Admin — full platform control; Editor — manage links and view analytics; Member — create and manage own links.