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

# Local Development

> Building and working with Malak Locally

Malak runs with very minimal hardware requirements by itself. While it

<Warning>
  Malak has been tested and developed extensively on macOS but there are
  extremely high chances it works and compiles correcly on windows. Let us know
  if it does :)
</Warning>

<Tip>For production, we strongly recommend Linux</Tip>

To run Malak, you need to install a few things. Go, Node.js, bun, Git. We will not go through the installation
of these as you can find them on their relative websites.

## Development Setup

**Step 1**: Clone the Malak Repo

```bash theme={null}
  git clone git@github.com:ayinke-llc/malak.git

```

### Backend

Navigate to the newly created `malak` directory

```bash theme={null}
docker compose up
```

This installs the dependencies you need: Postgresql, Redis, Minio, Grafana and Mailhog for local email testing

#### Configuration

At the very minimum, you need to create a `config.yml` containing the following:

```yaml theme={null}
auth:
  google:
    client_id: "CLIENT_ID"
    client_secret: "CLIENT_SECRET"
    redirect_uri: "http://localhost:3000"
    is_enabled: true

  jwt:
    key: JWT_KEY

billing:
  default_plan_reference: prod_Qmjfkf

http:
  port: 5300 ## defaults to 5300
  swagger:
    port: 9999
    ui_enabled: true

uploader:
  s3:
    access_key: BhK
    access_secret: dzE
    region: lagos-1
    endpoint: http://localhost:9000
    use_tls: false

email:
  provider: smtp
  sender: email@updates.domain
  sender_name: Malak
  resend:
    api_key: fjfk
    webhook_secret: fufhifuji

secrets:
  provider: aes_gcm
  aes:
    key: ujffjkfk

api_key:
  hash_secret: 123459yu7teguifg7894tg8947ty
```

> You can find all [possible configuration values here](/backend-configuration)

#### Running binary

Please note that each CLI release is associated with a specific version of Mintlify. If your local website doesn't align with the production version, please update the CLI:

<CodeGroup>
  ```bash make theme={null}
    task run:http
  ```

  ```bash command_line theme={null}
    go run cmd/*.go
  ```
</CodeGroup>

### Frontend

#### Install dependencies

```bash theme={null}
  cd web/ui
```

```bash theme={null}
  bun i
```

#### Add configuration

> This should go to your `.env` or `.env.local` file

```txt theme={null}
NEXT_PUBLIC_GOOGLE_CLIENT_ID=
# NEXT_PUBLIC_MALAK_POSTHOG_KEY=
# NEXT_PUBLIC_MALAK_POSTHOG_HOST=https://us.i.posthog.com
# NEXT_PUBLIC_MALAK_ENABLE_POSTHOG=false
# NEXT_PUBLIC_SENTRY_DSN=https://xxxx.ingest.us.sentry.io/45
NEXT_PUBLIC_DECKS_DOMAIN=https://deck.malak.vc
NEXT_PUBLIC_SUPPORT_EMAIL=support@ayinke.ventures
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_API_URL=http://localhost:5300/v1
```
