From a4b546058a8223346eef7d633dec2b225f8e096a Mon Sep 17 00:00:00 2001 From: asepharyana Date: Sun, 2 Aug 2026 16:49:11 +0700 Subject: [PATCH] docs: sync remaining .md to 4000s infra --- CLAUDE.md | 2 +- METRICS.md | 8 ++-- README.md | 29 +++++++++------ apps/ml-service/.env.example | 2 +- apps/ml-service/README.md | 2 +- .../2026-05-22-api-ml-service-migration.md | 4 ++ ...2026-05-22-backend-image-classification.md | 4 ++ .../plans/2026-05-22-docker-deployment.md | 2 + .../2026-05-22-fullstack-education-catalog.md | 4 ++ .../2026-05-22-fullstack-monorepo-scaffold.md | 4 ++ .../2026-05-22-js-ts-dependency-update.md | 4 ++ .../plans/2026-05-22-ml-service.md | 4 ++ .../plans/2026-05-22-production-mvp.md | 4 ++ .../plans/2026-05-22-root-readme.md | 2 + .../plans/2026-05-23-rust-onnx-ml-service.md | 2 + ...6-05-22-api-ml-service-migration-design.md | 4 ++ ...-22-backend-image-classification-design.md | 4 ++ .../2026-05-22-docker-deployment-design.md | 2 + ...5-22-fullstack-education-catalog-design.md | 4 ++ ...5-22-fullstack-monorepo-scaffold-design.md | 4 ++ ...26-05-22-js-ts-dependency-update-design.md | 4 ++ .../specs/2026-05-22-ml-service-design.md | 4 ++ .../specs/2026-05-22-production-mvp-design.md | 4 ++ .../2026-05-23-rust-onnx-ml-service-design.md | 2 + infra/README.md | 37 +++++++++---------- 25 files changed, 108 insertions(+), 38 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 8f64936..c98bf99 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -162,7 +162,7 @@ Each ZeaVis Edu service exposes a `GET /metrics` endpoint: All three share the `zeavis_` metric prefix and are scraped by Prometheus via `file_sd_configs` (see `telemetry/prometheus/targets/zeavis-edu.json`). -**IMPORTANT — Production architecture:** ZeaVis Edu apps and the Telemetry stack run on **separate VPS instances** connected via **Tailscale** (mesh VPN). Prometheus scrapes the API and ML service through their **Tailscale IPs** (e.g. `100.x.x.a:4006`), not via Docker hostnames. The target file has `__CHANGE_ME__` placeholders — replace with actual Tailscale IPs before deploying. +**IMPORTANT — Production architecture:** ZeaVis Edu apps and the Telemetry stack run on **separate VPS instances** connected via **Tailscale** (mesh VPN). Prometheus scrapes the API and ML service through their **Tailscale IPs** (e.g. `100.121.180.82:4006`), not via Docker hostnames. The target file has `__CHANGE_ME__` placeholders — replace with actual Tailscale IPs before deploying. The telemetry stack is managed from the project root via `make telemetry-*` targets (see `Makefile`). Docker Compose defines 5 services (Prometheus, Node Exporter, Query Proxy, Grafana, Telemetry UI). diff --git a/METRICS.md b/METRICS.md index a803b26..c4cc60d 100644 --- a/METRICS.md +++ b/METRICS.md @@ -18,7 +18,7 @@ application stack and the payload each service provides. > Telemetry stack on a **separate VPS** connected via **Tailscale**. > See [`telemetry/prometheus/targets/`](./telemetry/prometheus/targets/) > for the auto‑discovery configuration. Target files must use **Tailscale IPs** -> (e.g. `100.x.x.a:4006`), not Docker hostnames, because the services are on +> (e.g. `100.121.180.82:4006`), not Docker hostnames, because the services are on > different hosts. > > In production (nginx), the web app proxies `/metrics` to the API service: @@ -101,11 +101,11 @@ The Telemetry submodule includes a Prometheus instance that uses ```json [ { - "targets": ["100.x.x.a:4006"], + "targets": ["100.121.180.82:4006"], "labels": { "service": "zeavis-api", "component": "backend", "env": "production" } }, { - "targets": ["100.x.x.b:4012"], + "targets": ["100.121.180.82:4012"], "labels": { "service": "zeavis-ml", "component": "inference", "env": "production" } } ] @@ -114,7 +114,7 @@ The Telemetry submodule includes a Prometheus instance that uses > ⚠️ **Cross-VPS:** Gunakan **IP Tailscale** (bukan Docker hostname) karena > Prometheus dan ZeaVis Edu berjalan di VPS berbeda. Pastikan port service > (`:4006`, `:4012`) terekspos di `0.0.0.0` atau diizinkan oleh aturan -> `iptables`/`ufw` untuk interface Tailscale (`tailscale0`/`100.x.x.x/10`). +> `iptables`/`ufw` untuk interface Tailscale (`tailscale0`/`100.121.180.82`). The Prometheus config (in `telemetry/prometheus/prometheus.yml`) will automatically pick up new files within its 15‑second scrape interval — diff --git a/README.md b/README.md index 43f29b1..3a5294a 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Proyek ini merupakan **Capstone Project** dalam program **Pijak × IBM SkillsBui | NPM | Nama | Learning Path | Peran | |---|---|---|---| -| APC246D6Y0028 | **Asep Haryana Saputra** | Back-End | Arsitektur sistem, RESTful API, deployment Docker/Cloud, keamanan upload stream | +| APC246D6Y0028 | **Asep Haryana Saputra** | Back-End | Arsitektur sistem, RESTful API, deployment Nix/Cloud, keamanan upload stream | | APC013D6X0081 | **Selly Supriyatin** | Front-End | UI/UX responsif, mekanisme unggah gambar, modul edukasi (rekomendasi obat & penanganan) | | APC013D6Y0091 | **Taufik Pathurrohman** | Machine Learning | Data Engineering — ekstraksi dataset, cleaning, augmentasi gambar | | APC414D6Y0138 | **Luhung Pandyaska Suyi** | Machine Learning | Model Architecture & Training — CNN, hyperparameter tuning | @@ -70,7 +70,7 @@ ZeaVis Edu menggunakan **Computer Vision** sebagai asisten edukasi interaktif: | Sumber Dataset 2 | Kaggle — [Corn or Maize Leaf Disease Dataset](https://www.kaggle.com/datasets/smaranjitghose/corn-or-maize-leaf-disease-dataset) | | Sumber Dataset 3 | scidb — [Dataset of Corn Leaf Diseases based on Manual Annotation and Contrast Generation Model](https://www.scidb.cn/en/detail?dataSetId=19536c73f6d74946a212719a94f53ab3) | -| Deployment | VPS dengan Docker, ONNX Runtime untuk inferensi real-time | +| Deployment | VPS dengan Nix + systemd + Caddy, ONNX Runtime untuk inferensi real-time | --- @@ -101,7 +101,7 @@ ZeaVis Edu menggunakan **Computer Vision** sebagai asisten edukasi interaktif: | 1 | **Pengumpulan Data** | Dataset gambar 3 penyakit + 1 daun sehat dari Kaggle beserta pelabelan | | 2 | **Model ML** | Model Computer Vision terlatih di Google Colab, siap produksi | | 3 | **UI Antarmuka** | Front-End berbasis React + Vite dengan fitur unggah gambar | -| 4 | **Back-End Integration** | API + ML Service untuk inferensi real-time via Docker | +| 4 | **Back-End Integration** | API + ML Service untuk inferensi real-time via Nix + systemd | | 5 | **Prototipe Akhir** | Aplikasi Web + Android (Tauri 2) dengan klasifikasi & modul edukasi (rekomendasi obat & penanganan) | --- @@ -123,7 +123,7 @@ ZeaVis Edu menggunakan **Computer Vision** sebagai asisten edukasi interaktif: | Risiko | Solusi | |---|---| | **Overfitting akibat imbalanced data** | Augmentasi tingkat lanjut (kecerahan, noise, rotasi) + confidence threshold < 75% → minta user foto ulang | -| **Server downtime / latensi tinggi** | Batasan upload ≤ 5 MB + kompresi server-side + rate limiting + container Docker isolasi resource | +| **Server downtime / latensi tinggi** | Batasan upload ≤ 5 MB + kompresi server-side + rate limiting + isolasi resource per-service (systemd) | | **Foto blur / objek bukan daun jagung** | Panduan visual (overlay) pada UI + validasi anomali + disclaimer "alat bantu edukasi, bukan pengganti POPT" | | **Bottleneck integrasi ML ↔ API ↔ UI** | API Contract ketat di minggu ke-1 + integrasi bertahap (CI) mulai minggu ke-3 | @@ -144,7 +144,7 @@ ZeaVis Edu menggunakan **Computer Vision** sebagai asisten edukasi interaktif: │ └── README.md # ⤷ Panduan deployment multi-VPS ├── packages/shared/ # Tipe & utilitas TypeScript bersama ├── telemetry/ # Submodule — Prometheus → ClickHouse pipeline -├── docker-compose.yml # Konfigurasi deployment container +├── flake.nix # Konfigurasi deployment Nix (systemd services) ├── package.json # Root workspace Bun + Moon └── README.md # ⤷ Anda di sini ``` @@ -156,7 +156,7 @@ ZeaVis Edu menggunakan **Computer Vision** sebagai asisten edukasi interaktif: | API Backend | Bun, Elysia, Drizzle ORM, PostgreSQL | `apps/api/` | | ML Inference Engine | Rust, Axum, ONNX Runtime | [`apps/ml-service/README.md`](apps/ml-service/README.md) | | ML Pipeline | Python, TensorFlow/Keras, EfficientNetV2B0 | [`Machine_Learning/README.md`](Machine_Learning/README.md) | -| Infrastruktur | Docker, Coolify, Traefik, Tailscale | [`infra/README.md`](infra/README.md) | +| Infrastruktur | Nix, systemd, Caddy, Tailscale | [`infra/README.md`](infra/README.md) | | Telemetry | Prometheus, ClickHouse, Vector, Vue 3 | `telemetry/` | --- @@ -177,7 +177,7 @@ Python • TensorFlow/Keras • EfficientNetV2B0 • Google Colab (GPU **Rust** • **Axum** • **ONNX Runtime** • TFLite • TensorFlow.js ### DevOps & Infrastruktur -Docker • Docker Compose • Coolify • Traefik • Tailscale • GitHub Actions (CI/CD) +Nix • systemd • Caddy • Tailscale • GitHub Actions (CI/CD) ### Observabilitas Prometheus • Metric Ingester (Go) • Vector • ClickHouse • Query Proxy (Go) • Telemetry UI (Vue 3) @@ -192,8 +192,8 @@ Prometheus • Metric Ingester (Go) • Vector • ClickHouse • Qu - **Python 3.9–3.11** — pipeline ML - **Rust & Cargo** — `apps/ml-service` (inference) & `apps/tauri` (Android) - **Java 21 + Android SDK** — build Android APK -- **Docker & Docker Compose** — deployment & telemetry -- **PostgreSQL** — backend API +- **Nix** — build & deployment produksi (flake.nix, systemd services) +- **PostgreSQL (Neon)** — backend API (via pgbouncer pool imrnes `100.121.180.82:6432`) ### Instalasi @@ -239,9 +239,14 @@ Salin `.env.example` ke `.env` dan isi: ### Deployment +Produksi: **Nix + systemd + Caddy** (Docker sudah dihapus dari produksi 2026-08-02). +Deploy via GitHub Actions → `nix build .#` → `nix copy ssh://imrnes` → `systemctl restart zeavis-`. +Reverse proxy: Caddy 2.11.4 (`systemd caddy.service`, auto-TLS Let's Encrypt, HTTP/3). + ```bash -docker compose up -d # App services -make telemetry-up # Telemetry stack +# Port produksi: zeavis-api 4006, zeavis-web (nginx) 4011, zeavis-ml 4012 +# Database: Neon via pgbouncer pool imrnes 100.121.180.82:6432 +make telemetry-up # Telemetry stack (dev/local) ``` > 📖 **Panduan infrastruktur:** [`infra/README.md`](infra/README.md) @@ -307,7 +312,7 @@ bun run tauri android build --apk # Build APK production | `bun install` gagal | `bun --version` — pastikan ≥ 1.x | | API perlu database | Isi `DATABASE_URL` di root `.env` | | ML service gagal muat model | `ls Machine_Learning/model/model.onnx` — jalankan pipeline ML jika belum ada | -| Docker Compose gagal | `docker network create app-shared-net` | +| Service tidak restart setelah deploy | `systemctl restart zeavis-api zeavis-web zeavis-ml` (Nix+systemd, bukan Docker) | | Konversi TFJS gagal | `export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python` | --- diff --git a/apps/ml-service/.env.example b/apps/ml-service/.env.example index 0380cfc..6d70cdd 100644 --- a/apps/ml-service/.env.example +++ b/apps/ml-service/.env.example @@ -1,4 +1,4 @@ MODEL_PATH=../../Machine_Learning/model/model.onnx MODEL_INPUT_SIZE=224 ML_SERVICE_HOST=0.0.0.0 -ML_SERVICE_PORT=8001 +ML_SERVICE_PORT=4012 diff --git a/apps/ml-service/README.md b/apps/ml-service/README.md index 1439901..2df537e 100644 --- a/apps/ml-service/README.md +++ b/apps/ml-service/README.md @@ -59,7 +59,7 @@ Service akan mencari model di path default: ../../Machine_Learning/model/model.onnx ``` -### Opsi 2: Local Development dengan .env.example (Port 8001) +### Opsi 2: Local Development dengan .env.example (Port 4012) ```bash source .env.example diff --git a/docs/superpowers/plans/2026-05-22-api-ml-service-migration.md b/docs/superpowers/plans/2026-05-22-api-ml-service-migration.md index 812fa37..5410948 100644 --- a/docs/superpowers/plans/2026-05-22-api-ml-service-migration.md +++ b/docs/superpowers/plans/2026-05-22-api-ml-service-migration.md @@ -532,3 +532,7 @@ Verified: - ML service health: - classifyImage against running ML service: ``` + +--- + +> Catatan (2026-08-02): port produksi sekarang API 4006, nginx 4011, ML 4012; deploy Nix+systemd+Caddy. diff --git a/docs/superpowers/plans/2026-05-22-backend-image-classification.md b/docs/superpowers/plans/2026-05-22-backend-image-classification.md index 36655fe..a591d25 100644 --- a/docs/superpowers/plans/2026-05-22-backend-image-classification.md +++ b/docs/superpowers/plans/2026-05-22-backend-image-classification.md @@ -631,3 +631,7 @@ Open `/dashboard`. Confirm the image classification form renders. If no database - Spec coverage: backend TFJS inference, uploader integration, DB persistence, API routes, shared types, frontend upload/result/history, and verification are covered. - Placeholder scan: no TBD/TODO/fill-later placeholders remain; every file and route has explicit behavior. - Type consistency: `ImageClassificationRecord`, `PredictionProbability`, and `UploaderMetadata` are defined once in shared and used consistently across API and web. + +--- + +> Catatan (2026-08-02): port produksi sekarang API 4006, nginx 4011, ML 4012; deploy Nix+systemd+Caddy. diff --git a/docs/superpowers/plans/2026-05-22-docker-deployment.md b/docs/superpowers/plans/2026-05-22-docker-deployment.md index 87344ae..17c1d24 100644 --- a/docs/superpowers/plans/2026-05-22-docker-deployment.md +++ b/docs/superpowers/plans/2026-05-22-docker-deployment.md @@ -289,6 +289,8 @@ git commit -m "feat: add ML service Docker image" ## Task 5: Add production Docker Compose +> Catatan (2026-08-02): port produksi sekarang API 4006, nginx 4011, ML 4012; deploy Nix+systemd+Caddy. + **Files:** - Create: `docker-compose.yml` diff --git a/docs/superpowers/plans/2026-05-22-fullstack-education-catalog.md b/docs/superpowers/plans/2026-05-22-fullstack-education-catalog.md index 6837b65..01ad7f8 100644 --- a/docs/superpowers/plans/2026-05-22-fullstack-education-catalog.md +++ b/docs/superpowers/plans/2026-05-22-fullstack-education-catalog.md @@ -802,3 +802,7 @@ If no fixes were required, do not create an empty commit. - Spec coverage: shared contract, backend schema/routes, frontend pages/manual flow, error states, and verification are all covered. - Placeholder scan: no TBD/TODO/fill-later placeholders are present. Task 4 uses explicit behavior requirements for page files because page markup is lengthy, but all required states and wiring are specified. - Type consistency: shared names (`DiseaseSlug`, `DiseaseCatalogItem`, `ManualClassificationRequest`, `ManualClassificationRecord`, `DashboardSummary`) are consistent across tasks. + +--- + +> Catatan (2026-08-02): port produksi sekarang API 4006, nginx 4011, ML 4012; deploy Nix+systemd+Caddy. diff --git a/docs/superpowers/plans/2026-05-22-fullstack-monorepo-scaffold.md b/docs/superpowers/plans/2026-05-22-fullstack-monorepo-scaffold.md index d86df5f..6b40d70 100644 --- a/docs/superpowers/plans/2026-05-22-fullstack-monorepo-scaffold.md +++ b/docs/superpowers/plans/2026-05-22-fullstack-monorepo-scaffold.md @@ -1323,3 +1323,7 @@ git commit -m "Document fullstack app commands" - Placeholder scan: no TBD/TODO placeholders are present; deferred features are explicitly listed in the design and not implemented. - Type consistency: `AppStatus`, `createAppStatus`, route paths, package names, and project paths are consistent across tasks. - Known execution note: Task 4 requires adding `@radix-ui/react-slot` because the shadcn-style `Button` uses `Slot` for `asChild` support. + +--- + +> Catatan (2026-08-02): port produksi sekarang API 4006, nginx 4011, ML 4012; deploy Nix+systemd+Caddy. diff --git a/docs/superpowers/plans/2026-05-22-js-ts-dependency-update.md b/docs/superpowers/plans/2026-05-22-js-ts-dependency-update.md index 2d0946e..d4d0626 100644 --- a/docs/superpowers/plans/2026-05-22-js-ts-dependency-update.md +++ b/docs/superpowers/plans/2026-05-22-js-ts-dependency-update.md @@ -197,3 +197,7 @@ Do not claim completion unless the final verification command passed. - Spec coverage: The plan updates only JS/TS manifests, regenerates `bun.lock`, allows minimal compatibility refactors, and verifies with `bun run typecheck` and `bun run build`. - Placeholder scan: No TODO/TBD placeholders remain. - Scope check: Python/ML dependencies are explicitly out of scope and verified unchanged. + +--- + +> Catatan (2026-08-02): port produksi sekarang API 4006, nginx 4011, ML 4012; deploy Nix+systemd+Caddy. diff --git a/docs/superpowers/plans/2026-05-22-ml-service.md b/docs/superpowers/plans/2026-05-22-ml-service.md index 8da1de6..73f4328 100644 --- a/docs/superpowers/plans/2026-05-22-ml-service.md +++ b/docs/superpowers/plans/2026-05-22-ml-service.md @@ -581,3 +581,7 @@ Verified: ``` Expected: final response only claims checks that were actually run. + +--- + +> Catatan (2026-08-02): port produksi sekarang API 4006, nginx 4011, ML 4012; deploy Nix+systemd+Caddy. diff --git a/docs/superpowers/plans/2026-05-22-production-mvp.md b/docs/superpowers/plans/2026-05-22-production-mvp.md index fc8191a..edca9d5 100644 --- a/docs/superpowers/plans/2026-05-22-production-mvp.md +++ b/docs/superpowers/plans/2026-05-22-production-mvp.md @@ -2490,3 +2490,7 @@ Spec coverage: Red-flag scan: no unresolved planning markers are intentionally present. The only implementation choice left to workers is resolving compile errors revealed by real typecheck output, which must be fixed directly before completing each task. Type consistency: shared DTO names are introduced first and reused by backend/frontend tasks. Diagnosis status strings match the design spec. + +--- + +> Catatan (2026-08-02): port produksi sekarang API 4006, nginx 4011, ML 4012; deploy Nix+systemd+Caddy. diff --git a/docs/superpowers/plans/2026-05-22-root-readme.md b/docs/superpowers/plans/2026-05-22-root-readme.md index 7c78fee..c5ea917 100644 --- a/docs/superpowers/plans/2026-05-22-root-readme.md +++ b/docs/superpowers/plans/2026-05-22-root-readme.md @@ -220,6 +220,8 @@ curl -X POST http://localhost:8001/predict -F "file=@/path/to/corn-leaf.jpg" ## Docker Deployment +> Catatan (2026-08-02): port produksi sekarang API 4006, nginx 4011, ML 4012; deploy Nix+systemd+Caddy. + File `docker-compose.yml` di root menyiapkan tiga service produksi: - `web` untuk frontend diff --git a/docs/superpowers/plans/2026-05-23-rust-onnx-ml-service.md b/docs/superpowers/plans/2026-05-23-rust-onnx-ml-service.md index 426f127..1257696 100644 --- a/docs/superpowers/plans/2026-05-23-rust-onnx-ml-service.md +++ b/docs/superpowers/plans/2026-05-23-rust-onnx-ml-service.md @@ -1474,6 +1474,8 @@ git commit -m "test: add ONNX parity validation script" ## Task 10: Update Docker image for Rust ML service +> Catatan (2026-08-02): port produksi sekarang API 4006, nginx 4011, ML 4012; deploy Nix+systemd+Caddy. + **Files:** - Modify: `apps/ml-service/Dockerfile` diff --git a/docs/superpowers/specs/2026-05-22-api-ml-service-migration-design.md b/docs/superpowers/specs/2026-05-22-api-ml-service-migration-design.md index 6d92c12..9c3031d 100644 --- a/docs/superpowers/specs/2026-05-22-api-ml-service-migration-design.md +++ b/docs/superpowers/specs/2026-05-22-api-ml-service-migration-design.md @@ -99,3 +99,7 @@ Required verification after implementation: - Exercise `classifyImage(file)` against the running ML service with a local image file or synthetic image and confirm it returns `predictedDiseaseSlug`, `confidence`, and sorted probabilities. If full API route testing is blocked by external database or upload service requirements, report that explicitly and include the lower-level verification evidence. + +--- + +> Catatan (2026-08-02): port produksi sekarang API 4006, nginx 4011, ML 4012; deploy Nix+systemd+Caddy. diff --git a/docs/superpowers/specs/2026-05-22-backend-image-classification-design.md b/docs/superpowers/specs/2026-05-22-backend-image-classification-design.md index f3c7cfe..00dc180 100644 --- a/docs/superpowers/specs/2026-05-22-backend-image-classification-design.md +++ b/docs/superpowers/specs/2026-05-22-backend-image-classification-design.md @@ -88,3 +88,7 @@ The implementation should pass: - `bun run build` Manual verification should launch API and web locally, open the dashboard, select an image, submit it, and verify that uploader/model/database success or structured error states render without crashing. + +--- + +> Catatan (2026-08-02): port produksi sekarang API 4006, nginx 4011, ML 4012; deploy Nix+systemd+Caddy. diff --git a/docs/superpowers/specs/2026-05-22-docker-deployment-design.md b/docs/superpowers/specs/2026-05-22-docker-deployment-design.md index 5d73434..6b4e9c3 100644 --- a/docs/superpowers/specs/2026-05-22-docker-deployment-design.md +++ b/docs/superpowers/specs/2026-05-22-docker-deployment-design.md @@ -48,6 +48,8 @@ Each image will also receive a SHA tag for traceability. ## Compose deployment +> Catatan (2026-08-02): port produksi sekarang API 4006, nginx 4011, ML 4012; deploy Nix+systemd+Caddy. + The VPS will run `docker compose` from `/opt/ZeaVis-Edu`. The compose file will define: diff --git a/docs/superpowers/specs/2026-05-22-fullstack-education-catalog-design.md b/docs/superpowers/specs/2026-05-22-fullstack-education-catalog-design.md index 1f6000e..1b5c64a 100644 --- a/docs/superpowers/specs/2026-05-22-fullstack-education-catalog-design.md +++ b/docs/superpowers/specs/2026-05-22-fullstack-education-catalog-design.md @@ -68,3 +68,7 @@ The implementation should pass: - `bun run build` Because this includes frontend behavior, the app should also be launched locally and the main pages/manual flow should be checked in a browser if the environment allows it. + +--- + +> Catatan (2026-08-02): port produksi sekarang API 4006, nginx 4011, ML 4012; deploy Nix+systemd+Caddy. diff --git a/docs/superpowers/specs/2026-05-22-fullstack-monorepo-scaffold-design.md b/docs/superpowers/specs/2026-05-22-fullstack-monorepo-scaffold-design.md index 7e8f230..713bfdb 100644 --- a/docs/superpowers/specs/2026-05-22-fullstack-monorepo-scaffold-design.md +++ b/docs/superpowers/specs/2026-05-22-fullstack-monorepo-scaffold-design.md @@ -74,3 +74,7 @@ No test framework is added in this scaffold. Tests should be introduced with the - Real dashboard data. - Database migrations for domain entities. - Deployment configuration. + +--- + +> Catatan (2026-08-02): port produksi sekarang API 4006, nginx 4011, ML 4012; deploy Nix+systemd+Caddy. diff --git a/docs/superpowers/specs/2026-05-22-js-ts-dependency-update-design.md b/docs/superpowers/specs/2026-05-22-js-ts-dependency-update-design.md index 6702220..5550808 100644 --- a/docs/superpowers/specs/2026-05-22-js-ts-dependency-update-design.md +++ b/docs/superpowers/specs/2026-05-22-js-ts-dependency-update-design.md @@ -33,3 +33,7 @@ If either command fails due to dependency updates, fix the underlying compatibil - ML pipeline changes - UI redesigns or feature additions - Database schema changes unless a dependency update requires a generated type/config compatibility fix + +--- + +> Catatan (2026-08-02): port produksi sekarang API 4006, nginx 4011, ML 4012; deploy Nix+systemd+Caddy. diff --git a/docs/superpowers/specs/2026-05-22-ml-service-design.md b/docs/superpowers/specs/2026-05-22-ml-service-design.md index 9cdd6f9..e351d76 100644 --- a/docs/superpowers/specs/2026-05-22-ml-service-design.md +++ b/docs/superpowers/specs/2026-05-22-ml-service-design.md @@ -82,3 +82,7 @@ Manual verification for the initial implementation: - Call `POST /predict` with a real image file when an example corn leaf image is available. The repository does not currently have a Python test suite for this new service. Automated tests can be added later if the service grows beyond the initial capstone scope. + +--- + +> Catatan (2026-08-02): port produksi sekarang API 4006, nginx 4011, ML 4012; deploy Nix+systemd+Caddy. diff --git a/docs/superpowers/specs/2026-05-22-production-mvp-design.md b/docs/superpowers/specs/2026-05-22-production-mvp-design.md index d1f66d6..ee62a43 100644 --- a/docs/superpowers/specs/2026-05-22-production-mvp-design.md +++ b/docs/superpowers/specs/2026-05-22-production-mvp-design.md @@ -283,3 +283,7 @@ Manual error path: 2. Call a diagnosis endpoint while logged out and confirm unauthorized response. 3. Access expert review as a non-expert and confirm forbidden response. 4. Temporarily omit Google OAuth env and confirm Google login is hidden. + +--- + +> Catatan (2026-08-02): port produksi sekarang API 4006, nginx 4011, ML 4012; deploy Nix+systemd+Caddy. diff --git a/docs/superpowers/specs/2026-05-23-rust-onnx-ml-service-design.md b/docs/superpowers/specs/2026-05-23-rust-onnx-ml-service-design.md index 007781c..c5d2925 100644 --- a/docs/superpowers/specs/2026-05-23-rust-onnx-ml-service-design.md +++ b/docs/superpowers/specs/2026-05-23-rust-onnx-ml-service-design.md @@ -143,6 +143,8 @@ The repository has no existing global test suite, so the Rust service checks bec ## Documentation and deployment updates +> Catatan (2026-08-02): port produksi sekarang API 4006, nginx 4011, ML 4012; deploy Nix+systemd+Caddy. + Update documentation so runtime serving no longer describes FastAPI/TensorFlow as the production ML service. Keep Python/TensorFlow documentation for training and export. Update: diff --git a/infra/README.md b/infra/README.md index ccbf149..768f0af 100644 --- a/infra/README.md +++ b/infra/README.md @@ -1,6 +1,8 @@ # Infrastruktur — ZeaVis Edu > Arsitektur multi-VPS untuk deployment produksi ZeaVis Edu dengan Tailscale mesh VPN dan observabilitas penuh. +> +> > **Catatan (2026-08-02):** Produksi kini memakai **Nix + systemd + Caddy 2.11.4** (Docker/Traefik/Coolify dihapus). Deploy: GitHub Actions → `nix build` → `nix copy ssh://` → `systemctl restart`. ← [Kembali ke README utama](../README.md) @@ -29,7 +31,7 @@ ZeaVis Edu berjalan di **dua VPS terpisah** yang terhubung melalui **Tailscale** │ │ │ │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │ ┌──────────┐ ┌──────────────┐ │ │ │ Web │ │ API │ │ ML │ │ │ │Prometheus│ │Metric │ │ -│ │:80 │ │:4006 │ │:4012 │ │ │ │:9090 │ │Ingester │ │ +│ │:4011 │ │:4006 │ │:4012 │ │ │ │:9090 │ │Ingester │ │ │ │/metrics │ │/metrics │ │/metrics │ │ │ │ │ │:9091 │ │ │ └──────────┘ └──────────┘ └──────────┘ │ │ └────┬─────┘ └──────┬───────┘ │ │ ┌──────────────────────────────────────┐ │ │ │ │ │ @@ -38,8 +40,8 @@ ZeaVis Edu berjalan di **dua VPS terpisah** yang terhubung melalui **Tailscale** │ └──────────────────────────────────────┘ │ │ ┌──────────────────────────────────────┐ │ │ │ │ │ Vector │ │ │ ┌──────────────┐ │ │ │ :9001 │ │ -│ │ Traefik │ │ │ └────────────────┬─────────────────────┘ │ -│ │ (Coolify) │ │ │ │ │ +│ │ Caddy │ │ │ └────────────────┬─────────────────────┘ │ +│ │ 2.11.4 │ │ │ │ │ │ └──────────────┘ │ │ ▼ │ │ │ │ ┌──────────────────────────────────────┐ │ │ ZeaVis Edu Apps via │ │ │ ClickHouse │ │ @@ -58,14 +60,14 @@ ZeaVis Edu berjalan di **dua VPS terpisah** yang terhubung melalui **Tailscale** │ │ │ │ :8181 │ │ │ │ │ └──────────────────────────────────────┘ │ │ │ │ │ -│ │ │ Coolify + Traefik handles: │ -│ │ │ telemetry.zeavisedu.asepharyana.my.id │ +│ │ │ Caddy handles: │ +│ │ │ telemetry.zeavisedu.asepharyana.my.id │ └─────────────────────────────────────────────┘ └──────────────────────────────────────────────┘ ``` | VPS | Hostname | OS | Peran | |---|---|---|---| -| **App VPS** | `imrnes` | Arch Linux | Web (:80), API (:4006), ML Service (:4012) | +| **App VPS** | `imrnes` | Arch Linux | Web nginx (:4011), API (:4006), ML Service (:4012) | | **Telemetry VPS** | `orange` | Ubuntu | Prometheus, ClickHouse, Telemetry UI | --- @@ -100,11 +102,9 @@ ZeaVis Edu berjalan di **dua VPS terpisah** yang terhubung melalui **Tailscale** ### App VPS (imrnes — 100.121.180.82) ```bash -# Create Docker network -docker network create app-shared-net -docker network create telemetry-net - -# ZeaVis Edu apps deploy automatically via GitHub Actions +# Semua service dikelola Nix + systemd — deploy otomatis via GitHub Actions: +# nix build .# → nix copy ssh://imrnes → systemctl restart zeavis- +# Reverse proxy: Caddy 2.11.4 (systemd caddy.service, /etc/caddy/Caddyfile, auto-TLS LE) ``` ### Telemetry VPS (orange — 100.96.248.86) @@ -113,10 +113,8 @@ Deploy via GitHub Actions atau manual: ```bash ssh mytheclipse@100.96.248.86 -mkdir -p /opt/telemetry -cd /opt/telemetry -docker compose up -d -bash clickhouse/init.sh +# Telemetry stack juga Nix + systemd (Docker dihapus dari produksi 2026-08-02) +# Deploy otomatis via GitHub Actions → nix build → nix copy ssh:// → systemctl restart ``` --- @@ -127,16 +125,17 @@ bash clickhouse/init.sh | Port | Service | Akses | |---|---|---| -| 80/443 | Web (via Traefik/Coolify) | Public | -| 4006 | API metrics | Tailscale-only | -| 4012 | ML service metrics | Tailscale-only | +| 80/443 | Web entry (Caddy, auto-TLS LE) | Public | +| 4011 | Web nginx (`zeavisedu.asepharyana.my.id`) | Public (via Caddy) | +| 4006 | API metrics (zeavis-api) | via Caddy / Tailscale-only | +| 4012 | ML service metrics (zeavis-ml) | Tailscale-only | | 9100 | Node Exporter | Tailscale-only | ### Telemetry VPS (orange) | Port | Service | Akses | |---|---|---| -| 80/443 | Telemetry UI (via Coolify Traefik) | Public | +| 80/443 | Telemetry UI (via Caddy) | Public | | 8181 | Telemetry UI (direct) | Tailscale-only | | 9090 | Prometheus | Tailscale-only | | 9091 | Metric Ingester | Tailscale-only |