Links

Set up and run the Reloop links app locally.

Complete Base Setup First

Ensure you've finished the Setup — before proceeding.

Service Overview

Contact preference center and tracked link redirects for outbound email.

PropertyValue
Directoryapps/frontend/links
Port3005
Local URL (preferences)https://local.reloop.sh/preferences
Local URL (redirect)https://local.reloop.sh/redirect
StackNext.js React 19 Tailwind CSS

Quick Start

Run from the monorepo root:

bun fe:links:dev

The app starts with Turbopack hot reloading on port 3005.

Environment Configuration

Variables in apps/frontend/links/.env (committed with local defaults — no bun env:setup step needed):

NEXT_PUBLIC_URL=https://local.reloop.sh

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

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

The preferences page calls the contacts service server-side via INTERNAL_API_URL. In production, point this at your internal contacts API endpoint.

Reference Table

VariableRequiredDefault
NEXT_PUBLIC_URLNohttps://link.reloop.sh — base URL for redirect and preference links
INTERNAL_API_URLNohttp://localhost:8014/api/contacts — server-side contacts API
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

Development Commands

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

Architecture

LayerDetail
MailInjects /redirect/[token] links in outbound HTML.
ContactsPowers preference page data.
CaddyRoutes /preferences* and /redirect* to port 3005.

Was this page helpful?

Edit this page