# Sluurp > Sluurp is one executable that serves a backend and its app: collections of data in SQLite with rules enforced in SQL, a REST, realtime and sync API, authentication, an admin UI at `/_/`, server-drawn pages and islands, and a UI kit, with no build step and no `npm install`. Each page below links to its Markdown source. `/llms-full.txt` holds every page's text in one file. ## How to work with Sluurp - **An app is a folder**, served with `sluurp serve --public ./my-app`. The folder a file sits in decides what it does. `routes/` holds pages drawn on the server, `islands/` holds components that come alive in the browser, and `functions/`, `hooks/`, `jobs/`, `agents/` and `views/` hold server code. The data model is in `schema.json`. There is no config file. - **There is no build.** TypeScript and JSX are compiled as they are served. Imports are bare names from the import map Sluurp writes into every page: `sluurp` (the client), `sluurp/reactive` (signals), `sluurp/ui` (JSX runtime and templates), `sluurp/kit` (components in the shadcn style), `sluurp/sync`, `sluurp/pages`, and others. npm packages are added with `sluurp add `, which vendors their source into `vendor/`. - **Styling is Tailwind classes**, written straight into markup. The stylesheet is made from the classes the app uses. Theme colours are CSS variables, as in shadcn. - **Data** goes through the `sluurp` client: `sluurp.collection("todos").list({ filter, sort })`, `.create()`, `.update()`, `.delete()`. A list that stays current by itself is a Sync shape (`sluurp/sync`). Every call is checked against the collection's rules, which are compiled into SQL. On the server, code gets the same API through `server` and acts as the caller. - **Server code** runs in a QuickJS sandbox, with no file system, no `process`, and network access only through `fetch` to public addresses. Each call has a memory ceiling and a deadline. ## How to write a website with Sluurp - **A Markdown page** is a `.md` file under `routes/`; `routes/docs/sync.md` is `/docs/sync`. Its front matter gives `title`, `description`, and optionally `section` and `order` for a sidebar. Code fences can carry a `title="file.ts"` caption, and are highlighted on the server. - **A TSX page** is `routes/*.tsx`. Its default export is drawn on the server. It can load data first (`export async function load()`) and include islands. - **Layouts** are `_layout.js` files: `render(state, html)` wraps every page in that folder and the folders below it. `state.pages` lists the Markdown pages beside it, with their front matter, to make a sidebar from. - **Islands** are `islands/.tsx`, placed in a page with ``. Only islands send JavaScript to the browser. - **Publishing:** `sluurp static --public ./site --out dist` writes the site out as plain files for any file host, with its islands still working. Or serve it with `sluurp serve` behind a TLS proxy. - **Each Markdown page's source** is served at its URL plus `.md`, and `/llms.txt` is made from those pages, as this file was. ## Start - [Getting started](/docs/getting-started.md): Run Sluurp, make an administrator, serve a folder. - [An app's shape](/docs/apps.md): The folders a Sluurp app is made of, and what each becomes. - [Why SQLite](/docs/why-sqlite.md): Why an embedded database, what it costs, and how fast Sluurp is on it. ## Data - [Collections and rules](/docs/collections.md): Real tables, and rules compiled into the SQL that reads them. - [History and AS OF](/docs/history.md): Every change kept, with who, when and why; any collection read as it stood. - [Sync](/docs/sync.md): Shapes of collections kept current in the browser over one WebSocket, in memory or SQLite. - [Batches and reasons](/docs/batch.md): Several writes as one transaction, with a reason kept for each change. - [Sign-in and users](/docs/auth.md): Accounts, passwords, sign-in links, providers, two-factor codes, invitations and who may do what. - [Files and images](/docs/files.md): Uploads kept with their records, under their rules, and images resized on request. - [Existing SQLite databases](/docs/attach.md): Use a database you already have, in place, as collections. - [Migrations](/docs/migrations.md): An app's data model and its data, versioned and run in order, as Flyway runs them. - [REST API](/docs/api.md): The HTTP API every collection gets, with its filters, sorting, paging and errors. - [Rules](/docs/rules.md): The rules language, what a rule can name, and how rules on collections and fields are enforced. - [Browser client](/docs/client.md): sluurp.js, the client every page can import, and what each part of it does. - [Realtime](/docs/realtime.md): Every change to a collection as it happens, each row read as the person watching. - [Search by meaning](/docs/search.md): Rows found by what they mean rather than the words they use, with vectors kept in SQLite and nothing to set up. ## Server - [Functions and "use server"](/docs/server-functions.md): Endpoints in a folder, and functions written in a page that run on the server. - [Server components and islands](/docs/server-components.md): routes/*.tsx and routes/*.md rendered on the server; islands where something moves. - [Agents](/docs/agents.md): Code that watches a collection and acts on each change, with a model or without. - [Hooks and events](/docs/hooks-and-events.md): Change a record before it is written, say what happened, and act on it elsewhere. - [Mail](/docs/mail.md): Send email from hooks, agents, jobs and server functions, through one mail server set up in the admin UI. - [Scheduled jobs](/docs/jobs.md): Code that runs on a schedule, from an app's jobs/ folder. - [Payments and billing](/docs/payments.md): A catalogue, charges and subscriptions, invoices, and payments online, by transfer or in cash. - [AI](/docs/ai.md): An optional language model, Claude or one on your own machine, for chat, drafting and agents. ## Frontend - [Pages and charts](/docs/pages.md): A Notion-like editor any app can mount, and charts said in a sentence. - [Packages, bundles, budgets](/docs/vendoring.md): npm packages vendored as source, bundled at start, held to a budget. - [UI kit](/docs/ui-kit.md): The components Sluurp ships, ready to import in any page. - [Translations](/docs/translations.md): Every word of the app in every language it speaks, edited live in the page by translators working together. - [Hot reload](/docs/hot-reload.md): Save a file and the page changes in place, keeping what you were doing. - [Live views](/docs/live-views.md): Server-rendered views whose state stays on the server; the browser sends events and gets back only what changed. ## Operations - [Deploying](/docs/deploying.md): Run Sluurp on a server, with HTTPS in front, backups and upgrades. - [Admin UI](/docs/admin-ui.md): A dashboard for every collection, and for running the server, at /_/. - [Security](/docs/security.md): What Sluurp does against the common attacks on web apps, and what is left to you. - [Static sites](/docs/static-sites.md): Publish an app as plain files, for GitHub Pages or any file host, with its islands still alive. - [Command line](/docs/cli.md): Every sluurp command, what it is for, and the options used most. ## Development - [Development](/docs/development.md): Build Sluurp from source, run it while you change it, and test it. ## Pages - [Docs](/docs.md): Everything Sluurp does, and how to build on it. - [Examples](/examples.md): The example apps in the repository, what each shows, and how to run it.