> ## Documentation Index
> Fetch the complete documentation index at: https://docs.base44.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Up Local Dev for an Existing App

> Write backend code locally for an app you already have on Base44

Use this guide to write backend code locally for a Base44 app you already have. The [`scaffold`](https://docs.base44.com/developers/references/cli/commands/scaffold) command creates the configuration files your development environment needs and connects your local environment to your app's backend resources. The frontend stays in Base44's visual editor. Unlike [`eject`](https://docs.base44.com/developers/backend/overview/start-from-existing-app), which creates a new app and downloads your existing code including the frontend, scaffold works with your app in place.

> [!NOTE]
>
> * This guide requires your existing app ID. You can find it in the app's URL in the Base44 app editor: `app.base44.com/apps/<id>/...`
> * The CLI requires Node.js 20.19.0 or higher.
> * If you want a different local development approach for an app you already have on Base44, consider these options instead:
>   * [GitHub integration](https://docs.base44.com/developers/app-code/local-development/github.md): two-way auto-sync with a GitHub repo, requires Builder plan.
>   * [`base44 eject`](https://docs.base44.com/developers/backend/overview/start-from-existing-app): create a separate local copy of the app as a new project.
>   * [`base44 link`](https://docs.base44.com/developers/backend/overview/link-existing-project): link existing project files already on disk to a Base44 backend.

**1. Install the CLI**

Install the Base44 CLI globally:

```bash theme={null}
npm install -g base44@latest
```

**2. Create or navigate to your project directory**

Create a directory for your local project and navigate to it:

```bash theme={null}
mkdir my-project && cd my-project
```

You can also run `scaffold` in a directory that already has files. The command only writes files that don't exist yet.

**3. Scaffold the project**

Run the scaffold command with your app ID:

```bash theme={null}
base44 scaffold --app-id <your-app-id>
```

If you're not already logged in, the command will prompt you to authenticate.

The CLI creates configuration files in your directory and links them to your app on Base44.

When complete, your directory contains:

* **`base44/config.jsonc`**: Project configuration, including your app name and visibility settings.
* **`base44/.app.jsonc`**: Links your local directory to your app on Base44. Gitignored by default.
* **`base44/.gitignore`**: Ignores generated files and secrets from version control.
* **`.agents/` and `.claude/`**: AI agent skills that teach your IDE how to work with Base44. Pass `--no-skills` to skip this.

For details on the generated files, see [Project Structure](https://docs.base44.com/developers/backend/overview/project-structure.md).

## When to use scaffold

Use scaffold when you:

* Want to write backend resources (entities, functions, agents) locally while the frontend stays in Base44's visual editor. To get local access to the frontend code as well, use [`base44 eject`](https://docs.base44.com/developers/backend/overview/start-from-existing-app) instead.
* Prefer manual deploys over automatic sync, or don't have the plan level required for [GitHub integration](https://docs.base44.com/developers/app-code/local-development/github.md).
* Need to set up local development on a second machine for the same app.

## Next steps

Now that your project is set up, you can:

* Add [entities](https://docs.base44.com/developers/backend/resources/entities/overview.md), [backend functions](https://docs.base44.com/developers/backend/resources/backend-functions/overview.md), and [agents](https://docs.base44.com/developers/backend/resources/agents/overview.md). If you're working in TypeScript, [generate types](https://docs.base44.com/developers/references/sdk/getting-started/dynamic-types.md) to get autocomplete and type safety.
* Deploy your backend resources to Base44 with [`base44 deploy`](https://docs.base44.com/developers/references/cli/commands/deploy).

## See also

* [`scaffold` command reference](https://docs.base44.com/developers/references/cli/commands/scaffold): Command flags and usage details
* [Project Structure](https://docs.base44.com/developers/backend/overview/project-structure.md): How project files are organized
* [CLI Command Reference](https://docs.base44.com/developers/references/cli/commands/introduction.md): All available CLI commands


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.