The build server for web apps.

Built for humans, and their AI agents.

Elements is a build server, app framework, Postgres database and deployment, engineered as one system.

curl -fsSL https://elements.dev/install | sh
View script

Read the getting started guide.

EditorsAgentsTerminals$elements build$elements test$elements install$elements deployBuild serverOne build state shared by every clientSyncConfigInstallCrawlCheckEmitTestMigrateReleaseFile watcherwatchreleaseAppyour codeapp frameworkPostgresdeployYour serversover SSH

Tools

Every command connects to the build server that is already running and reads the current build. Every command takes -json for your agent.

  • Config
  • Install
  • Build
  • Migrate
  • Test
  • Deploy

Build server

Maintains one build state, as one source graph, for every client. Builds in milliseconds and answers in microseconds.

Phases of a build

  1. Sync
  2. Config
  3. Install
  4. Crawl
  5. Check
  6. Emit
  7. Test
  8. Migrate
  9. Release

Infrastructure

  • File watcher
  • File tree
  • Resolver
  • Source graph
  • Type checker
  • Program analysis
  • Hot reload
  • LSP

App framework

HTML and TypeScript, type checked as one program. The browser calls a server function directly, and server code cannot reach the browser.

  • HTML
  • Routing
  • RPC
  • Sessions
  • SQL
  • Transactions
  • Live tables
  • Channels
  • Jobs
  • Cron
  • Email
  • Payments

Postgres

The database for your app, already running. A migration is a SQL file, and the build server applies it when you save it, to the test database first.

Deployment

One command deploys to servers you control. The tests pass on the server before the release goes live, and only the changed files are sent.

  • SSH
  • Clusters
  • Load balancer
  • TLS certificates
  • Domains
  • Maintenance page

Built for

Elements is built for one person building a business alone at a laptop, and it scales to engineering teams, enterprise applications and a team of agents on VMs.

  • Enterprise applications. Elements began at a fast growing healthcare fintech company, where a team of engineers built the company's systems on it: hundreds of millions of dollars in transactions, scaled to a multi-machine architecture with HIPAA compliant security.
  • A person, a team, an agent, or a team of agents. An agent needs the same three things as an engineer: one build server, the same build state and the same diagnostics. Every machine runs the same build with the same checks, so the same architecture serves all of them.
  • The build matters more the larger the app gets. You or your agent can change a schema in a codebase nobody remembers and find out immediately that it broke something three files away. An app you released six months ago is still one you can change with confidence.

Build server

The build server stays running and maintains the build state as one source graph. Your terminal, your editor and your agents all connect to the same build server and read the same build. It watches your files and automatically runs a build when a file or a package changes. A build of one saved file takes milliseconds.

elements build
State: Ok
Elapsed: 0.000006s
j/k: down/up G/g: bottom/top y: copy q: quit

A second elements build -json against an unchanged project answers in microseconds.

elements build -json
{
"path": "/Users/cmather/elements/projects/myapp",
"ok": true,
"errorCount": 0,
"warningCount": 0,
"message": "The build is ok.",
"buildGen": 15,
"buildRanAt": "2026-09-21T12:08:15.74752-07:00",
"started": "2026-09-21T12:09:41.121451-07:00",
"finished": "2026-09-21T12:09:41.121457-07:00",
"elapsedSeconds": 0.000006
}

When code in the browser can reach a database call, the build is in the error state. The error names the file, the line and the fix.

elements build
State: Error
Elapsed: 0.000010s
ERRORS:
You have 1 error:
1. app/pages/home/template.ehtml:6:10
Security error: cannot call server code from the browser without going through an rpc
function.
Try:
Put the server code inside a function with an @rpc build tag. For example:
/**
* @rpc
*/
export function fn() {}
Then call fn().
5: function onSignIn(email: string) {
6: return db.query`select id from users where email = ${email}`.first();
7: }
Call stack:
2. app/pages/home/template.ehtml:6:10 sql
1. app/pages/home/template.ehtml:32:49 onSignIn
j/k: down/up G/g: bottom/top y: copy q: quit
  • One source graph, one set of diagnostics. Every phase of the build reads the same source graph, and your editor, your terminal and your agents get the same diagnostics. Each file is read once and parsed once. The graph has four views of those files: server runtime, server types, browser runtime and browser types. The disk is one layer, and each editor has a layer for its unsaved text.
  • Tests pass before the app database changes. The Test phase migrates the test database and runs the tests. The Migrate phase changes the app database, and it runs only if the tests pass.
  • Already built when you ask. The build has run by the time you or your agent asks for the result: type check, program analysis, migrations and tests. The build server already has the result, so checking costs microseconds instead of seconds, and you and your agent can check after every change rather than at the end. Your agent corrects the code before reporting the work finished.
  • Server code cannot reach the browser. A database call that the browser can reach is a build error, and a build with an error is never released.
  • Tests are part of the build. A test file is rerun when its code or its imports change, and each test runs in a transaction that rolls back. A typical test takes a few milliseconds, so the tests become how you find out what you broke.
  • Packages install as part of the build. The package installer is npm compatible. Install a package at version local and it resolves from your package search path, is watched like your project's own files, and is deployed with the app. No monorepo, no file links.

App framework

A page is one .ehtml file: standard HTML with TypeScript expressions. The build server type checks the page, and the page updates when its data changes.

app/pages/users/template.ehtml
<html ( title: string, users: User[], )> <h1>{title}</h1> <ul> <li e:for={user of users}> {user.name} ({user.age}) </li> </ul> <p e:if={users.length === 0}>no users yet</p> <p e:else>{users.length} users</p> </html>

A function with the @rpc build tag runs on the server, and the browser calls it by name.

app/shared/services/users.ts
/** @rpc */ export function createUser(form: UserForm): User { return db.query<User>` insert into users ( name, email ) values ( ${form.name}, ${form.email} ) returning * `.firstOrThrow("insert returned no row"); }

The app framework was built for production applications, and each part was added because an app needed it. Next.js and the other frameworks that accumulated their features as add-ons over the years have rendering modes, hooks and caching directives. Elements has none. The design philosophy is simple. Keep the framework's own abstractions to a minimum, so nothing gets in the way of you or your agent. Stick to the standards: HTML, TypeScript, SQL and CSS. Then give the primitives super powers. A server function is called from the browser like any function. A page is HTML that updates when its data changes. A query is SQL. A live table keeps every browser in sync.

  • Every building block an app needs. Routing that serves pages and APIs alike, rpc functions, reactive HTML, sessions, SQL and migrations, live tables, channels, jobs and email.
  • Live tables. Declare the set of rows a page needs and every browser subscribed to those rows stays current. An insert, update or delete reaches every subscribed browser, and the browser that made the change shows it before the server has answered.
  • A complete library of UI templates. The ui package holds the most used UI templates on the web, written in Elements HTML: dialogs, menus, command palette, forms, combobox, date and range pickers, data table, charts, kanban, the RichText and CodeEditor editors, and the chat templates for an AI app. Pick a theme and every template changes its look.
  • Standard HTML, made reactive. The page renders on the server, then runs in the browser. When its data changes, the Elements browser runtime patches only what changed, and an interaction needs no round trip to the server.
  • Jobs and email. Queue work off the request path, or schedule it. A job server starts with the project, on your machine and on every machine you deploy to. Write mail in the same Elements HTML as your pages.
  • File uploads. Bind a file input to a File or File[] and the browser reads the bytes for you. An rpc stores them in Postgres or in any object store.

Postgres

Postgres is the database for your app. A migration is a SQL file. Save the file and the build server applies it to the test database, then to the app database once the tests pass.

app/migrations/20260509120000-add-comments-table.migration.sql
create table comments ( id uuid primary key default uuidGenerateV7(), createdAt timestamptz not null default now(), updatedAt timestamptz not null default now() );
elements db migrate
State: Ok
Elapsed: 0.035618s
MIGRATIONS:
node_modules/@elements/app/migrations/2026-07-11-000000-app-baseline.migration.sql [ok]
The application framework baseline migrations.
app/migrations/20260915155829-add-chat.migration.sql [ok]
add chat
j/k: down/up G/g: bottom/top y: copy q: quit
  • A migration is a .sql file. A migration is SQL you already know, with no migration DSL to learn, which is why your agent writes and edits migrations correctly. You can run a migration file directly against a database.
  • Edit a migration and save again. In development, Elements restores the database to its state before that migration and applies the new version.
  • SQL in your code. There is no ORM API for you and your agent to learn or get wrong, only SQL your agent writes fluently and you can read. Each value you put in a db.query template becomes a query parameter at build time.

Deploy

One command deploys to servers you control, peer to peer over SSH.

elements deploy
State: Ok
Elapsed: 0.720184s
  • Tested before it goes live. On every deploy, Elements migrates the test database and runs the tests on the deploy machine. A failing test or migration stops the deploy, and the previous release keeps serving. A deploy is atomic: it either succeeds completely or the release is halted, and nothing reaches your users until every step has passed.
  • Only the files that changed. Your build server sends each machine a list of file hashes, and only the changed files are uploaded.
  • No restart. The running app hot reloads the changed modules, and every connected browser reloads with it.
  • Add a machine. Add a machine to config.jsoc and deploy. The machine joins the cluster.
  • TLS certificates. Elements issues each certificate through Let's Encrypt and renews it.
  • No cold starts. Every app server is a long-running process, so there are no cold starts. A cluster of low-cost servers serves the traffic a serverless platform meters you for.
  • Managed Postgres in production. Point your app at a managed Postgres such as Amazon RDS by putting its connection settings in your app's config. There are no row-level security policies to write, because nothing in the browser reaches the database: queries run in server functions.
  • Any Ubuntu server, at any provider. Elements provisions the machine, builds the release, runs the migrations and hot reloads the app. Each deploy installs the Elements binary, your packages, the load balancer and the certificates, and keeps them current. There is no console to configure, no pipeline to maintain and nothing to set up on the machine by hand.
  • No queue, no container image. A deploy does not wait behind other people's builds, and there is no container image to assemble and push.
  • The same fixed sequence every time. Your agent runs elements deploy -json and reads the result. It never copies files to a machine, edits a running server or restarts a service by hand.
  • Load balancing on every machine. Every machine runs its own load balancer and they find each other automatically. Whichever machine takes a request balances it across the cluster, with failover to the ones still answering.

Apps

You can build anything.

  • Rebuild your SaaS subscriptions. Ten subscriptions, with different interfaces and databases, can be consolidated into one central application that you update by talking into your phone with an AI agent.
  • Rebuild your internal tools. You and your agent build the UI, with data tables, charts, forms and date pickers over data that stays current in every open browser. You pay per machine, not per user.
  • Products and stores. Sign-in, sessions, payments, email and background jobs are built in. A store is Stripe Checkout with one secret key, and orders, inventory and receipts live in the same database as the rest of the app.
  • AI apps. An AI assistant is a channel streaming the model's reply into the page, with the model's SDK installed from npm like any package.
  • Content and marketing sites. Content is rows in Postgres and goes live on the next request. Publishing a post is a form in your app, with no rebuild and no separate CMS. A newsletter or a CRM later is the same app.
  • Start from a demo. Every demo is a starting point. Each one has its source on GitHub, and you and your agent can create your app from it with one command.

No lock-in

You pay for Elements, and you own everything you build.

  • MIT licensed runtime packages. @elements/app is MIT licensed, and it has the runtime your Elements HTML runs on. @elements/ui is MIT licensed too. A built app runs on plain Node.js. The paid tooling is the build server, the test runner and deploy.
  • Standard languages you and your agent already know. Elements was built with painstaking care to stay on standards. Pages are plain HTML in .ehtml files. The only new syntax is a constructor, expressions in braces and a few directive attributes. Anyone who knows HTML can read and change a page, which makes a page easier to maintain than a React component. Logic is TypeScript, queries and migrations are SQL on Postgres, and styles are CSS. Agents have read more of these languages than any framework's own, so they write them well.
  • A modular package system. The app framework is one package and the ui package is another. You add a package to your app with the elements install command, and any package from the npm ecosystem installs the same way.
  • Any agent, any model. Use the agent you have today and switch when a better one comes out.
  • Pay for Elements, not for your success. Elements is one subscription per machine, at a fixed price. The price is not based on traffic, requests or revenue. You keep the agent subscription you already have, with no credits per prompt.
  • Start a real app on the free trial. A real app, not a sandbox: the database, sessions, jobs, email and deploy are there from the first prompt. Everything you and your agent write is yours.
  • Community, without gatekeepers. We value the people building on Elements. We do not value gatekeepers. In the age of AI, standard languages and concepts matter, not framework abstractions only insiders can read. Building on Elements teaches you HTML, TypeScript, SQL and CSS, and that knowledge goes wherever you go.

Issues

Elements has an issue tracker built for agents. Your agent files a question, an idea or a bug from the terminal, and every issue is looked at automatically.

  • Filed by your agent. elements issue new needs no browser, and every issue command takes -json. Your agent tells you in one line what it filed and continues your task.
  • Fixed in a release. The Elements Team reads every report. A fix or an improvement is released to every project in a later release, yours included.
  • The state of every issue. elements issue list shows the issues you filed and the state of each one: in progress, resolved, or released in a version. The weekly email lists your issues that changed state.
  • None of your code is sent. A report describes how Elements behaved. It includes none of your code or files unless you say so. Your agent asks you to sign in once with elements login before it files a report.
  • Trials count as much as paid accounts. A question asked in the first hour with Elements gets the same attention as one from a paid account.
  • Each project makes the next one easier to build. An agent building an app reads every diagnostic and every manual page it uses, so its ideas are specific. Each report goes into the work on the next release.

Answers

  • You pay for tooling, not for hosting. We get paid for the tooling, not for your app. The tooling is the build server, the test runner and deploy, and the app you build is yours. Other frameworks, such as Next.js, are free because the company that makes the framework sells the hosting. You pay that company when your app runs on its servers, and the bill grows as your app does. The price of Elements does not change with your traffic.
  • You own the app you build. The runtime packages, @elements/app and @elements/ui, are MIT licensed. An app on a free framework needs several subscriptions to work: hosting, sign-in, background jobs and realtime. Each subscription is a vendor your app depends on, with its own bill. In Elements sign-in, jobs and realtime are built in, and deploy is one command. The code is in your repository, the data is in Postgres, and the app runs on servers you control.
  • Your agent reads the manual on your machine. The manual ships in the elements binary and matches the installed version. elements create writes an AGENTS.md into the project that tells your agent to read the manual. When the agent writes a mistake, the build reports the file, the line and the fix.
  • Any engineer can work on an Elements app. An engineer who knows HTML, TypeScript and SQL can read an Elements app and change it. The manual is on their machine, and the build reports a person's mistakes the same way it reports an agent's.
  • Help from the terminal. elements man prints the manual for the version you have installed, and elements man -s searches it. Your agent reads the same manual, so its answers match the version in your project. You or your agent can file a question from the terminal with elements issue new -kind=question, and every question is looked at automatically. You can also ask in the community.
  • A deploy machine needs no backup. The code is in your repository and the next deploy rebuilds the release. Each deploy keeps the load balancer, the TLS certificates and the Elements binary current, and Ubuntu installs security updates on its own. In production your data is in a managed Postgres such as Amazon RDS, and the provider handles backups and failover.
  • You choose when to upgrade. A new version of Elements is installed when you run elements upgrade, and each release has a changelog page that lists the changes a project needs. A deploy with a failing test or a failing migration stops, and the previous release keeps serving.
  • A bug in Elements is fixed in a release. Your agent files the bug from the terminal with elements issue new, and the fix is released to every project in a later release.
  • A complete UI library, built in. The templates in the ui package are built on the browser's own elements where the browser has one, so keyboard, touch and accessibility come from the browser vendors. The templates are installed and type checked, with nothing from a third party to connect. Stay on a React framework only to keep React components you already have.
  • Agents don't need framework ecosystems. Packages are great: your agent can install any npm package in Elements, from Stripe's SDK to a charting library. What an agent doesn't need is a framework ecosystem: the layer of adapters and wrapper libraries that frameworks like React and Next.js depend on for auth, data, forms and state. Each one is another API, with its own versions and conventions, for your agent to learn and get wrong. That layer mattered when humans wrote most of the code, because it meant answers to framework-specific problems and people to hire who knew the framework. What matters now is what makes the agent productive: standard languages it writes fluently, the primitives a real app needs built in, and a build that reports whether each change is correct. An Elements app has all three. Read Ecosystems in the era of AI.

Build your app on Elements.

Install Elements to start your 14-day free trial.

curl -fsSL https://elements.dev/install | sh
View script

Read the getting started guide.