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

# Hoagie Mail/Stuff

> Learn how to set up your local development environment for Hoagie Mail and Hoagie Stuff.

# Setup

If you have a Windows operating system, complete these steps before continuing.

<AccordionGroup>
  <Accordion title="Windows">
    It is a bit of a nightmare to get the Windows environment set up.

    We've found the fastest workaround to be installing the Windows Subsystem for Linux (WSL). For more details, see this [article](https://learn.microsoft.com/en-us/windows/wsl/install).

    ## Step 1: Open PowerShell or Windows Command Prompt

    You must do this in **administrator mode** by right-clicking and selecting "Run as administrator".

    ***

    ## Step 2: Installing WSL

    Run the following command:

    ```powershell powershell theme={null}
    wsl --install
    ```

    ***

    ## Step 3: Open Ubuntu

    Open the **Start Menu**, search for **Ubuntu** (or the name of the Linux distribution you installed), and click on the app to open it.

    When you launch Ubuntu for the first time, it will take a few minutes to set up, and you may be prompted to create a new username and password for your Linux environment.
  </Accordion>
</AccordionGroup>

## Step 1: Install Homebrew

The easiest way to install the required dependencies is to use [Homebrew](https://brew.sh/). Run the following command in your terminal:

```bash bash theme={null}
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

***

## Step 2: Install required tools

[Yarn](https://classic.yarnpkg.com/en/), our package manager:

```bash bash theme={null}
brew install yarn
```

[MongoDB](https://www.mongodb.com/), for our databases:

```bash bash theme={null}
brew tap mongodb/brew
brew update
brew install mongodb-community@8.2
```

Then run MongoDB as a service. If you're on MacOS:

```bash zsh theme={null}
brew services start mongodb-community@8.2
```

If you're on Windows running WSL:

```bash bash theme={null}
sudo systemctl start mongod
```

We use [VSCode](https://code.visualstudio.com/) for development. Download it and get the following extensions:

* [Eslint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
* [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
* [Go](https://marketplace.visualstudio.com/items?itemName=golang.Go)

***

## Step 3: Clone the repositories.

We use [GitHub](https://github.com/hoagieclub/) for version control. You will need to have GitHub Personal Access Tokens set up.

<Accordion title="Set Up Personal Access Token">
  1. Run `git config --global credential.helper store`
  2. Create a [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) - either fine-grained or classic is fine
  3. Next time you run a git command in terminal it will [ask for credentials](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#using-a-personal-access-token-on-the-command-line)
</Accordion>

```bash bash theme={null}
git clone https://github.com/HoagieClub/mail.git
git clone https://github.com/HoagieClub/api.git
git clone https://github.com/HoagieClub/stuff.git
```

<Info>
  **NOTE:** Environment variables are <b>not</b> included in cloned repositories.
</Info>

***

## Step 4: Environment variables

After you have the repository on your local device, you'll need to add the environment variables.

Switch into the preview branch:

```bash bash theme={null}
git switch preview
```

For all three repositories, rename the `.env.local.txt` file to `.env.local`. For mail and stuff, copy over the environment variables from Slack.

***

## Step 5: Download dependencies

You will need to download the required dependencies before you can run the apps.

From the api repository, run:

```bash bash theme={null}
go get
```

From the mail and stuff repositories, run:

```bash bash theme={null}
yarn
```

***

## Step 6: Run the apps

You will need to run the frontend and backend simultaneously.

### Backend

The backend is written in Go. Run `main.go` from the api repository.

```bash bash theme={null}
go run main.go reset
```

It might take a second to start up. Once it displays `[i] Running on https://localhost:8080`, you're all set.

### Frontend

From either the stuff or mail repository, run:

```bash bash theme={null}
yarn dev
```

Open the localhost link in your browser.

***

You're all set! Happy coding. Be sure to check out the [Development Workflow](/quickstart/development) guide!
