---
question: How do I scaffold an app folder?
kind: task
via_web: available
via_cli: available
via_python: available
via_api: available
via_config: na
ref_web: Apps › File › New App
ref_cli: abi new app
ref_python: expose_app
ref_api: POST /api/app-projects/
next:
  - /capabilities/build/apps/overview
  - /capabilities/build/apps/delete-an-app
  - /capabilities/build/modules/creating-a-module
---

# Create an app

An app is a folder under `apps/` that Nexus discovers from `manifest.json`.

## Web UI

The Nexus app builder writes a static app (HTML, CSS, JavaScript) with the Apps agent. It needs the platform's git storage (Forgejo) and an object store.

### Start the app

In the workspace, open Apps. Choose **File › New App**, type a name, and click **Create**. The editor opens on the new app.

![Apps with the File menu open](/abi/Screenshot_Apps_New.png)

*Apps › File › New App. This workspace has no apps yet.*

### Build it

Edit the files, or ask the Apps agent to write them.

### Submit it

Click **Submit**. Nexus saves the app and opens a branch in the module repository with it. Nothing goes live until that branch is merged. Then turn the app on in the workspace Apps settings.

## CLI

### Scaffold the folder

From the module directory:

```bash
abi new app review apps
```

That writes `apps/review/` with `manifest.json`, `index.html`, and a README, plus an `AGENTS.md` in `apps/`. The arguments are `<name> [path]`; without a path the folder lands in the current directory. The manifest `url` can be `html:index.html`, which serves that page. The command is [`abi new app`](/user-guide/reference/cli#abi-new-app). The full command list is the [CLI reference](/user-guide/reference/cli).

### Restart the module

The module reads its `apps/` folder when it starts. Restart it to announce the new app:

```bash
abi dev down --service research
abi dev up -d --service research
```

`research` is the module's name in `dev.modules`.

Nexus lists the app once the module is `READY`. Turn it on in the workspace Apps settings, which opens it. The CLI also prints its direct path, `/app-html/remote/<module_id>/<name>/`, which opens it in the first of your workspaces that turns it on.

## Python

### Serve a backend

A static app needs no code: the module serves the files of its folder. For a backend, bind an ASGI application in `on_initialized`. The folder `apps/<name>/manifest.json` must exist:

```python
from fastapi import FastAPI, Request

api = FastAPI()


@api.get("/api/hello")
async def hello(request: Request) -> dict:
    abi = request.scope["abi"]
    return {"user": abi["user_id"], "workspace": abi["workspace_id"]}


class ABIModule(BaseModule[ResearchConfiguration]):
    async def on_initialized(self) -> None:
        ...
        self.expose_app("review", api)  # apps/review/manifest.json
```

The page calls it with a relative URL, `fetch("api/hello")`. Requests for a file of the folder get the file; every other path goes to the ASGI application. Add what the backend needs (here `fastapi`) to the module's image: see [Add an app](/capabilities/build/modules/creating-a-module#add-an-app).

## REST API

The Nexus API creates the same app project as the Web UI. Auth: a Nexus user session with access to the workspace.

### Create the project

```http
POST /api/app-projects/
```

Body: `workspace_id` and `title`, plus optional `description` and `icon_emoji`. The response carries the project's `slug`.

### Submit it

```http
POST /api/app-projects/{slug}/submit
```

Body: `workspace_id`, plus `module` to choose which module holds the app. This saves, then opens the review branch in the module repository, as **Submit** does.

## Config

Not applicable. The app is the manifest folder, not a `config.yaml` entry. Enable it in the workspace Apps settings.
