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

# Quickstart

> Get the EVO Dialed development environment running locally

This guide covers setting up the development environment for all three applications: backend, frontend, and iOS.

## Prerequisites

Before you begin, you must have:

* **Ruby 3.4+** (via mise or rbenv)
* **Node.js 20+** (via mise or nvm)
* **MySQL 8.0+** (local or Docker)
* **Redis 7+** (local or Docker)
* **Xcode 15+** (for iOS development)

## Backend setup

The Rails API powers all platform functionality.

<Steps>
  <Step title="Clone and install">
    ```bash theme={null}
    git clone https://github.com/Evo-Marketing-LLC/evo-dialed-backend.git
    cd evo-dialed-backend
    bundle install
    ```
  </Step>

  <Step title="Configure database">
    Copy the example database config and update credentials:

    ```bash theme={null}
    cp config/database.yml.example config/database.yml
    # Edit config/database.yml with your MySQL credentials
    ```
  </Step>

  <Step title="Setup database">
    ```bash theme={null}
    bin/rails db:create db:migrate db:seed
    ```
  </Step>

  <Step title="Start the server">
    ```bash theme={null}
    bin/rails server
    ```

    The API is now running at `http://localhost:3000`
  </Step>
</Steps>

### Backend environment variables

Key environment variables needed:

| Variable                  | Description             |
| ------------------------- | ----------------------- |
| `DATABASE_URL`            | MySQL connection string |
| `REDIS_URL`               | Redis connection string |
| `BETTER_AUTH_SECRET`      | Auth signing secret     |
| `SCRAPE_CREATORS_API_KEY` | ScrapeCreators API key  |

## Frontend setup

The Next.js admin dashboard for the EVO team.

<Steps>
  <Step title="Clone and install">
    ```bash theme={null}
    git clone https://github.com/Evo-Marketing-LLC/evo-dialed-frontend.git
    cd evo-dialed-frontend
    npm install
    ```
  </Step>

  <Step title="Configure environment">
    ```bash theme={null}
    cp .env.example .env.local
    # Edit .env.local with your settings
    ```

    Set `NEXT_PUBLIC_API_URL=http://localhost:3000` to point to local backend.
  </Step>

  <Step title="Start development server">
    ```bash theme={null}
    npm run dev
    ```

    The admin dashboard is now running at `http://localhost:3001`
  </Step>
</Steps>

## iOS setup

The creator-facing iOS application.

<Steps>
  <Step title="Clone the repo">
    ```bash theme={null}
    git clone https://github.com/Evo-Marketing-LLC/evo-dialed-creator-ios.git
    cd evo-dialed-creator-ios
    ```
  </Step>

  <Step title="Generate Xcode project">
    The project uses XcodeGen for project file generation:

    ```bash theme={null}
    xcodegen generate
    ```
  </Step>

  <Step title="Open in Xcode">
    ```bash theme={null}
    open dialed.xcodeproj
    ```
  </Step>

  <Step title="Configure signing">
    In Xcode, select your development team under Signing & Capabilities.
  </Step>

  <Step title="Run on simulator">
    Select a simulator and press Cmd+R to build and run.
  </Step>
</Steps>

### iOS environment

For local development, update the API base URL in the app configuration to point to your local backend (you may need ngrok or similar for device testing).

## Running tests

### Backend tests

```bash theme={null}
cd evo-dialed-backend
RAILS_ENV=test bin/rails db:test:prepare test
```

### Frontend type checking

```bash theme={null}
cd evo-dialed-frontend
npm run typecheck
```

### Pre-push checklist

Before pushing to main, ensure:

```bash theme={null}
# Backend
bin/brakeman --no-pager
bin/bundler-audit
bin/rubocop
RAILS_ENV=test bin/rails test

# Frontend
npm run typecheck
npm run lint
```

## Deployment

<Warning>
  Never deploy with `railway up` or direct uploads. Always push to GitHub and let Railway deploy from the commit.
</Warning>

### Backend (Railway)

Push to `main` branch triggers Railway deployment:

```bash theme={null}
git push origin main
```

Verify deployment:

```bash theme={null}
curl -sS -o /dev/null -w "%{http_code}\n" https://dialedapi.evomarketing.co/up
# Should return 200
```

### Frontend (Vercel)

Push to `main` branch triggers Vercel deployment automatically.

## Getting help

* Check the [architecture overview](/architecture) for system design
* See [backend documentation](/backend/overview) for API details
* Review [admin console guides](/admin/mission-control) for feature usage
