LinkDen
Getting Started

Installation

Clone the repository, install dependencies, and get LinkDen running locally.

๐Ÿ’ป Installation

Get LinkDen running on your machine in under 5 minutes.

๐Ÿ“‹ Prerequisites

  • Bun 1.3+ -- Grab it from bun.sh.
  • Node.js 24 -- bun dev runs Alchemy under Node.
  • Cloudflare account -- A free account is enough for development.

1. ๐Ÿ“‚ Clone and Install

git clone https://github.com/mrdemonwolf/linkden.git
cd linkden
bun install

Tip: bun install handles all apps and packages in the monorepo automatically.


2. โš™๏ธ Environment Setup

Copy the example file:

cp .env.example .env

Required Variables:

VariableDescriptionExample
BETTER_AUTH_SECRETSecret key for sessionsopenssl rand -base64 32
BETTER_AUTH_URLAPI server URLhttp://localhost:3000
CORS_ORIGINWeb frontend URLhttp://localhost:3001
NEXT_PUBLIC_SERVER_URLPublic API URLhttp://localhost:3000
NEXT_PUBLIC_SITE_URLPublic site URLhttp://localhost:3001

3. ๐Ÿš€ Start Dev Servers

There are two ways to run LinkDen locally. Both apply the database migrations for you (option B with one command).

A. bun dev (everything, through Alchemy)

bun dev

bun dev runs the Alchemy program in dev mode: it starts the web app, the API and the docs and applies every migration in packages/db/src/migrations to a local D1. Alchemy keeps its state in the alchemy-state worker, so this needs ALCHEMY_STATE_TOKEN in .env (see the Cloudflare guide if you don't have one). In this mode apps/web/.env and apps/server/.env are loaded as well.

B. API and web separately (no Alchemy state needed)

# first run only: apply the migrations to the local D1
cd apps/server && for f in ../../packages/db/src/migrations/*.sql; do bunx wrangler d1 execute linkden-db --local --file="$f" --yes; done; cd ../..

bun dev:server   # wrangler dev on :3000 (reads apps/server/.dev.vars)
bun dev:web      # next dev on :3001
  • ๐ŸŒ Web App: http://localhost:3001
  • โš™๏ธ API Server: http://localhost:3000
  • ๐Ÿ“š Docs: http://localhost:3002 (bun dev:docs)

No db:push. Schema changes go through migrations: edit packages/db/src/schema, run bun db:generate, and the new migration is applied on the next bun dev / bun ship. bun db:reset wipes both local databases.


4. โœ… Verify It Works

  1. Visit: http://localhost:3001/admin/setup.
  2. Create Account: Enter your name, email, and password.
  3. Registration: The first user becomes the admin and registration locks automatically.
  4. Dashboard: You'll be redirected to the admin panel. You're all set!

Next Steps

On this page