Basil Server Manual
Basil is a web server that runs Parsley handlers. Drop a .pars file in a directory and it becomes a route. One binary, almost no configuration, no build step — with a database, authentication, search, and an image server already inside.
New to Basil? The Get Started tutorial takes you from install to a working site in ten minutes.
The Server
| Page |
Description |
| Running Basil |
Install, --init, dev mode, CLI commands, and signals |
| Configuration |
The basil.yaml file — every section explained |
| Routing |
Site mode, folder-named handlers, explicit routes, and static files |
Features
| Page |
Description |
| Database |
The built-in SQLite database, @DB, and the database inspector |
| Authentication |
Passkey login, users, roles, protected paths, and API keys |
| Session Management |
basil.session — key-value storage and flash messages |
| Parts |
Interactive components that update without page reloads |
| Parts JavaScript API |
Script your Parts — window.Parts, events, and cross-Part targeting |
| Search |
Full-text search over your content with @SEARCH |
| Images |
Image transformation, smart crop, and responsive srcsets |
| Git Deploy |
Push-to-deploy over HTTPS with the built-in Git server |
Guides
In-depth walkthroughs of Basil's larger features.
| Page |
Description |
| The Authentication Guide |
Auth in depth — sessions, recovery, email verification, and CSRF |
| The Parts Guide |
Parts in depth — nesting, lazy loading, loading states, and error handling |
| The Search Guide |
Search in depth — indexing, ranking, query syntax, and manual documents |
Handler API
Globals, modules, and objects available inside server handlers.
| Page |
Description |
| Server Globals |
@params, @env, @args, publicUrl(), and the CSRF token |
| @basil/http |
The request/response context — request, response, route, method |
| @basil/auth |
The per-request session, auth, and user |
| @basil/api |
Auth wrappers, error helpers, and redirect for handlers |
| @basil/log |
Development logging utilities for handlers |
| @basil/html |
Accessible HTML form and UI components |
Development & Production
| Page |
Description |
| Dev Tools |
Hot reload, the dev log panel, and error pages |
| Deployment |
TLS, production mode, compression, CORS, and security |
Reference