For the complete documentation index, see llms-docs.txt or the site index llms.txt. Full docs corpus: llms-full-docs.txt. Prefer the markdown version of this page at /docs/setup/frontend/links.md. Product capabilities: skill.md. Docs MCP: /docs/mcp. Site MCP: /mcp.

Links

Set up and run the Reloop links app locally.

Contact preference center, tracked link redirects, and open-tracking pixel proxy for outbound email.

Run bun setup once from the monorepo root before starting individual apps. Preferences need contacts and mail running (bun dev or bun backend:dev).

Overview

PropertyValue
Directoryapps/frontend/links
Port3005
Preferenceshttps://local.reloop.sh/preferences
Redirecthttps://local.reloop.sh/redirect
Open trackinghttps://local.reloop.sh/api/mail/v1/track/open
StackNext.js · React 19 · Tailwind CSS

Quick start

From the monorepo root (after bun setup):

bun fe:links:dev

Or start every frontend together:

bun frontend:dev

Turbopack serves the app on port 3005. Prefer the local.reloop.sh URLs above when Caddy is running.

Use https://local.reloop.sh/..., not localhost:3005, so redirects and cookies match production-style hosts.

Environment

Committed local defaults live in apps/frontend/links/.env (and .env.dev). Fresh clones already have them; bun env:setup / bun setup recreate or merge missing keys.

NEXT_PUBLIC_URL=https://local.reloop.sh
# Must match TRACKING_SECRET in the mail backend and REDIRECT_SECRET in auth/email backends
REDIRECT_SECRET=reloop_tracking_secret_default_123

# Server-side contacts API (preferences page)
INTERNAL_API_URL=http://localhost:8014/api/contacts

# Server-side mail API (open-tracking pixel proxy)
INTERNAL_MAIL_API_URL=http://localhost:8015/api/mail

# Rybbit analytics (optional)
NEXT_PUBLIC_RYBBIT_HOST=https://app.rybbit.io
NEXT_PUBLIC_RYBBIT_SITE_ID=reloop-web

Preferences call contacts via INTERNAL_API_URL. Open-tracking proxies to mail via INTERNAL_MAIL_API_URL (or NEXT_PUBLIC_URL as a fallback).

VariableRequiredDefault
NEXT_PUBLIC_URLNohttps://link.reloop.sh — base URL for redirect and preference links
REDIRECT_SECRETNoShared secret with mail / auth / email backends
INTERNAL_API_URLNohttp://localhost:8014/api/contacts
INTERNAL_MAIL_API_URLNoFalls back to {NEXT_PUBLIC_URL}/api/mail
NEXT_PUBLIC_RYBBIT_HOSTNoRybbit analytics host
NEXT_PUBLIC_RYBBIT_SITE_IDNoRybbit site identifier

Routes

RoutePurpose
/preferences/[token]Manage subscription topics and unsubscribe
/redirect/[token]Track clicks and redirect to destination URL
/api/mail/v1/track/open/[token]Proxy open-tracking pixels to the mail service

Architecture

LayerDetail
MailInjects /redirect/[token] click links and open pixels in outbound HTML
ContactsPowers preference page data
Open-tracking proxyCustom tracking domains CNAME here; pixels proxy to mail when /api/mail is not on the tracking host
CaddyRoutes /preferences* and /redirect* to port 3005

Commands

CommandDescription
bun fe:links:devStart dev server with Turbopack
bun run --filter=fe-links buildCompile production bundle
bun run --filter=fe-links startRun production build
bun run --filter=fe-links lintRun ESLint checks

Next

Was this page helpful?

Edit this page