Commit graph

15 commits

Author SHA1 Message Date
Marko Djordjevic
3e242c3359 Migrate middleware.ts to proxy.ts for Next.js 16 and fix build errors
Next.js 16 renamed middleware to proxy. Merged session-based auth and
API key auth into a single proxy.ts. Also fixed: auth route handler
exports, missing card component, Button asChild type errors, signIn
return type, Drizzle eq() type narrowing, and useSearchParams suspense
boundary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 21:52:38 +01:00
Marko Djordjevic
522c2f269d fix: rename middleware.ts to proxy.ts (deprecated convention) 2026-02-18 21:14:42 +01:00
Marko Djordjevic
69634909d1 fix: correct timestamp/boolean types for PostgreSQL schema (Date not int, bool not 0/1) 2026-02-17 22:50:31 +01:00
Marko Djordjevic
5377431c9d test: verify Next.js application works with PostgreSQL
- Updated .env to use DATABASE_URL instead of DATABASE_PATH
- Tested all API endpoints: health, charts, candles, span annotations
- Confirmed JSONB fields work correctly (geometry, sub_spans, model_prediction)
- All 2,836 rows accessible via API
- Database connection pooling working correctly
2026-02-17 14:02:22 +01:00
Marko Djordjevic
bbaf330020 fix: skip migrations during build phase to prevent 'table already exists' errors 2026-02-16 19:41:22 +01:00
Marko Djordjevic
65f00e6ce7 feat: complete prediction UI feedback tasks (11.2, 11.4, 11.5)
- Implement disagreement visual highlighting with distinct colors
  - Yellow highlight for 'missed_by_human' predictions
  - Orange for 'label_mismatch' disagreements
  - Warning icon on disagreement markers
- Add click-to-convert prediction feedback
  - Click disagreement predictions to create span annotations
  - Auto-fill with predicted label and times
  - Set source as 'model_confirmed' or 'model_corrected'
- Add dismiss action for false positive predictions
  - Alt+Click or Ctrl+Click to dismiss predictions
  - Saves negative annotation with label 'O'
  - Records original prediction in model_prediction field
- Filter predictions when 'Show only disagreements' is enabled
2026-02-16 11:40:55 +01:00
Marko Djordjevic
5a7c901980 fix(frontend): update ModelInfoResponse types to match backend structure
- Update TypeScript types to match flat backend response structure
- Remove nested model_info and metrics objects
- Remove label_config, use labels array and per_class_metrics array
- Update all component references to use new structure
- Generate default colors for prediction labels in CandleChart
- Fix TypeScript type errors for nullable model_version
- Remove accuracy/F1 metrics display (not in new response)
2026-02-15 21:39:38 +01:00
Marko Djordjevic
847ff67986 feat(ml): add TA-Lib annotation generation and import workflow
Add complete workflow for using TA-Lib to bootstrap training data:

- generate_talib_annotations.py: Python script to run TA-Lib CDL* functions
  and output span annotations in UI-compatible format
- import_talib_annotations.ts: TypeScript script to import generated
  annotations into the UI database with auto-label-type creation
- npm script 'import-annotations' for easy execution
- TALIB_WORKFLOW.md: Comprehensive guide covering the full cycle:
  * Generate patterns with TA-Lib
  * Import into UI
  * Review and edit in browser
  * Export and train model
  * Compare predictions with TA-Lib detections
  * Iterate for improvement

This enables the intended workflow: use TA-Lib for initial annotations,
manually refine them, then train a model that learns from corrections.
2026-02-15 19:18:28 +01:00
Marko Djordjevic
178834f3b2 fix: resolve type errors in ThemeProvider and ThemeToggle
- Remove import from 'next-themes/dist/types' (no longer exported)
- Use React.ComponentProps<typeof NextThemesProvider> instead
- Remove unsupported 'asChild' prop from TooltipTrigger
- Remove unsupported 'side' prop from TooltipContent
2026-02-12 23:48:58 +01:00
Marko Djordjevic
50229e2ccf chore: archive both OpenSpec changes and sync specs to main 2026-02-12 18:17:44 +01:00
Marko Djordjevic
4e13648ebf fix: copy node_modules to Docker container for better-sqlite3 native dependencies 2026-02-12 15:32:19 +01:00
Marko Djordjevic
83be6bbdfb docs: comprehensive documentation updates for v2.0.0
- Update README.md with Docker quickstart and new features (label management, hacker theme)
- Add detailed Docker deployment section to DEPLOYMENT.md:
  - docker-compose usage
  - Environment configuration
  - Data persistence and backup
  - Container health checks
  - Troubleshooting steps
  - Production deployment guidance
- Create comprehensive CLAUDE_DESCRIPTION.md:
  - Project overview and version info
  - Recent changes in v2.0.0
  - Technical stack details
  - Core features and file structure
  - State management explanation
  - Data flow diagrams
  - API endpoints reference
  - Development workflow
  - Customization points
  - Performance and security notes
2026-02-12 15:13:59 +01:00
Marko Djordjevic
a1fa86fe55 feat: implement label management with sidebar, hacker theme, and Docker support
- Add label selection on chart with visual highlight (size 2x, color change)
- Implement keyboard delete handler (Delete/Backspace keys)
- Add comprehensive label management sidebar with:
  - Collapsible label annotations section
  - Search by timestamp
  - Filter by type (Break Up, Break Down, All)
  - Individual delete buttons
  - Count display
  - Click to select/highlight on chart
- Transform UI with hacker theme:
  - Matrix green (#00ff41) on dark background (#0a0e0a)
  - Monospace font (JetBrains Mono)
  - Glow effects on button hover and active states
  - Custom scrollbar styling
  - Terminal-inspired aesthetic
- Add Docker deployment:
  - Multi-stage Dockerfile with standalone output
  - docker-compose.yml with volume persistence
  - Non-root user (nextjs) for security
  - Health check endpoint integration
- Tailwind and CSS enhancements:
  - Custom colors (matrix, matrixDim, neonRed, etc.)
  - Glow box shadows and animations
  - Selection and scrollbar styling
2026-02-12 15:12:59 +01:00
Marko Djordjevic
11f0759b0e fix: resolve chart visibility issues after CSV upload
- Add fixed width to sidebar (w-64) to prevent layout collapse
- Change chart container from flex-1 to w-full h-full for proper sizing
- Chart now properly displays after CSV upload
2026-02-12 11:50:48 +01:00
Marko Djordjevic
23f18f405a feat: complete candle annotator implementation
- Created CandleChart component with lightweight-charts integration
- Implemented SvgOverlay component for line drawing
- Integrated all components in main page
- Fixed TypeScript and Tailwind CSS compatibility issues
- Added comprehensive README.md with project documentation
- Created DEPLOYMENT.md with setup and troubleshooting guide
- Downgraded to stable versions (Tailwind v3, lightweight-charts v4)
- All 59 tasks from OpenSpec completed
2026-02-12 11:20:29 +01:00