> ## 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.

# Pengenalan

> Ringkasan monorepo AI Mentor, alur dev lokal, dan deploy Cloudflare.

AI Mentor (TrainerHub) adalah monorepo untuk platform sertifikasi trainer. Dokumentasi ini fokus pada **cara menjalankan project di laptop** dan **deploy ke Cloudflare production** — tanpa perlu memahami seluruh codebase dulu.

## Apa yang ada di repo

<CardGroup cols={2}>
  <Card title="apps/web" icon="layout">
    Frontend React (Vite). Port dev default: `5757`.
  </Card>

  <Card title="apps/api" icon="server">
    Backend Hono + Postgres + auth. Port dev default: `3739`.
  </Card>

  <Card title="apps/renderer" icon="file-text">
    Service generate DOCX/PPTX. Port dev: `8787`.
  </Card>

  <Card title="./thub" icon="terminal">
    CLI untuk setup env, dev, deploy, dan secrets.
  </Card>

  <Card title="Layanan eksternal" icon="plug" href="/external/overview">
    Tutorial setup Resend, Mux, Cloudflare, Neon, DeepSeek, Scalev.
  </Card>

  <Card title="AI & dokumen" icon="sparkles" href="/ai/overview">
    Katalog bukti/trainer, prompt per dokumen, cara edit prompt.
  </Card>

  <Card title="Arsitektur & alur" icon="sitemap" href="/architecture/glossarium">
    Glossarium, stack, batch/tier, kursus, video, bayar, auth, generate, sertifikat.
  </Card>

  <Card title="Admin playbook" icon="clipboard-check" href="/guides/admin-playbook">
    Checklist batch baru dari nol sampai peserta bisa belajar.
  </Card>
</CardGroup>

## Alur kerja yang disarankan

```mermaid theme={null}
flowchart LR
  setup["./thub setup"] --> dev["./thub dev"]
  dev --> check["./thub doctor"]
  check --> secrets["./thub secrets push"]
  secrets --> deploy["./thub deploy"]
  deploy --> smoke["./thub smoke prod"]
```

| Lingkungan | Target                                            |
| ---------- | ------------------------------------------------- |
| Lokal      | `http://localhost:5757` + API `:3739`             |
| Production | Cloudflare → `https://app.sertifikasitrainer.com` |

<Note>
  Flow normal **tidak** memakai Hono atau Beta. Deploy langsung ke Cloudflare Workers (API, web, renderer).
</Note>

## Model environment

Secret disimpan **sekali** di `.env` (shared). Override dev/prod bersifat **opsional**:

* `.env.development.local` — beda di laptop (DB lokal, URL localhost)
* `.env.production.local` — beda di production (misalnya `DATABASE_URL` Neon)

Detail lengkap: [Model environment](/guides/env-model).

## CI/CD di GitHub

Setiap push ke `main` menjalankan **CI** otomatis (lint tooling, doctor, docs, tests). **Deploy production** lewat GitHub Actions bersifat **manual** — tidak auto-deploy saat merge.

|         | CI                                                           | CD (Deploy Cloudflare)             |
| ------- | ------------------------------------------------------------ | ---------------------------------- |
| Status  | Aktif setelah workflow di-push                               | Workflow ada; butuh setup secrets  |
| Trigger | Push / PR ke `main`                                          | Manual di tab Actions              |
| Cek     | [Actions](https://github.com/trisnalesmana/aimentor/actions) | Environment `production` + secrets |

Panduan lengkap, checklist secrets, dan cara cek status: [CI/CD GitHub Actions](/guides/ci-cd).
