# Elements vs Next.js
Next.js is an open-source web app framework for React, made by Vercel. You write pages as React components, which are React Server Components by default. A file that starts with `"use client"` marks a boundary: it and the modules it imports become Client Components, which are prerendered on the server and then also run in the browser, for state, event handlers and browser APIs ([server and client components](https://nextjs.org/docs/app/getting-started/server-and-client-components)). Next.js adds routing based on folders and file names, server-side rendering and static generation, route handlers for APIs, and Server Actions for calling server code from forms and event handlers. It ships its own bundler, Turbopack, which by default runs the `next dev` development server and the `next build` production build. Next.js apps run on Node.js, and they deploy to Vercel's hosting platform or to a server you run yourself.
Elements is an integrated app environment for building web apps, built for people and their agents. At its center is a project server that runs while you work, and around it the same system includes a package installer, a test runner, a bundled Postgres database, and a deploy command for any Ubuntu server you reach over SSH. It ships with a default framework that just works: routing, server rendering, typed server functions, sessions, realtime data, background jobs and email, with pages written in Elements HTML, standard HTML with reactive expressions. Elements apps are written in TypeScript and run on Node.js.
The difference is design, and who pays for it. Next.js is an open-source framework that Vercel, a venture-backed hosting company, develops, funds and gives away, and Vercel sells hosting ([governance](https://nextjs.org/governance), [Vercel pricing](https://vercel.com/pricing)). On top of web standards that have existed for decades, HTML, HTTP caching headers, cookies, forms and URLs, Next.js has built its own layer: special file names and folder patterns for routing, directives that decide where code runs and what gets cached, an image component, a font loader, and two caching models chosen by a config flag. Past the plumbing every app needs, each one is another thing to learn and debug. Elements gives you the primitives a web app needs, working out of the box: sessions, HTTP caching, HTML templates and routing. A route is one line of code, a page is HTML, an image is an `
` tag, a server call is a typed function call, and the session is already there. The same system also brings the database, migrations, tests and deploy that a Next.js app adds from other libraries.
## At a Glance
| | Elements | Next.js |
|---|---|---|
| What it is | A project server, a default framework, Postgres, tests and deploy, shipped as one coherent system | A React framework with a bundler and dev server |
| Business model | Sells the system you build with, per machine, and you deploy to commodity servers at your provider's price ([pricing](/pricing)) | A venture-subsidized open-source framework, developed at Vercel, which sells hosting for a fee per seat plus metered usage ([governance](https://nextjs.org/governance), [Vercel pricing](https://vercel.com/pricing)) |
| Templates | [Elements HTML](/learn/man/html): standard HTML with typed reactive expressions | React components in JSX, split into server and client components |
| Routing | [One `app.route()` line per URL](/learn/man/router), using the web standard `URLPattern` | Folders, with nine special file names and ten folder-name patterns |
| Request data | `req.params` and `session`, plain values | `params`, `searchParams`, `cookies()` and `headers()` are Promises you await |
| Directives | None; a `@rpc` comment marks a server function | `"use client"`, `"use server"`, `"use cache"`, and two variants of `"use cache"` |
| Server functions | [`@rpc`](/learn/man/rpc): typed calls for reads and writes, checked at compile time | Server Actions: for mutations, sent as POST requests, one at a time |
| Sign-in and sessions | [Built in](/learn/man/session), the same over HTTP and WebSockets | Build it yourself, or pick one of twelve libraries the docs list |
| Caching | Automatic, on the HTTP standard: every page gets an ETag and unchanged pages answer 304, every asset has a hash in its file name and is cached by the browser and any CDN in between, and signed-in pages stay private ([server rendering](/learn/man/html/server), [assets](/learn/man/assets)) | `"use cache"` with `cacheLife` profiles, or segment config options with that model switched off; Next.js writes the header |
| Images | Standard `
` and `` tags; [files content-hashed](/learn/man/assets) and cached long term | `next/image`, resized and converted at request time; metered on Vercel |
| Database | [Postgres, bundled](/learn/man/database), with `sql()` built in | Bring your own database and client |
| Migrations | [Applied when you save them](/learn/man/migrations) | Not included |
| Tests | [Part of the build](/learn/man/tests) | Not included; the docs cover four outside tools |
| Realtime | [LiveTable](/learn/man/livetable) and [channels](/learn/man/channel) | Not included |
| Background jobs and cron | [Built in](/learn/man/jobs) | Not included |
| Email | [Built in](/learn/man/email); templates use the page syntax | Not included |
| Build errors | [Every one in one report](/learn/man/build): tests, migrations, program analysis and type checking, found in milliseconds as you work | Type errors at `next build`; tests and migrations run in outside tools |
| Deploy | [`elements deploy`](/learn/man/deploy) to any Ubuntu server over SSH, often under a second | Vercel, or self-host with `next start` or Docker |
## Abstractions Over Decades-Old Standards
The web already has a standard for most of what an app does. HTML has `
`, `` and `