Files
thoughts/thoughts-frontend
Gabriel Kaszewski 79f1e63bb8
Some checks failed
lint / lint (push) Failing after 9m14s
test / unit (push) Successful in 16m3s
perf(feed): replace correlated subqueries with LEFT JOIN aggregations
Feed queries ran 5 correlated subqueries per row (3 COUNT + 2 EXISTS
for engagement counts and viewer context). Replaced with LEFT JOIN
aggregations computed once per query. Adds migration 016 with indexes
on likes(thought_id), boosts(thought_id), thoughts(in_reply_to_id),
and compound viewer-context indexes — expected to drop ~3s queries to
<100ms on typical page sizes.

Also removes WebFinger from the footer (requires query params, zero
standalone value as a link).
2026-05-29 04:35:32 +02:00
..

Thoughts — Frontend

Next.js 15 (App Router) frontend for the Thoughts self-hosted microblogging server.

Features

  • Post thoughts, reply, boost, and like
  • Home feed, public feed, per-user timelines
  • Browse and follow remote Fediverse actors by @user@instance handle
  • Full remote actor profiles — bio, banner, profile fields, posts tab, followers/following tabs
  • Full-text search for local users and thoughts; remote actor lookup via WebFinger
  • Notifications, API key management, profile editing
  • Dark/light theme

Setup

bun install

Copy .env.local.example to .env.local (or set the variables directly):

NEXT_PUBLIC_API_URL=http://localhost:8000
NEXT_PUBLIC_SERVER_SIDE_API_URL=http://localhost:8000

NEXT_PUBLIC_API_URL is used by client-side fetches (runs in the browser). NEXT_PUBLIC_SERVER_SIDE_API_URL is used by server-side fetches (runs in Next.js SSR — can point to an internal service URL in Docker).

Run

bun run dev     # development — http://localhost:3000
bun run build   # production build
bun run start   # serve production build

Docker

docker build \
  --build-arg NEXT_PUBLIC_API_URL=https://api.yourdomain.example.com \
  --build-arg NEXT_PUBLIC_SERVER_SIDE_API_URL=http://thoughts:8000 \
  -t thoughts-frontend .
docker run -p 3000:3000 thoughts-frontend