From d09a702d6466f3cfc5709e793cd0452b582603bd Mon Sep 17 00:00:00 2001 From: amaliadwiy Date: Tue, 21 Apr 2026 17:30:07 +0800 Subject: [PATCH] upd: swagger docs, api key auth, bug fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - tambah Elysia Swagger di /docs dengan deskripsi lengkap semua endpoint - tambah API key auth (X-API-Key) untuk klien eksternal di POST /api/bugs - tambah normalisasi BugSource: SYSTEM/USER untuk eksternal, QC/SYSTEM/USER untuk dashboard - perbaiki source schema jadi optional string agar tidak reject nilai unknown dari klien lama - hapus field status dari form create bug (selalu OPEN) - perbaiki typo desa_plus → appId di apps.$appId.errors.tsx - tambah toggle hide/show stack trace di bug-reports.tsx dan apps.$appId.errors.tsx - perbaiki grafik desa (width(-1)/height(-1)) dengan minWidth: 0 pada grid item - perbaiki error &[data-active] inline style di DashboardLayout → pindah ke CSS class - update CLAUDE.md dengan arsitektur lengkap Co-Authored-By: Claude Sonnet 4.6 --- .env.example | 3 + CLAUDE.md | 157 +++++--- bun.lock | 74 +++- package.json | 1 + src/app.ts | 374 +++++++++++++++--- src/frontend/components/DashboardLayout.tsx | 10 - src/frontend/routes/apps.$appId.errors.tsx | 32 +- .../apps.$appId.villages.$villageId.tsx | 15 +- src/frontend/routes/bug-reports.tsx | 72 ++-- src/frontend/routes/users.tsx | 4 +- src/index.css | 2 +- src/index.tsx | 2 +- src/lib/env.ts | 1 + 13 files changed, 545 insertions(+), 202 deletions(-) diff --git a/.env.example b/.env.example index aa4a86e..6721966 100644 --- a/.env.example +++ b/.env.example @@ -16,6 +16,9 @@ GOOGLE_CLIENT_SECRET= # Role SUPER_ADMIN_EMAIL=admin@example.com +# API Key for external clients (e.g. mobile apps) +API_KEY=your-secret-api-key-here + # Telegram Notification (optional) TELEGRAM_NOTIFY_TOKEN= TELEGRAM_NOTIFY_CHAT_ID= diff --git a/CLAUDE.md b/CLAUDE.md index af4f5fe..14d73f5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,82 +1,121 @@ -Default to using Bun instead of Node.js. +# CLAUDE.md -- Use `bun ` instead of `node ` or `ts-node ` -- Use `bun test` instead of `jest` or `vitest` -- Use `bun install` instead of `npm install` or `yarn install` or `pnpm install` -- Use `bun run