@torpor/build
v1.6.1
Published
A framework for building sites and apps with Torpor
Downloads
2,537
Readme
torpor/build
A framework for building sites and apps with Torpor.
Built on top of Vite.
Installation
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 devFeatures
- Configure the
Siteclass in yoursite.config.tswith routes and adapters - Setup code-based routing (with
site.addRoute) - Or file-based routing (with
site.addRouteFolder) - Pages and API endpoints, with layouts and error pages
- A
tbcommand line interface:tb --dev-- start the dev servertb --build-- create a production buildtb --preview-- preview the production buildtb --openapi [outFile]-- generate an OpenAPI document
- Adapters for deployment targets -- see @torpor/adapter-node, @torpor/adapter-cloudflare and @torpor/adapter-electron
- Schema validation for endpoints (
@torpor/build/schema) - Form helpers (
@torpor/build/form) and client side navigation helpers (@torpor/build/nav) $pagestate for pages (@torpor/build/state) and response helpers (@torpor/build/response)
Folder structure
- /src
- /assets
- /components
- /lib
- /routes
- /api
Maybe
Ideally, sites built with torpor/build will be easy to get set up and running, with flexible overrides for complex uses.
- middleware setup for auth etc
- file-based routing by default, with programmatic overrides
- type-safe routing and fetching
- type-safe websocket communication
- immediate or scheduled background tasks
- authentication and authorization
- localization and internationalization
- logs and (basic) analytics
Routing
TODO:
File based routing with overrides.
Layouts
TODO:
Middleware
TODO:
API versioning
TODO:
