SwipeLab is a gamified, human-in-the-loop image labeling platform. Stack: Java 21 Spring Boot (Backend) and React Native Expo (Frontend). Architecture: Modular Hexagonal/DDD.
- Architecture: Removed all unused Kafka configurations and dependencies; confirmed full decoupling via Spring ApplicationEventPublisher.
- Frontend: Fixed persistent mobile web layout and viewport scaling bugs (100dvh migration, locked root overflow, iOS input auto-zoom prevention via fontSize 16).
- CI/CD: Implemented and optimized backend GitHub Actions CI pipeline with Maven caching (
cache-dependency-path) and wrapper execution (Issue #196). - Frontend/Backend: Fixed gold images page rendering issue by adding imageUrl to DTO and updating frontend parsing logic (Issue #177).
- Frontend: Integrated pause and archive buttons with the backend task API (PR #207).
- Backend: Decoupled gold image logic by creating GoldImagePolicy and GoldImageEvaluatorService.
- Database: Schema migrations updated (V1-V8) including gamification and challenges.
- Frontend: Fixed frontend rendering for uploaded Gold Images by correcting the static path base parsing logic (Issue #216).
- Security/Validation: Implemented comprehensive input validation, stored XSS protection, and username normalization (Issue #227).
- Frontend/Auth: Fixed a persistent navigation bug where
isSuperAdminstate was lost on app refresh, causing the Users screen and toolbar option to disappear for Super Admins. - Frontend: Removed hardcoded mock task (id=1) from SwipeScreen; implemented 3-state Quick Start UI (active swipe / quick-start task picker / true empty state); aligned all task play entry points with swipeStore (Issue #204).
- Backend/Frontend: Fixed task duplication bug — added
findPublicTasksExcludingAssignedUserJPQL query,getExploreTasksForUserservice method,POST /tasks/{id}/assignendpoint with duplicate guard (DuplicateResourceException → HTTP 409), anduseAssignTaskmutation in the frontend (Issue #205). - Frontend: Added search bar + sort-by-credibility-score toggle to UsersManagementScreen; updated mock data (Issues #217, #218).
- Frontend: Added information sections to GoldImagesManagementScreen and AddGoldImageScreen to clarify their purpose for researchers (Issue #223).
- Backend: Implemented analytics overview endpoint + implemented placeholder endpoints — added
GET /api/v1/analytics/overview(platform-wide time-windowed stats: classifications/images/users/tasks/experiments for today/week/month, 30-day confidence trend, label distribution), addedGET /api/v1/analytics/global-stats, implementedgetUserPerformanceMetricsandgetTopPerformers, added V13 Flyway migration for analytics tables, fixed missing leading/on admin endpoints (Issue #220). - Frontend: Redesigned AnalyticsScreen with two-tab layout (Overview / Tasks). Overview tab consumes new
/api/v1/analytics/overviewendpoint and renders: TimeWindowCards (Today/Week/Month activity), platform totals, ConfidenceTrendChart (30-day credibility sparkline), LabelDistributionBar (YES/NO/DONT_KNOW/TRASH), and top performers. Tasks tab lists all researcher tasks with expandable per-task analytics panel. Added analyticsTypes.ts, 3 new components, 2 new query hooks, mock routes (Issue #221). - Backend: Implemented a two-layer caching strategy combining HTTP caching (
ShallowEtagHeaderFilter+CacheControlInterceptor) and application caching (Caffeine with@Cacheableand event-driven eviction viaCacheEvictionListener) (Issue #154). - Security/Auth: Optimized StarDBI Authentication by implementing a BFF pattern and eliminating
ExternalAuthFilter. StarDBI tokens are now securely cached backend-side via Caffeine (STARDBI_TOKENS_CACHE), completely hiding them from the frontend. ImplementedStardbiAuthService.executeWithStardbiTokenwrapper to seamlessly handle Stardbi 401s, token rotation, and graceful fallback to a service account for background synchronization. React Native frontend was updated to strip all explicit StarDBI token handling (X-Stardbiheaders) and relies purely on native SwipeLab JWTs. - Backend/Frontend: Completed integration of the Fraud Detection System banning flow (added global 403
ACCOUNT_BANNEDinterception in frontendapiFetch, implemented backendBannedUserFilterto secure API access, and updatedUserServicemanual bans to mirror the auto-ban state). - Backend: Resurrected and upgraded the credibility system —
CredibilityServicewas dead code (never called). Fixed 7 bugs: addedCredibilityEventListenerto wire intoClassificationSubmittedEvent, implemented composite 0-100 score (40% gold accuracy + 35% majority agreement + 25% expert kappa), fixed image-query granularity per(imageId, querySpecies), added malicious labeling detection, clamped score to [0,100], reset default to 50.0, added Flyway V14 migration, 36 new/updated tests all passing (PR #267). - Frontend/Backend: Aligned frontend with the live credibility system — added
credibilityScorefield toUserProfileResponseDTO andAuthMapper, fixedUsersManagementScreento readcredibilityScore(0–100) instead of gamificationscore, removed* 100scale errors inAnalyticsScreentop-performers and task quality displays, adaptedConfidenceTrendChartto handle 0–100 input scale, updated mock data andanalyticsTypes.tscomments. - Frontend/Backend: Fixed immediate logout bug for Researchers (Issue #225) by correcting the Stardbi token refresh flow. Updated
apiFetchto usebackendUrlfor the refresh request (fixing React Native relative URL crashes) and fixed backendStardbiAuthProviderto properly pad incoming Base64Url JWT payloads before decoding, allowing newly refreshed tokens to be cached and validated. - Backend/Testing: Configured E2E testing environment to use dynamic local test crops (
e2e-crops) inside MockStardbiClient by generating globally unique mockexternal_box_ids on the fly, preventing database constraint conflicts during manual UI task creation. - Backend: Fixed task image count display in
TasksManagementScreen(Issue #222). Replaced hardcoded zeros inTaskMapperby injectingImageRepositoryandClassificationRepositoryintoTaskServiceto query real task image totals and distinct classified image counts. - Testing: Created
tests/e2e/researcher/dashboard.spec.tsto verify the researcher View Dashboard flow, checking the task list, progress bars, and task details screen assertions. - Security: Remediated Medium severity security findings (secured Swagger UI in production, sanitized global exception handler, downgraded JWT logging, and unified login error messages).
- System: Configured Docker containers (backend, frontend, db) to automatically restart after server reboot using 'restart: unless-stopped' policy in docker-compose.yml.
- Backend: Implemented dynamic Image Consensus Threshold feature using an asynchronous
ThresholdEventListenerthat interceptsClassificationSubmittedEvent. It evaluates the weighted credibility of classifications and automatically excludes images from distribution (viaConsensusResulttracking) once the dynamic researcher-defined threshold is met. - Backend/Frontend: Optimized the CSV Export System (Issue #257). Implemented a non-blocking, background-execution export flow in the frontend using a global Zustand store and an animated
GlobalDownloadToast. Cleaned up the backend CSV generation (ExportService) to significantly reduce file size and improve traceability by removing the raw base64 image strings and replacing them with explicit local and external IDs (swipelab_image_id,stardbi_experiment_id,stardbi_image_id,stardbi_crop_id).
- Issue #201: Refactor Backend roles to include Researchers and Super Admin.
- Issue #226: [Frontend] fix recipients list not deleting users.
- Issue #225: [System] fix refresh token for Researcher.
- Issue #224: [Frontend] Mobile Vs. Web compatibility enhancement.
- Issue #219: [Frontend] Add to UsersScreen ONLY for Admin role control buttons.
- Backend: Strictly modular. No direct calls from API to Infrastructure. Use Application services.
- Frontend: Global state via Zustand, Server state via React Query.
- Navigation: Custom @react-navigation stack (No Expo Router).
- Database: All schema changes must use Flyway migrations.
- Update this file only upon task completion or major architectural changes.
- Use LOCAL_SCRATCHPAD.md for internal logs and step-by-step execution details.