> ## 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.

# Solid JS Quickstart

> Add a Base44 backend to your Solid JS project

Follow this quickstart to add Base44 to your Solid JS project. You'll create a Base44 backend, define entities, and integrate the SDK into your frontend.

> [!NOTE]
>
> The CLI requires Node.js 20.19.0 or higher.

## Setup

**1. Install the Base44 CLI**

Install the Base44 CLI globally:

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

**2. Create a Base44 backend**

Navigate to your Solid JS project directory, then run:

```bash theme={null}
base44 create
```

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

Select **Create a basic project** when prompted. This creates the backend files within your Solid JS project directory. Then follow the prompts to configure your project.

When you create a project, [Base44 skills](https://docs.base44.com/developers/backend/overview/skills.md) are included automatically, providing your AI agent with instructions and context for Base44 tasks.

**3. Configure your site**

Update your [config.jsonc](https://docs.base44.com/developers/backend/overview/project-structure.md#config-jsonc) to point to your Solid JS build output and set the commands for building and serving. Add the `site.outputDirectory`, `site.buildCommand`, and `site.serveCommand` fields:

```json theme={null}
{
  "site": {
    "outputDirectory": "dist",
    "buildCommand": "npm run build",
    "serveCommand": "npm run dev"
  }
}
```

With `serveCommand` set, [`base44 dev`](https://docs.base44.com/developers/references/cli/commands/dev) starts your backend and frontend together from a single terminal. With `buildCommand` set, [`base44 build`](https://docs.base44.com/developers/references/cli/commands/build) compiles your frontend with your app ID injected.

**4. Define entities**

Create [entity schemas](https://docs.base44.com/developers/backend/resources/entities/overview.md) to define your data structures. Entity files must be placed in the `base44/entities/` directory.

For example, create `base44/entities/task.jsonc`:

```json theme={null}
{
  "name": "Task",
  "type": "object",
  "properties": {
    "title": {
      "type": "string"
    },
    "completed": {
      "type": "boolean",
      "default": false
    }
  },
  "required": ["title"]
}
```

**5. Push entities to Base44**

Push your entity schemas to Base44:

```bash theme={null}
base44 entities push
```

This command synchronizes your local entity definitions with your Base44 backend, making them available for use in your application. See [`entities push`](https://docs.base44.com/developers/references/cli/commands/entities-push) for more information.

**6. Install the Base44 SDK**

Install the Base44 JavaScript SDK:

```bash theme={null}
npm install @base44/sdk
```

**7. Create a Base44 client**

Create a Base44 SDK [client](https://docs.base44.com/developers/references/sdk/getting-started/client.md) in your project. Read the app ID from `VITE_BASE44_APP_ID`, which [`base44 build`](https://docs.base44.com/developers/references/cli/commands/build) and [`base44 dev`](https://docs.base44.com/developers/references/cli/commands/dev) set automatically.

For example, create `src/api/base44Client.js`:

```javascript theme={null}
import { createClient } from '@base44/sdk';

export const base44 = createClient({
  appId: import.meta.env.VITE_BASE44_APP_ID,
});
```

`VITE_BASE44_APP_ID` resolves to your linked app's ID, which the CLI reads from `base44/.app.jsonc`.

**8. Use the SDK in your frontend**

In your frontend, write some code to interact with the instances of your [entities](https://docs.base44.com/developers/references/sdk/docs/type-aliases/entities.md). For example:

```jsx theme={null}
import { createSignal, onMount, For } from 'solid-js';
import { base44 } from '../api/base44Client';

export default function TaskList() {
  const [tasks, setTasks] = createSignal([]);
  const [newTaskTitle, setNewTaskTitle] = createSignal('');
  const [isLoading, setIsLoading] = createSignal(false);

  onMount(async () => {
    await loadTasks();
  });

  const loadTasks = async () => {
    setIsLoading(true);
    try {
      // Get records
      const taskList = await base44.entities.Task.list();
      setTasks(taskList);
    } catch (error) {
      console.error('Error loading tasks:', error);
    }
    setIsLoading(false);
  };

  const addTask = async (e) => {
    e.preventDefault();
    if (!newTaskTitle().trim()) return;

    setIsLoading(true);
    try {
      // Create a record
      const newTask = await base44.entities.Task.create({
        title: newTaskTitle(),
        completed: false
      });
      setTasks([...tasks(), newTask]);
      setNewTaskTitle('');
    } catch (error) {
      console.error('Error creating task:', error);
    }
    setIsLoading(false);
  };

  return (
    <div>
      <h1>Tasks</h1>

      {isLoading() && <p>Loading...</p>}

      <ul>
        <For each={tasks()}>
          {(task) => <li>{task.title}</li>}
        </For>
      </ul>

      <form onSubmit={addTask}>
        <input
          type="text"
          value={newTaskTitle()}
          onInput={(e) => setNewTaskTitle(e.target.value)}
          placeholder="New task"
          disabled={isLoading()}
        />
        <button
          type="submit"
          disabled={isLoading() || !newTaskTitle().trim()}
        >
          Add Task
        </button>
      </form>
    </div>
  );
}
```

> [!NOTE]
>
> Use the exact entity name from your schema when calling the SDK, including capitalization. By convention, entity names begin with a capital letter. For example, if your schema has `"name": "Task"`, you access it as `base44.entities.Task.list()`.

**9. Run your app locally**

Start your Solid JS development server to test your integration. From your project root, run:

```bash theme={null}
npm run dev
```

Your Solid JS app will connect to your Base44 backend through the SDK client, allowing you to work with your deployed entities in real-time.

**10. Build and deploy your frontend**

Build your Solid JS project for production with your app ID injected, then deploy:

```bash theme={null}
base44 build
base44 deploy
```

`base44 build` runs your `buildCommand` with `VITE_BASE44_APP_ID` set to your linked app's ID. `base44 deploy` uploads the compiled files and pushes any updates to your entity schemas. When complete, you'll see a link to your Base44 dashboard and your live application URL.

## Next steps

Now that your Base44 backend is integrated with your project, you can:

* Use the [SDK](https://docs.base44.com/developers/references/sdk/getting-started/overview.md) to add more functionality to your frontend.
* 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.
* Test locally with [`base44 dev`](https://docs.base44.com/developers/references/cli/commands/dev). See [Local development](https://docs.base44.com/developers/backend/overview/local-dev/local-development-overview.md) for setup instructions.
* Continue building your frontend and deploy updates with [`base44 deploy`](https://docs.base44.com/developers/references/cli/commands/deploy).
* Open your deployed site with [`base44 site open`](https://docs.base44.com/developers/references/cli/commands/site-open).

## See also

* [CLI Command Reference](https://docs.base44.com/developers/references/cli/commands/introduction.md): All available CLI commands
* [Project Structure](https://docs.base44.com/developers/backend/overview/project-structure.md): How project files are organized
* [JavaScript SDK Documentation](https://docs.base44.com/developers/references/sdk/getting-started/overview.md): Connect your app to the backend
* [Base44 Skills](https://docs.base44.com/developers/backend/overview/skills.md): Teach AI assistants to work with Base44


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