# Cloning the Repository

<p class="callout warning">**Before**<span style="white-space: pre-wrap;"> cloning the repository, install the following tools on your machine.</span></p>

<span style="white-space: pre-wrap;">The repository contains a Git submodule for the protobuf definitions. You must clone with </span>`<span class="editor-theme-code">--recurse-submodules</span>`<span style="white-space: pre-wrap;"> or the </span>`<span class="editor-theme-code">src-tauri/proto/</span>`<span style="white-space: pre-wrap;"> directory will be empty and the build will fail.</span>

```bash
git clone --recurse-submodules https://github.com/RoboTeamTwente/erc-software-basestation.git
cd erc-software-basestation
```

If you already cloned without the flag, initialise the submodule manually:

```bash
git submodule update --init --recursive
```

### Keeping the submodule up to date

When pulling changes that include submodule updates, always run:

```bash
git pull
git submodule update --recursive
```

If the proto definitions change and your build starts failing with protobuf-related errors, this is almost always the cause.

## Installing Frontend Dependencies

```bash
bun install
```

<span style="white-space: pre-wrap;">This reads </span>`<span class="editor-theme-code">package.json</span>`<span style="white-space: pre-wrap;"> and installs all SvelteKit, Threlte, and other frontend dependencies into </span>`<span class="editor-theme-code">node_modules/</span>`<span style="white-space: pre-wrap;">. Run this once after cloning and again whenever </span>`<span class="editor-theme-code">package.json</span>`<span style="white-space: pre-wrap;"> changes.</span>