Skip to content

Backend hardening + API v1 + unit test + CI - #21

Open
caya8205-2 wants to merge 13 commits into
mainfrom
migrasi-db
Open

Backend hardening + API v1 + unit test + CI#21
caya8205-2 wants to merge 13 commits into
mainfrom
migrasi-db

Conversation

@caya8205-2

@caya8205-2 caya8205-2 commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Ringkasan

ngelanjutin dari sini karna ini branch yg punya commit terbaru

Yang masuk di PR ini:

  • hardening API + versioning ke /api/v1
  • validasi request di endpoint write
  • rate limiting, security headers, CORS, JWT hardening, dan token blacklist
  • logging request + pembatasan body request
  • Swagger di /api/docs
  • unit test buat validator, middleware, dan blacklist
  • root-level test runner via Turbo
  • CI buat typecheck + unit test di push/PR
  • update dokumentasi backend + tambah MIT license

Catatan

endpoint lama /api/... masih ttp jalan karena FE sekarang belum di migrate ke /api/v1
klo mau langsung pake API versi baru, tinggal set di env:

NEXT_PUBLIC_API_URL.../api/v1

Testing

  • pnpm check-types
  • pnpm test40/40 pass
  • CI juga sudah mencakup typecheck + unit test

Ada satu type error lama di web-app yang sekalian dibenerin karena sekarang ikut kena typecheck CI (mermaid types).

NotCayaa and others added 13 commits February 22, 2026 21:19
…enerin tombol cancel + routing hooks tengs
- ai engine rework
- endpoint baru buat History + My Project page
- table sql baru di supabase buat kedua page diatas
- implementasi dan integrasi db dan engine ke FE
- wm rework di preview page
- output rework di preview page
- preview gabisa di copas ataupun di donglot jadi mantap
- diagram issue dengan mermaid = fixed
- next gw bakal integrasi db ke coins sama user, biar ga welcome dr maya mulu
- endpoint baru 'GET /api/user/me' buat data user
- fix endpoint coins yg ngawur gara2 ai, sekarang udh sesuai format response nya dengan yg di db, jadi konsisten dibungkus dalem object 'data'.
- ganti component2 yg masih hardcoded jadi data beneran.
- Rate limiting on all routes, stricter on auth endpoints
- Helmet security headers (CSP, HSTS, clickjacking protection)
- XSS sanitization and HTTP parameter pollution guard
- Zod request validation on auth, projects, AI, and export endpoints
- CORS restricted to configured frontend origin
- JWT secret enforced in production
- Token blacklist backed by Redis with in-memory fallback
- Structured JSON logging with request IDs
- Request body size limited to 1MB
- Swagger/OpenAPI docs at /api/docs
- All endpoints versioned under /api/v1, legacy /api kept as deprecated
- 40 Vitest unit tests for web-api (Zod validators, middlewares, token blacklist)
- pnpm test runnable from repo root via turbo run test
- Restructure API-Endpoint-Docs with accurate v1 section and legacy section
- Add test.yml workflow (install, check-types, unit tests)
- Add check-types script to web-api covering src and tests
- Add check-types alias to web-app for uniform turbo task
- Fix missing mermaid type declarations in web-app
@vercel

vercel Bot commented Sep 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
planify-web-app Error Error Sep 7, 2026 2:40am UTC
planify-web-app-4dj8 Error Error Sep 7, 2026 2:40am UTC

@caya8205-2 caya8205-2 self-assigned this Sep 7, 2026
@caya8205-2 caya8205-2 added P1 Prioritas menengah: penting tapi tidak mendesak backend Perubahan di backend (web-api) security Isu atau perbaikan keamanan tests Unit/integration test dan CI labels Sep 7, 2026
@caya8205-2

Copy link
Copy Markdown
Collaborator Author

gabisa gw merge langsung gara2 CI vercel gagal, tolong merge bos @yudha556

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Perubahan di backend (web-api) P1 Prioritas menengah: penting tapi tidak mendesak security Isu atau perbaikan keamanan tests Unit/integration test dan CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants