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.
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.
data Note:
fields:
integer id primary generated
string text requiredendpoints:
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)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.
Ten plugins, pick the ones you need
| Plugin | You write | You get |
|---|---|---|
| frame.server | endpoints: | HTTP routes, middleware, server-sent events, WebSockets, email |
| frame.data | data Model: | Models, queries, transactions, migrations on SQLite, PostgreSQL, MySQL |
| frame.auth | auth: | Sessions, JWT, password hashing, roles, CSRF protection |
| frame.ui | html: component: | Server-rendered pages and interactive components, no JavaScript |
| frame.client | load: form: | Browser-side data loading and forms |
| frame.canvas | canvasScene: | 2D drawing, animation, audio and input |
| frame.jobs | jobs: | Background jobs with retries and schedules |
| frame.locale | locale: | Translations, plurals, number and date formats |
| frame.mcp | mcp: | Expose your app's tools and data to AI agents |
| frame.storage | storage.write() | Store and read files |
Build your first API
A notes API with a real database. Every command below was run on the current release.
Install the toolchain
Skip this if you already have it. New to Clean? Start at Install.
cleen install latest
cleen server install
cleen frame install latestCreate 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.
package: Notes
version: "1.0.0"
target: server
plugins: [frame.data, frame.server]
entry: app/server/main.clnstart:
Note.migrate()Build and start it
cln compile main.cln -o app.wasm --plugins
clean-server app.wasm --database "sqlite://notes.db?mode=rwc"Try it
$ 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.
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.
Learn it step by step
Short lessons that build on each other. Each one ends with code you can run.
Your First Web Server
Create a server with endpoints that respond to HTTP requests. You'll have something running in under 5 minutes.
Start →Returning HTML Pages
Serve complete HTML pages from your server. Use helper functions to keep your page structure consistent across every route.
Start →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 →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 →Saving Data to a Database
Handle POST requests and save form data to your database. Build the write side of your web application.
Start →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 →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 →Query Parameters and Search
Read URL query strings to filter results. Add search and filtering to any listing page without changing your routes.
Start →JSON API Endpoints
Return JSON instead of HTML. Build API endpoints that mobile apps, frontend JavaScript, or other services can consume.
Start →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 →