A full-stack TypeScript framework for building APIs and websites on hosted servers (not serverless). Built on Fastify, tRPC, Qwik, Drizzle ORM, and Piscina worker threads.
Performance benchmarks for the framework's critical hot paths are in
benchmarks/. Run them with:
pnpm bench # interactive mode
pnpm bench:ci # single run, writes benchmarks/results.jsonBenchmarked subsystems: SharedRingBuffer (streaming SSR throughput),
SharedBuffer (worker-thread payload round-trips), safeRedirect (input
validation), promiseHash/timeout (promise utilities), and
getClientIPAddress (proxy-header IP extraction). See the
Benchmarks documentation for full details.
| Package | Description |
|---|---|
@scratchyjs/auth |
Authentication via Better Auth — Fastify plugin, session hooks, preHandler guards |
@scratchyjs/cli |
Code-generation CLI — scaffold models, routers, routes, pages, plugins, and more |
@scratchyjs/core |
Core framework — Fastify server factory, config loader, error handler, security plugins |
@scratchyjs/drizzle |
Database layer — Drizzle ORM helpers, connection pooling, schema helpers, Fastify plugin |
@scratchyjs/renderer |
Worker-thread SSR/SSG — Piscina pool plugin, SSR handler, SSG pipeline, SharedArrayBuffer comm |
@scratchyjs/trpc |
tRPC integration — router/procedure factories, auth middleware, Fastify plugin, typed client |
@scratchyjs/utils |
Server utilities — safe redirect, promise helpers, response helpers, IP/locale/sec-fetch utils |
@scratchyjs/vite-plugin |
Vite plugin — Qwik + Tailwind preset, build & server config helpers |
pnpm add @scratchyjs/core @scratchyjs/drizzle @scratchyjs/trpcSee the documentation for a full setup guide.
- Node.js >= 24
- pnpm >= 10
This repository is configured to use a self-hosted Turbo remote cache:
teamSlug:codewizardapiUrl:https://turborepo.codewizard.training
To authenticate cache reads/writes, set TURBO_TOKEN:
export TURBO_TOKEN=your_token_hereIn GitHub Actions, configure these repository secrets:
TURBO_TOKEN(for Turbo remote cache)CLOUDFLARE_API_TOKEN(Cloudflare API token with Workers deploy permissions)CLOUDFLARE_ACCOUNT_ID(your Cloudflare account ID)
Full documentation is available at scratchyjs.com.