# PDKBSBU Web VPS Deployment Readiness

Exported at: 2026-05-18T12:41:08.077Z

## Verdict

Status: READY_FOR_VPS_PREPARATION_NOT_PRODUCTION

Aplikasi siap untuk masuk tahap persiapan VPS/staging. Belum siap production sampai VPS, DATABASE_URL, migration SQL review, migrate, seed, dan smoke test selesai.

## Summary

- Total checks: 11
- Ready: 2
- Pending VPS: 6
- Needs approval: 1
- Blocked: 2

## Readiness Items

### Application Build — READY
- Owner: Fara
- Check: npm run typecheck dan npm run build sudah pass pada checkpoint terakhir.
- Evidence: Latest checkpoint: typecheck ✅, build ✅, 38 routes.

### Project Checkpoint — READY
- Owner: Fara
- Check: Final project checkpoint dan export Markdown sudah tersedia.
- Evidence: /project-checkpoint dan /api/project-checkpoint/export.

### Source Transfer — PENDING_VPS
- Owner: Boss/VPS
- Check: Project perlu dicopy/push ke VPS setelah server tersedia.
- Evidence: Target VPS belum disiapkan.

### Runtime — PENDING_VPS
- Owner: Boss/VPS
- Check: Install Node.js LTS, npm, dan process manager seperti PM2/systemd.
- Evidence: Belum diverifikasi di VPS.

### PostgreSQL — PENDING_VPS
- Owner: Boss/VPS
- Check: Install PostgreSQL, buat database/user, dan siapkan DATABASE_URL.
- Evidence: DATABASE_URL production belum diverifikasi.

### Environment — PENDING_VPS
- Owner: Boss/VPS
- Check: Buat .env.production dengan DATABASE_URL dan secret/config production.
- Evidence: Env production belum dibuat di VPS.

### Migration SQL — NEEDS_APPROVAL
- Owner: Boss + Fara
- Check: Jalankan npm run db:generate hanya setelah Boss approve; ini generate SQL saja.
- Evidence: work_order_drafts sudah ada di schema source, migration SQL belum dibuat.

### DB Migration — BLOCKED
- Owner: Boss + Fara
- Check: Jangan menjalankan npm run db:migrate sebelum SQL direview, DATABASE_URL benar, dan Boss approve.
- Evidence: Belum ada migration SQL yang direview.

### Seed Data — BLOCKED
- Owner: Boss + Fara
- Check: Seed harus dry-run dulu, lalu execute hanya setelah hasilnya aman dan Boss approve.
- Evidence: db:seed:cache -- --execute belum dijalankan.

### Web Server — PENDING_VPS
- Owner: Boss/VPS
- Check: Siapkan nginx reverse proxy, domain, firewall, dan SSL.
- Evidence: Domain/SSL/VPS belum diverifikasi.

### Production Smoke Test — PENDING_VPS
- Owner: Fara
- Check: Setelah deploy, test route utama, DB readiness, counts, draft flow, dan export.
- Evidence: Belum bisa dilakukan sebelum VPS tersedia.

## Minimum VPS Spec

- Ubuntu 22.04/24.04 LTS atau Debian 12.
- RAM minimal 2 GB untuk staging kecil; lebih nyaman 4 GB jika PostgreSQL satu server.
- Storage minimal 20 GB SSD.
- Node.js LTS.
- PostgreSQL 15+.
- nginx + Certbot/SSL.
- Firewall hanya buka SSH, HTTP, HTTPS; database jangan public internet.

## Command Reference

- `npm install` — Install dependencies di VPS setelah source code masuk.
- `npm run typecheck` — Validasi TypeScript di VPS.
- `npm run build` — Build production di VPS.
- `npm run db:generate` — Generate SQL migration saja; perlu approval Boss dulu.
- `npm run db:migrate` — Operasi tulis DB; hanya setelah SQL direview dan Boss approve.
- `npm run db:seed:cache` — Dry-run seed/import cache ke PostgreSQL.
- `npm run db:seed:cache -- --execute` — Operasi tulis seed; hanya setelah dry-run aman dan Boss approve.
- `npm run start` — Start Next.js production; untuk VPS lebih baik via PM2/systemd.

## Hard Stop Rules

- Jangan expose PostgreSQL ke public internet.
- Jangan commit/upload .env production ke repository publik.
- Jangan menjalankan db:migrate sebelum DATABASE_URL menunjuk database yang benar.
- Jangan menjalankan seed execute sebelum dry-run dan count comparison aman.
- Jangan aktifkan production untuk user real sebelum smoke test selesai.

## Safe Next Sequence

1. Boss siapkan VPS.
2. Install Node.js LTS, PostgreSQL, nginx, firewall, SSL tooling.
3. Copy project ke VPS.
4. Buat .env.production dan verify DATABASE_URL.
5. Jalankan npm install, npm run typecheck, npm run build.
6. Jika Boss approve, jalankan npm run db:generate.
7. Review SQL migration.
8. Jika aman dan Boss approve, jalankan npm run db:migrate.
9. Jalankan seed dry-run, lalu execute hanya jika aman dan approve.
10. Start app via PM2/systemd dan lakukan smoke test.
