Commit Graph
72 Commits
Author SHA1 Message Date
Asep Haryana SaputraandClaude Opus 4.7 1978597bcf feat: add Docker deployment workflow
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 21:20:56 +00:00
Asep Haryana Saputra 5ca95907a0 feat: implement Docker deployment plan with web, API, and ML services 2026-05-22 20:11:37 +00:00
Asep Haryana SaputraandClaude Opus 4.7 1d4355e9f0 docs: add Docker deployment design
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 20:08:13 +00:00
Asep Haryana SaputraandClaude Opus 4.7 e84be0d42f fix: handle malformed ML service responses
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 20:00:01 +00:00
Asep Haryana SaputraandClaude Opus 4.7 b81fecaa3f chore: remove API local model dependencies
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 19:54:31 +00:00
Asep Haryana SaputraandClaude Opus 4.7 1689f3f44e feat: call ML service for image classification
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 19:53:10 +00:00
Asep Haryana SaputraandClaude Opus 4.7 9a642a8581 feat: add ML service URL config
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 19:50:25 +00:00
Asep Haryana SaputraandClaude Opus 4.7 b177662241 docs: add API ML service migration plan
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 19:49:04 +00:00
Asep Haryana SaputraandClaude Opus 4.7 b69b32f5b3 docs: add API ML service migration spec
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 19:46:48 +00:00
Asep Haryana SaputraandClaude Opus 4.7 c3e7453390 chore: remove local Claude artifact from tracking
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 19:41:00 +00:00
Asep Haryana SaputraandClaude Opus 4.7 ed8cecc3f5 fix: align ML service labels with training order
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 19:40:41 +00:00
Asep Haryana Saputra 59877bc17f chore: add __pycache__ to .gitignore 2026-05-22 19:35:44 +00:00
Asep Haryana SaputraandClaude Opus 4.7 47d9a53a44 docs: add ML service implementation plan
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 19:34:11 +00:00
Asep Haryana SaputraandClaude Opus 4.7 f08ba6753d chore: ignore ML service virtualenv
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 19:34:03 +00:00
Asep Haryana SaputraandClaude Opus 4.7 3b0416b946 docs: add ML service usage guide
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 19:30:05 +00:00
Asep Haryana SaputraandClaude Opus 4.7 a30071d8e8 feat: add ML service API routes
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 19:29:44 +00:00
Asep Haryana SaputraandClaude Opus 4.7 f3d2b8d72e feat: add ML model prediction service
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 19:29:13 +00:00
Asep Haryana SaputraandClaude Opus 4.7 ca9cbb12bf feat: add ML service response schemas
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 19:28:43 +00:00
Asep Haryana SaputraandClaude Opus 4.7 37831ba717 feat: add ML service Moon tasks
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 19:23:43 +00:00
Asep Haryana SaputraandClaude Opus 4.7 d21bd2e683 feat: scaffold ML service configuration
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 19:21:15 +00:00
Asep Haryana SaputraandClaude Opus 4.7 5b441282fc docs: add ML service design spec
Document the agreed FastAPI inference service boundary before implementation planning.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 19:14:56 +00:00
Asep Haryana Saputra 8415cbb2de feat: add database seeding script for disease catalog and expert user 2026-05-22 18:54:23 +00:00
Asep Haryana Saputra 1f4e0fbef3 fix: update environment variable usage in scripts and enhance CSS theming 2026-05-22 18:50:07 +00:00
Asep Haryana Saputra 553e8f49aa fix: remove deprecated baseUrl option from tsconfig files 2026-05-22 18:36:45 +00:00
Asep Haryana Saputra ab81168be7 chore: update dependencies and build scripts
- Updated @moonrepo/cli to version 2.2.5 and typescript to version 6.0.3 in package.json and shared package.json.
- Modified build script in package.json to run shared, api, and web builds.
- Removed unnecessary type and language declarations from shared moon.yml.
- Added ignoreDeprecations option in tsconfig.base.json to handle TypeScript 6.0 deprecations.
2026-05-22 18:30:40 +00:00
Asep Haryana Saputra 32a034a083 feat: add implementation plan and design for JS/TS dependency updates 2026-05-22 17:55:44 +00:00
Asep Haryana Saputra 1994b9ed17 Merge branch 'worktree-production-mvp' 2026-05-22 17:46:40 +00:00
Asep Haryana SaputraandClaude Opus 4.7 c623de9959 fix: harden production auth and review flow
- Add environment-aware CORS and secure cookie support:
  * Add secureCookies config to env.ts based on SECURE_COOKIES env var or https detection
  * Integrate @elysiajs/cors with credentials and origin configuration
  * Update cookie helpers to use SameSite=None; Secure in production
- Wrap expert review update and insert in database transaction for atomicity:
  * Ensures diagnosis status update and review insert succeed together
  * Rolls back both operations if either fails
  * Preserves behavior: only update if status is needs_review, return badRequest if no row updated

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 17:32:57 +00:00
Asep Haryana Saputra 4478d51aae feat: add production MVP database migration 2026-05-22 17:19:46 +00:00
Asep Haryana SaputraandClaude Opus 4.7 be569ff675 fix: improve expert review form accessibility
- Add proper id/htmlFor associations for verified/corrected radio inputs
- Clear correctedDiseaseSlug when switching verdict to verified to prevent stale state
- Add required={verdict === 'corrected'} to disease select
- Add loading state distinguishing between loading reviews/diseases and empty queue
- Add type="button" to diagnosis list selection buttons
- Improve selected diagnosis image alt text to include disease name

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 17:17:24 +00:00
Asep Haryana Saputra 1b24e6f6a0 feat: add expert review UI 2026-05-22 17:11:56 +00:00
Asep Haryana SaputraandClaude Opus 4.7 0027c0ed05 fix: revoke active upload preview on unmount
Track the active object URL in previewUrlRef to ensure the cleanup effect
revokes the correct URL on unmount, avoiding closure over stale state.
When replacing or clearing preview, revoke the ref's current URL and set
it to null. On unmount, revoke previewUrlRef.current if present.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 17:09:24 +00:00
Asep Haryana SaputraandClaude Opus 4.7 7fb8b075b8 fix: clean up dashboard upload state
- Prevent object URL leaks in image-classification-form by revoking previous preview URL before replacing it, revoking after successful submit, and revoking on component unmount
- Improve preview image alt text from generic "Preview" to descriptive Indonesian text "Pratinjau gambar daun jagung untuk diagnosis"
- Use auth store setter consistently in dashboard-page logout instead of direct setState call

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 17:07:18 +00:00
Asep Haryana Saputra 1b5c16b135 feat: migrate dashboard to diagnosis workflow 2026-05-22 17:03:26 +00:00
Asep Haryana Saputra cf44a58486 feat: add diagnosis detail UI 2026-05-22 16:58:23 +00:00
Asep Haryana SaputraandClaude Opus 4.7 fd6f60f4f4 fix: clear auth form errors
- Clear error state before submitting credentials in login page
- Clear error state before submitting registration in register page
- Add optional onFieldChange callback to AuthForm to clear parent errors when fields change
- Add role="alert" to error paragraph for accessibility

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 16:55:47 +00:00
Asep Haryana Saputra 84fb808b53 feat: add frontend authentication flow 2026-05-22 16:51:01 +00:00
Asep Haryana SaputraandClaude Opus 4.7 9250696f54 fix: simplify diagnosis API aliases
Extract toImageClassificationRecord helper function to eliminate duplicated
transformation code between getImageClassifications and createImageClassification.
Replace hardcoded fake disease object with explicit error when diagnosis.disease
is null, ensuring data integrity. Remove unnecessary type casts now that the
helper is properly typed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 16:46:43 +00:00
Asep Haryana Saputra 16a8935958 feat: add frontend production API client 2026-05-22 16:43:25 +00:00
Asep Haryana Saputra e9d6aabcdc fix: tighten dashboard summary types 2026-05-22 16:39:38 +00:00
Asep Haryana Saputra 02b002b021 feat: update dashboard for diagnosis workflow 2026-05-22 16:36:53 +00:00
Asep Haryana SaputraandClaude Opus 4.7 7712a5c6a1 fix: prevent duplicate expert reviews
In POST /reviews/:diagnosisId, perform the conditional diagnoses update
first with .returning() to determine whether a row was updated. The update
WHERE includes both id and status 'needs_review'. If no row is returned,
return badRequest and do not insert an expert review. Only after a
successful update insert expertReviews. This prevents concurrent reviewers
from both inserting review rows when only one update should win.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 16:34:02 +00:00
Asep Haryana SaputraandClaude Opus 4.7 d72eaffb6b fix: guard expert review state
- Reject diagnoses not in needs_review status with badRequest
- Make update conditional on both id and status needs_review using and()
- Simplify isDiagnosisRecordOrNull type guard with type alias

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 16:30:17 +00:00
Asep Haryana Saputra 59204b0fde feat: add expert diagnosis review workflow 2026-05-22 16:23:40 +00:00
Asep Haryana SaputraandClaude Opus 4.7 afa2e4999b fix: type diagnosis record mapping
- Replace `function toReview(row: any)` with typed ReviewRow interface
- Reconstruct DiseaseCatalogItem explicitly from selected fields instead of casting
- Replace `.filter(Boolean)` with typed isDiagnosisRecord predicate
- Add proper type narrowing for verdict and correctedDiseaseSlug in toReview

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 16:19:10 +00:00
Asep Haryana SaputraandClaude Opus 4.7 2e692a4b8c fix: tighten diagnosis route typing
Replace unsafe `as any` casts with proper type guards using `isDiseaseSlug()`
and explicit type casting to `DiagnosisStatus` and `DiseaseCatalogItem`.
Replace non-null assertions with explicit null checks that return
`serviceUnavailable()` errors when database operations fail.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 16:15:45 +00:00
Asep Haryana SaputraandClaude Opus 4.7 1a36ae5cbc feat: persist authenticated diagnoses
Implement diagnosis persistence routes with image upload, classification,
and prediction storage. Add missing HTTP error helpers (unauthorized,
forbidden) and update uploader client to use configurable base URL.

- Create POST /api/v1/diagnoses to upload images and store classifications
- Create GET /api/v1/diagnoses to list user's diagnoses (30 most recent)
- Create GET /api/v1/diagnoses/:id to retrieve diagnosis with predictions
- Add loadDiagnosisRecord helper for consistent diagnosis data loading
- Update uploader-client.ts to use env.uploaderBaseUrl
- Add unauthorized and forbidden error helpers to http-errors.ts
- Register diagnosisRoutes in main app

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 16:08:18 +00:00
Asep Haryana Saputra 5eb195cbeb feat: add session auth routes 2026-05-22 16:00:47 +00:00
Asep Haryana Saputra 794abfdb35 feat: add production auth and diagnosis schema 2026-05-22 15:53:48 +00:00
Asep Haryana Saputra b347ed4fd1 feat: define production diagnosis DTOs 2026-05-22 15:47:25 +00:00