Frame: full-stack apps in plain Clean

Routes, database models, login, pages and background jobs, each in a few readable lines. The compiler checks them all and ships one WebAssembly file.

See it

A database and an API in 15 lines

A data block describes the table. An endpoints block describes the routes. Frame writes the plumbing in between.

The compiler checks both sides. A typo in a field name stops the build, so it never reaches your users.

app/data/models/Note.cln
data Note:
	fields:
		integer id primary generated
		string text required
app/server/api/notes.cln
endpoints:
	GET "/api/notes":
		list<Note> notes = Note.find:
			order: id desc

		return json(notes)

	POST "/api/notes":
		any input = json.tryTextToData(body())
		if input == none
			return badRequest("Send JSON like {\"text\": \"...\"}")

		Note note = Note()
		note.text = input.text.toString()
		Database.save(note)

		return json(note)
Why Frame

One language from database to browser

One language, front to back

Server, database, pages and browser code share one type system and one set of errors.

Say what, not how

Blocks like endpoints, data and auth describe what you want. Frame generates the rest.

Safe by default

Queries are parameterized, page values are escaped, passwords are hashed and CSRF is checked.

One file to deploy

Your app compiles to one .wasm file that runs on Clean Server. No node_modules.

AI writes it right

A small, regular syntax and built-in AI tools help assistants write correct Frame code the first time.

Use only what you need

A JSON API needs two plugins. Add pages, login or jobs when you get there.

What's inside

Ten plugins, pick the ones you need

PluginYou writeYou get
frame.serverendpoints:HTTP routes, middleware, server-sent events, WebSockets, email
frame.datadata Model:Models, queries, transactions, migrations on SQLite, PostgreSQL, MySQL
frame.authauth:Sessions, JWT, password hashing, roles, CSRF protection
frame.uihtml: component:Server-rendered pages and interactive components, no JavaScript
frame.clientload: form:Browser-side data loading and forms
frame.canvascanvasScene:2D drawing, animation, audio and input
frame.jobsjobs:Background jobs with retries and schedules
frame.localelocale:Translations, plurals, number and date formats
frame.mcpmcp:Expose your app's tools and data to AI agents
frame.storagestorage.write()Store and read files
Tutorial · 5 minutes

Build your first API

A notes API with a real database. Every command below was run on the current release.

1

Install the toolchain

Skip this if you already have it. New to Clean? Start at Install.

Terminal
cleen install latest
cleen server install
cleen frame install latest
2

Create four files

Frame finds code by folder: app/data/ holds models, app/server/ holds server code. The model and the API are the two files shown above.

notes/ ├── main.cln └── app/ ├── data/models/Note.cln └── server/ ├── main.cln └── api/notes.cln
main.cln
package: Notes
	version: "1.0.0"

	target: server
		plugins: [frame.data, frame.server]
		entry: app/server/main.cln
app/server/main.cln
start:
	Note.migrate()
3

Build and start it

Terminal
cln compile main.cln -o app.wasm --plugins
clean-server app.wasm --database "sqlite://notes.db?mode=rwc"
4

Try it

Terminal
$ curl -X POST localhost:3000/api/notes -d '{"text":"Hello from Frame"}'
{"id":1,"text":"Hello from Frame"}

$ curl localhost:3000/api/notes
[{"id":1,"text":"Hello from Frame"}]

Your notes are saved in notes.db. To use PostgreSQL, change only the --database URL.

Questions

Common questions

Do I need to write any JavaScript?

No. Pages render on the server with html: blocks, and interactive parts are component: blocks compiled to WebAssembly.

Which databases are supported?

SQLite, PostgreSQL and MySQL. Models and queries stay the same. Only the database URL changes.

How do I deploy a Frame app?

Copy the .wasm file to your server and run it with Clean Server behind nginx or Caddy. See Clean Server for a production setup.

Is Frame ready for production?

Frame is in beta. This website runs on it in production: server, database and browser code.

Tutorials

Learn it step by step

Short lessons that build on each other. Each one ends with code you can run.

11beginner

Your First Web Server

Create a server with endpoints that respond to HTTP requests. You'll have something running in under 5 minutes.

Start →
12beginner

Returning HTML Pages

Serve complete HTML pages from your server. Use helper functions to keep your page structure consistent across every route.

Start →
13beginner

Route Parameters

Read values from the URL path and use them to serve dynamic content. One endpoint handles /users/alice, /users/bob, and every name in between.

Start →
14beginner

Reading from a Database

Connect to MySQL and query your data. Display database records in a web page using db.query and json.get.

Start →
15intermediate

Saving Data to a Database

Handle POST requests and save form data to your database. Build the write side of your web application.

Start →
16intermediate

Building Reusable Components

Create functions that return HTML — Clean Language's component model. Write a card, a button, or a nav bar once and use it everywhere.

Start →
17intermediate

Listing Records from a Database

Fetch multiple rows and render them as a list. This pattern powers every feed, search result, and dashboard in your app.

Start →
18intermediate

Query Parameters and Search

Read URL query strings to filter results. Add search and filtering to any listing page without changing your routes.

Start →
19intermediate

JSON API Endpoints

Return JSON instead of HTML. Build API endpoints that mobile apps, frontend JavaScript, or other services can consume.

Start →
20intermediate

Putting It All Together

Build a complete bookmarks app — add URLs, list them, view them. Every pattern from this track working together in one real project.

Start →
Copied!