Skip to content

Rebuild blog on TanStack Start, Drizzle & Better Auth#4

Open
Sam-Apostel wants to merge 1 commit into
masterfrom
claude/blog-rebuild-tanstack-CDOkp
Open

Rebuild blog on TanStack Start, Drizzle & Better Auth#4
Sam-Apostel wants to merge 1 commit into
masterfrom
claude/blog-rebuild-tanstack-CDOkp

Conversation

@Sam-Apostel

Copy link
Copy Markdown
Owner

Lays the foundation for the rebuilt sams.land / sam.apostel.be, replacing the Next.js + Xata app with a fresh stack ready for Railway.

Stack

  • TanStack Start (Vite, file-based routing, server functions) with a Nitro node-server build for Railway
  • PostgreSQL + Drizzle ORM — migrations + seed script
  • Better Auth — email/password, signups closed in prod, guarding /admin
  • Tailwind v4 with CSS-variable theme modes
  • Satori + resvg-wasm for OG images, plus an RSS feed

What's here

  • Three modes (software / lifestyle / hardware): switching in the header re-themes the whole site (palette + typography). Stored in a cookie and applied at SSR so there's no flash.
  • Blog with a markdown editor + live preview, dynamic OG images per post.
  • Reading list for useful articles.
  • Projects + an aggregated releases feed.
  • Release-notes standard (docs/release-notes-standard.md) with an authenticated ingestion endpoint POST /api/releases, so every project can report what it ships. Includes drop-in clients (curl, GitHub Actions, Node).
  • Footer doubles as the attribution landing (points to the formal portfolio at sams.works).

Data model (src/db/schema.ts)

post, project, release, reading_item, tagged by mode, plus the Better Auth tables. Ready to receive the existing blog/projects from a database export later.

Verified locally

Against a real Postgres + the production build (.output/server/index.mjs):

  • SSR renders per-route data; mode cookie themes SSR output (software/lifestyle/hardware)
  • Auth: login returns a session; /admin redirects unauthenticated → /login, authed → 200
  • OG route returns a valid 1200×630 PNG
  • POST /api/releases → 201 with bearer token, 401 without
  • RSS, release-notes doc page, migrations and seed all work
  • tsc --noEmit clean, npm run build succeeds

Follow-ups

  • Import existing posts/projects from the DB export
  • Per-mode visual polish (the theming infrastructure is in place)
  • Dedicated project pages, reading-list admin UI, sitemap

Deploy notes

railway.json builds with npm run build and starts with npm run db:migrate && npm run start. Add a Postgres plugin and the env vars from .env.example, then run npm run db:seed once to create the owner account.

https://claude.ai/code/session_01B8rbrwexvi1sEFiq8QqwFo


Generated by Claude Code

Replace the Next.js + Xata blog with a fresh foundation:

- TanStack Start (Vite, file-based routing, server functions) + Nitro
  node-server output for Railway
- PostgreSQL via Drizzle ORM; schema for posts, projects, releases and
  reading list, plus Better Auth tables; migrations + seed script
- Better Auth (email/password, closed signups) guarding an /admin area
- Three site "modes" (software / lifestyle / hardware) that re-theme the
  whole site via CSS variables, persisted in a cookie and applied at SSR
- Markdown post editor with live preview
- Reading list, projects and an aggregated releases feed
- A documented release-notes standard with an authenticated ingestion
  endpoint (/api/releases) so projects can report what they ship
- OG image generation (Satori + resvg-wasm), RSS feed
- Railway config, README and .env.example
@vercel

vercel Bot commented Jun 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog Error Error Jun 1, 2026 9:36pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants