# When to Use Alepha

Alepha fits an app that has a server, or will have one: an API, a database, users, background
work, pages rendered on the server. It fits from the first route, because no layer is
required up front and a small app runs for free. This page says where it is a good choice,
what you take on by choosing it, and where another tool is the better one.

## A good fit

- **A small app you want online today.** One route in one file is a complete app, and one
  command deploys it. See the next section.
- **An app you expect to grow.** The database, the sign-in, the jobs and the admin are added
  to the same project, in the same layout. There is no move from a starter stack to a real
  one.
- **An app you write with a coding agent.** Every feature is a `$` primitive declared where
  it is used, with no file-system routing and no decorators to guess at, and
  [the docs ship in the package](https://alepha.dev/docs/guides-docs-for-agents.md) at the version you installed.
- **An app that must not depend on one host.** The same build runs on Cloudflare Workers and
  in a container on any machine. Moving is a build flag.
- **A product several customers each change a little.** An app can replace a page, a service
  or a setting of a module it installed. See [Extending a Module](https://alepha.dev/docs/guides-core-extending-a-module.md).

## What a hello world costs

The whole app:

```typescript filename="src/main.server.ts"
import { run } from "alepha";
import { $route } from "alepha/server";

class App {
  hello = $route({
    path: "/",
    handler: () => "Hello, Alepha!",
  });
}

run(App);
```

Creating it and putting it online:

```bash
npm create alepha my-app -- --infra cf
cd my-app
npx alepha deploy
```

A small app fits Cloudflare's free plan, so this costs nothing to run. The project the
command creates also holds an example API and a React page: keep them, or delete `src/web/`
and reduce the entry file to the route above. Either way it comes with strict TypeScript,
a linter, a test runner and an `AGENTS.md`, so a small app written fast is still checked
like a large one.

The dependency injection and the classes are there from the first line, and at this size
they cost one `class` keyword. They are what lets the app take a database or a job later
without being restructured.

## The trade-offs

- **The ecosystem is young.** Alepha has fewer users than the frameworks you already know,
  so fewer answers are a search away and third-party plugins are rare. What stands in for
  them is in the box: the guides and the reference in the package, a
  [dev server a coding agent can drive](https://alepha.dev/docs/guides-core-dev-mcp.md), and source you can read
  and patch. Expect to read the documentation rather than a forum.
- **It is integrated.** The ORM, the server, the jobs and the router are designed together,
  and you do not pick each from a list. If choosing every library yourself matters to you,
  this is the wrong tool. What integration does not mean is sealed: every provider is
  replaceable, the source can live in your project, and what you write is Zod, SQL and
  React. See [Owning Alepha](https://alepha.dev/docs/guides-owning-alepha.md).
- **The frontend is React.** An API with no frontend is fine, and so is another client
  calling it. A Vue or Svelte frontend inside the same project is not supported.
- **Services are classes.** Primitives are class properties and the container builds the
  classes. It is a style, and not everyone's.
- **Versions.** From 1.0.0 Alepha follows semantic versioning, with a deprecation before
  any removal. Before 1.0.0 a minor release may break an API. See
  [Stability](https://alepha.dev/docs/guides-introduction.md#stability).

## When something else fits better

- **A content site with no server logic.** Alepha can build a static site, but a static
  site generator brings themes and content tooling that Alepha does not.
- **A team that is not on TypeScript**, or whose frontend is not React.
- **A stack you want to assemble yourself**, one library at a time.
- **A large app that is happy where it is.** Alepha is at its best on a project it starts.
