Skip to content

Getting started

Cursor Agent edited this page Dec 1, 2026 · 1 revision

Getting started

🇫🇷 Version française

This page gets Tournure running on your computer in about ten minutes.

Prerequisites

Optional services (Stripe, Google OAuth, SMTP, Google AI for images) are described in Configuration.

1. Get the code

git clone https://github.com/THATMUCH/Open_tournure.git
cd Open_tournure
npm ci

No access token or private registry is needed.

2. Create the Supabase project

  1. Create a project in Supabase.
  2. Open SQL Editor and run every file of supabase/migrations/, in file-name order (0001_init.sql, 0002_..., and so on). Some numbers appear twice (for example 0007_*): keep the alphabetical order.
  3. Authentication > URL Configuration: set Site URL to http://localhost:3000 and add http://localhost:3000/auth/callback to Redirect URLs.
  4. Project Settings > API: copy the project URL and the anon key.

3. Configure the environment

cp .env.example .env.local
openssl rand -base64 32   # paste the result as ENCRYPTION_KEY

Fill at least NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, ANTHROPIC_API_KEY, ENCRYPTION_KEY and NEXT_PUBLIC_SITE_URL. Never commit .env.local.

4. Run

npm run dev      # http://localhost:3000

Open the app, enter your e-mail, click the magic link you receive, create your first site from its web address, then write your first article.

Useful scripts

Command What it does
npm run dev Development server
npm run build / npm start Production build and server
npm run lint ESLint
npm run typecheck TypeScript check
npm test Unit tests (Vitest)
npm run rotate-key Re-encrypt stored secrets with a new ENCRYPTION_KEY (see Configuration)

Troubleshooting

  • The magic link redirects to the wrong address: check Site URL and Redirect URLs in Supabase and NEXT_PUBLIC_SITE_URL.
  • Environment changes have no effect on NEXT_PUBLIC_*: these values are baked in at build time; restart npm run dev or rebuild.
  • Image generation returns an error: it needs GOOGLE_AI_API_KEY; the rest of the app works without it.

Clone this wiki locally