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

# Getting started with Base Code

> Build on your existing codebase with the AI chat, preview changes, and open GitHub pull requests for review.

[Base Code](https://base44.com/base-code) gives your team a shared cloud environment for working on an existing web or full-stack codebase using the AI chat, while GitHub stays the source of truth. Connect your repository, make changes on branches, preview your work, and open pull requests for review.

<Frame>
  <img src="https://mintcdn.com/base44/14mHcwtsjgXgI4LR/images/base-code-hero-animated.gif?s=e70877ead77d357b9f715e8ee11adb45" alt="Base Code showing AI chat, project files, a working branch, live Preview, and Create PR" width="1080" height="456" data-path="images/base-code-hero-animated.gif" />
</Frame>

<Check>
  **Before you begin:**

  Your project must be a web or full-stack project in a GitHub repository.
</Check>

***

## Setting up Base Code

Connect the GitHub repository you want to work on. You need to be an owner, admin, or editor in the workspace to connect a repository. For private repositories, make sure the Base44 GitHub App has access. The first time you use Base Code, you can answer how familiar you are with code or skip the question.

<div id="from-your-account" />

<div id="paste-a-link" />

<Tabs>
  <Tab title="From your account">
    Connect a repository from your GitHub account. Make sure you have push access to the repository.

    **To connect from your account:**

    1. Go to [Base Code](https://app.base44.com/base-code).
    2. If your GitHub account isn't connected, click **Connect GitHub** and authorize the repositories you want Base44 to access.
    3. Click **View more** to open **Connect your repository**.
    4. Click **From your account**.
    5. Select the repository.
    6. If you want to start from a different branch, click the **Branch** drop-down and select one. Base44 uses the default branch if you don't choose one.
    7. Click **Connect**.
  </Tab>

  <Tab title="Paste a link">
    Connect a repository by pasting its GitHub URL. Base44 checks your access, then connects the repository or creates a copy in your GitHub account. If you choose to create a fork or copy, Base44 connects to it, so your pull requests target your copy rather than the original repository.

    **To connect by pasting a link:**

    1. Go to [Base Code](https://app.base44.com/base-code).
    2. If your GitHub account isn't connected, click **Connect GitHub** and authorize the repositories you want Base44 to access.
    3. Click **View more** to open **Connect your repository**.
    4. Click **Paste a link**.
    5. Paste the GitHub repository URL.
    6. Choose based on your access:
       * **Branch:** Select a starting branch if you can push to the repository.
       * **Your copy on GitHub:** Enter a name for the copy if you can't push to the repository, then choose **Fork (public)** or **Private copy**.
    7. Click **Connect**, **Fork and connect**, or **Copy and connect**, depending on the option you selected.
  </Tab>
</Tabs>

<Tip>
  To connect another repository later, open the repository switcher in Base Code and click **Add new repository**.
</Tip>

***

## Working on your project

Once your repository is connected, Base Code opens it in the editor so you can preview the project and start making changes.

### Making your first change

Describe what you want to change, then preview the result on a new working branch.

**To make your first change:**

1. Go to [Base Code](https://app.base44.com/base-code).

2. In the prompt box, describe the change you want to make. For example:

   ```text theme={null}
   Add a dark mode toggle to the settings page,
   and remember the choice between visits.
   ```

3. Click **Create branch**. Base Code opens the new branch in the editor and starts working.

4. Check **Preview** and ask the AI chat for any adjustments.

Base44 names the branch from your request.

<Note>
  Base Code runs your project in a development preview. To release your changes to production, use your project's existing deployment process.
</Note>

### Saving your work

Base44 saves your work as you go. For projects synced to GitHub, it commits and pushes each AI chat change to the branch you're working on.

To bring changes into your default branch, open and merge a pull request that targets it.

Base Code uses the Git branches in your repository directly, with Git as the source of truth. Each branch runs in its own sandbox, and deleting a branch in Base Code leaves the branch on GitHub. See [working with branches](/Building-your-app/working-with-branches).

### Opening a pull request

After reviewing and testing your changes, open a pull request to share them for review before merging. Your GitHub account needs write access to the connected repository. Opening a pull request doesn't merge your changes.

**To open a pull request:**

1. Click **Create PR** at the top of the editor.
2. Enter a **Title** and a **Description (optional)**.
3. Click **Create PR**.

<Tip>
  You can also ask the AI chat for a pull request. It drafts the title and description for you.
</Tip>

<div id="resolving-conflicts-with-the-base-branch" />

### Resolving branch conflicts

If GitHub can't automatically merge your branch into the branch your pull request targets, the pull request has conflicts. A note above the AI chat identifies the pull request and target branch. Click **Resolve conflicts** to start resolving them.

Base44 merges the base branch into your branch, and the AI works through the overlapping changes. Review and test the resolved changes, particularly where each side implemented the same feature differently.

### Answering review comments

Handle your reviewers' feedback from the AI chat, without leaving Base44.

Ask the AI chat for the review comments on your pull request, and it lists each unresolved thread with the file and line it points at. Tell it what to change, and it drafts a change and a reply for each one. Review each draft before you tell it to post, and ask separately when you want a thread resolved.

Anything it posts appears as `base44-builder[bot]`. Merging normally happens on GitHub, and there's no merge button in Base Code, though you can ask the AI chat to merge a pull request for you.

***

## Managing your project

The dashboard gives you access to your project files, secrets, and the services Base44 runs for your development environment.

### Adding secrets

When your project needs an API key or other secret, the AI chat prompts you to add it. Secrets are stored encrypted, kept out of your repository, and shared across all branches, including after a rebuild.

Changes and removals apply automatically to running branches. Inactive branches pick them up when you next open them.

**To add a secret:**

1. Go to your app's dashboard.
2. Click **Secrets**.
3. Click **Add Secret**.
4. Enter the **Secret Name** and **Secret Value**, then click **Add Secret**.

<Tip>
  To add secrets in bulk, click **Import .env**, then upload or paste your file. Each `KEY=VALUE` line becomes a secret, and any existing secret with the same name is overwritten.
</Tip>

### Collaborating with teammates

Owners, admins, and editors in the workspace can access the Base Code project without a separate app invitation. For anyone else, invite them as a collaborator from the app editor.

Sharing the project link alone doesn't give someone access. For details on inviting and managing collaborators, see [Working with collaborators](/Setting-up-your-app/Managing-access#working-with-collaborators).

***

## FAQs

<AccordionGroup>
  <Accordion title="How is this different from connecting my Base44 app to GitHub?">
    The [GitHub integration](/developers/app-code/local-development/github) syncs an app you built in Base44 with a repository. Base Code works the other way around, starting from a repository that already exists. To move a project from another platform such as Shopify or Lovable, see [migrating a project to Base44](/Getting-Started/migrating-an-existing-app). To link a local Base44 backend project with the CLI instead, see [linking an existing project](/developers/backend/overview/link-existing-project).
  </Accordion>

  <Accordion title="Can I connect a mobile or desktop project?">
    No. Base Code runs web and full-stack projects only. You get a message naming what it detected as soon as you connect, and nothing is created in your account.
  </Accordion>

  <Accordion title="My repository is a monorepo. Can I connect it?">
    Base Code checks the project at the root of the repository, and that project has to be a web or full-stack project. A mobile app in a subfolder doesn't make the repository ineligible on its own.
  </Accordion>

  <Accordion title="Can I connect a repository I only have read access to?">
    Yes. With your GitHub account connected, use **Paste a link** to create a fork or private copy. If your workspace limits repositories to approved GitHub organizations, you need push access to a repository in an approved organization.
  </Accordion>

  <div id="managing-github-access" />

  <Accordion title="How do I manage GitHub organization access in my workspace?">
    Your workspace settings control who can connect GitHub organizations and which organizations are available for new apps. Workspace members still need permission to connect projects. Changing an organization's **Allowed** setting doesn't affect apps already using it.

    **To manage GitHub organization access:**

    1. Go to your workspace settings.
    2. Click **Build tools**.
    3. Click **GitHub**.
    4. Under **Who can connect organizations**, choose who can add an organization.
    5. Under **Connected organizations**, use **Allowed** to control which organizations are available for new apps.
  </Accordion>

  <Accordion title="Why does Base44 say my repository is not in an approved GitHub organization?">
    Your workspace doesn't allow repositories from this GitHub organization. Ask someone who manages your workspace's GitHub settings to check that the organization is connected and **Allowed** under **Build tools** > **GitHub**, then try again.
  </Accordion>

  <Accordion title="What happens if I close Base Code and come back later?">
    Your project pauses when you stop working, and picks up where it left off when you return. If it needs rebuilding, Base44 clones your repository again and restarts from the latest commit on that branch. Work that was never committed doesn't survive a rebuild.
  </Accordion>

  <Accordion title="How do pull requests work in Base Code?">
    Your pull request targets the branch your working branch was created from. For a setup branch created by Base Code, it targets the branch you connected.

    Further changes to your working branch appear in the same pull request. GitHub runs your repository's configured checks.

    Base44 opens the pull request using your GitHub account. Commits list `base44-builder[bot]` as the author and you as co-author.
  </Accordion>

  <Accordion title="Why can't Base44 open my pull request?">
    If Base44 lacks permission to open pull requests, you see **Review permissions on GitHub**. An owner of the repository's GitHub account or organization needs to approve the requested access.
  </Accordion>

  <Accordion title="Can I add a database, authentication, or CI/CD to my project?">
    Yes. Ask the AI chat to add the code to your repository, using your project's own stack.

    Connecting a repository doesn't automatically add or configure Base44 entities, login, or the SDK. Your project keeps its existing database, authentication, and routing.

    For a new database or service, add its connection string or API key as a secret.
  </Accordion>

  <Accordion title="How many people can use a coupon code?">
    Each coupon code applies to 10 individual users per workspace.
  </Accordion>
</AccordionGroup>
