Build

Build is Torpor's full-stack framework, which you can use to build flexible, interactive, and accessible sites and apps. It is built on top of Vite.

This documentation is built in Build.

Quick start

Use npm (or your preferred package manager) to create a starter project:

npm init @torpor/build@latest my-project
cd my-project
npm install
npm run dev

Folder structure

/src
	/assets
	/lib
	/routes
	/views

Pages live in routes, and the components they render live in views. See Routing.

What's in the box

  • File-based routing, with type-safe URLs — see Routing
  • Server and client load functions — see Loading Data
  • Form actions with schema validation — see Actions
  • JSON API endpoints and typed clients — see API Endpoints
  • Request hooks for auth, logging and shared data — see Hooks
  • Client-side navigation, prefetching, and the $page state object — see Navigation