scriptorium is a searchable frontend tooling catalog built as:
- a Vite React frontend in
src/ - shared catalog contracts in
shared/ - Turso/libSQL-backed catalog services in
server/ - a Cloudflare Worker API in
worker/
The production target is Cloudflare Pages for the frontend plus a separate Cloudflare Worker for /api/search and /api/tags, with Turso as the source of truth.
GitHub Actions validates every push and pull request. Production deployment should be handled from Cloudflare:
- Cloudflare Pages for the frontend bundle in
dist/ - Cloudflare Workers for the API defined in
wrangler.toml
Recommended setup:
- Connect the Pages project to this GitHub repository in Cloudflare
- Connect the Worker to this GitHub repository with Workers Builds in Cloudflare
- Keep GitHub Actions as validation-only CI
Set VITE_API_BASE_URL in the Cloudflare Pages build environment only if production uses a separate API hostname.
Leave it unset if Cloudflare routes the frontend and API under the same origin and the browser should call /api/* directly.
Set these secrets in the Cloudflare Worker runtime, not in GitHub Actions:
TURSO_DATABASE_URLTURSO_AUTH_TOKEN
The scheduled catalog refresh workflow still reads Turso directly from GitHub Actions, so keep TURSO_DATABASE_URL and TURSO_AUTH_TOKEN configured as GitHub repository secrets for that job as well.
Install dependencies with pnpm install.
Run the frontend:
pnpm devRun the API locally:
pnpm dev:workerThis starts a Node-based local server on http://127.0.0.1:8787 and uses .data/scriptorium.db automatically when TURSO_DATABASE_URL is unset.
If you specifically need to run the Cloudflare Worker runtime in development, use:
pnpm dev:worker:cfIf you need to prepare or migrate the database schema without starting the worker:
pnpm db:prepareTo destructively reset the catalog and recreate the current schema:
pnpm db:resetPoint the frontend at the API during local development with:
VITE_API_BASE_URL=http://127.0.0.1:8787If TURSO_DATABASE_URL is not set for scripts and tests, scriptorium falls back to a local libSQL database at .data/scriptorium.db.
For an existing Turso or local database created before the current schema, run pnpm db:reset once before using the worker.
The public read API is:
GET /api/search?q&tags&source&limit&cursorGET /api/tags?source
pnpm sync:ecosystems-popularpnpm prune:ecosystems-packages
These commands update the database directly. They do not generate repo data files or commit changes.
pnpm lint
pnpm typecheck
pnpm test
pnpm build:app
pnpm build:workerVITE_API_BASE_URL: frontend API origin override for local or split-origin deploymentsTURSO_DATABASE_URL: Turso/libSQL database URL for the worker and sync scriptsTURSO_AUTH_TOKEN: Turso auth token when using remote TursoECOSYSTEMS_BASE_URL: optional ecosyste.ms API override, defaults tohttps://packages.ecosyste.ms/api/v1ECOSYSTEMS_SYNC_LIMIT: optional total number of ecosyste.ms npm packages to sync, defaults to1000SCRIPTORIUM_USER_AGENT: optional user agent for ecosyste.ms syncSCRIPTORIUM_DATA_DIR: optional local fallback database directory