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

# Quickstart

> Setup project dalam beberapa menit dengan ./thub.

Ikuti langkah ini dari root monorepo (`platform-clean/`).

## Prerequisites

* [Bun](https://bun.sh) 1.3+
* Git
* Opsional untuk DB lokal: Postgres + `psql`

## Langkah 1 — Install dependensi

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

## Langkah 2 — Setup environment

```bash theme={null}
./thub setup
```

Wizard akan:

1. Membuat `.env` **shared** (secret dev + Cloudflare)
2. Membuat `.env.development.local` (override dev default)
3. Merge ke `apps/api/.env` dan `apps/web/.env`

<Steps>
  <Step title="Pilih mode Cepat">
    Cukup untuk pertama kali. Secret eksternal bisa diisi nanti.
  </Step>

  <Step title="Migrasi otomatis (jika ada)">
    Kalau kamu punya `apps/api/.env` lama, wizard menawarkan migrasi ke model shared.
  </Step>

  <Step title="Bootstrap DB (opsional)">
    Wizard bisa menjalankan `bun run db:bootstrap:local` jika Postgres sudah jalan.
  </Step>
</Steps>

## Langkah 3 — Cek konfigurasi

```bash theme={null}
./thub doctor
```

Semua item hijau = siap dev. Peringatan kuning biasanya aman untuk lokal (misalnya secret opsional kosong).

## Langkah 4 — Jalankan dev lokal

```bash theme={null}
./thub dev
```

| Service    | URL                                                                  |
| ---------- | -------------------------------------------------------------------- |
| Web        | [http://localhost:5757](http://localhost:5757)                       |
| API health | [http://localhost:3739/api/health](http://localhost:3739/api/health) |
| Renderer   | [http://localhost:8787/health](http://localhost:8787/health)         |

`./thub dev` selalu menjalankan `./thub env merge` dulu.

## Langkah 5 — Deploy Cloudflare (production)

```bash theme={null}
./thub secrets check
./thub secrets push
./thub deploy
./thub smoke prod
```

<Warning>
  Deploy production meminta konfirmasi `yes` dan menawarkan push secrets ke Cloudflare Worker.
</Warning>

## Perintah setara lewat bun

```bash theme={null}
bun run setup
bun run doctor
bun run dev
bun run secrets:push
bun run deploy:prod
bun run smoke
```

## Cek CI/CD di GitHub

Setelah push ke `main`, pipeline **CI** jalan otomatis. Cek di [tab Actions](https://github.com/trisnalesmana/aimentor/actions) atau lewat CLI:

```bash theme={null}
gh run list --repo trisnalesmana/aimentor --limit 3
```

| Yang dicek                | Cara                                                          |
| ------------------------- | ------------------------------------------------------------- |
| CI lulus atau tidak       | Workflow **CI** — hijau = lint, doctor, docs, web tests OK    |
| Deploy pernah jalan belum | Workflow **Deploy Cloudflare** — kosong = belum pernah di-run |
| Secrets sudah diisi       | Settings → Secrets and variables → Actions                    |
| Environment production    | Settings → Environments                                       |

Deploy via GitHub butuh secrets (`DOTENV_SHARED`, `DATABASE_URL`, token Cloudflare, dll.) — lihat [CI/CD GitHub Actions](/guides/ci-cd).
