Skip to content

mateoroldos/goodlab

Repository files navigation

Goodlab

A quiet lab exploring software craft, good code, and better ways to think.

Goodlab is a SvelteKit project for research notes, experiments, and visual series about ideas behind software. It is meant to be read and built slowly.

Run

bun install
bun run dev

Commands

bun run check
bun run lint
bun run build

Project

  • src/routes contains the app pages
  • src/lib/content contains series and episodes
  • src/lib/visuals contains reusable visual primitives
  • src/lib/components contains shared interface components
  • docs/research contains research notes and source-backed briefs

Environment Variables

This app reads Better Auth settings from Cloudflare runtime bindings through event.platform.env.

Cloudflare's current Wrangler docs support local secrets in either .env or .dev.vars. This project uses .env only.

For local app secrets, copy .env.example to .env and fill in the values:

cp .env.example .env

Required local values:

BETTER_AUTH_SECRET="generate-a-long-random-secret"
BETTER_AUTH_URL="http://localhost:5173"
GITHUB_CLIENT_ID="..."
GITHUB_CLIENT_SECRET="..."

For production, set the same values as Cloudflare Worker secrets. These are not read from .env in production:

bunx wrangler secret put BETTER_AUTH_SECRET
bunx wrangler secret put BETTER_AUTH_URL
bunx wrangler secret put GITHUB_CLIENT_ID
bunx wrangler secret put GITHUB_CLIENT_SECRET

Use your production origin for BETTER_AUTH_URL, for example https://your-domain.com.

Configure these callback URLs in the GitHub OAuth app:

http://localhost:5173/api/auth/callback/github
https://your-domain.com/api/auth/callback/github

Do not commit .env or .env.* files. The committed .env.example file is a template only.

Do not create .dev.vars in this project. Wrangler gives .dev.vars precedence for local Worker secrets, which would prevent .env values from being included in the local Worker env object.

.env.example contains optional Cloudflare API variables for Wrangler automation or drizzle-kit D1 HTTP usage. You do not need a Cloudflare API token for normal local commands if you are already logged in with Wrangler.

The normal migration flow for this project is Wrangler-based:

bunx drizzle-kit generate
bunx wrangler d1 migrations apply goodlab-local --local
bunx wrangler d1 migrations apply goodlab-prod --env production --remote

The default configured D1 binding is goodlab-local, which is used with Wrangler's local D1 simulation. The production environment overrides the same DB binding to use the remote goodlab-prod database.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors