Commit graph

24 commits

Author SHA1 Message Date
3c669fb003 feat: AcroForm-Fill via Claude CLI, Multi-Source, Kanagawa, Docker-Deploy
Komplettes Rework der AI-Studio-Vorlage zu einem produktiven Werkzeug fuer
deutsche AcroForm-Formulare (Reha-Antraege, Arzt-Befundberichte):

- Backend: Express spawnt headless Claude CLI ('claude -p --output-format json'
  via stdin-Pipe). Prompt enthaelt die Feldnamen als Ziel-Schema plus die
  Arbeitsregeln (Stichwortstil, feste Zeichen-Kaestchen ohne Leerzeichen,
  Vordrucke respektieren, keine geratenen Werte, nur medizinisch).
- PDF-Handling: pdfjs-dist statt pdf-lib — pdf-lib scheitert an verschluesselten
  Object-Streams in DRV-Formularen. annotationStorage + saveDocument, kein
  Flatten. Worker-Patch zur Laufzeit forciert Auto-Size und schwarze Schrift.
- Multi-Source-Upload: beliebig viele PDFs/Bilder + optional Freitext.
- Design: Kanagawa Design System (Preset aus ../kanagawa-design-system),
  Tailwind lokal gebaut statt CDN, Dark/Light-Toggle, Progress-Indicator.
- Deployment: Multi-Stage-Dockerfile, docker-compose in matrix_default-Netz,
  Claude-Credentials vom Host per Volume. PLAN.md + AGENTS.md (Alex-Schema).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 22:48:32 +02:00
Kenearos
d6cab4aeb5 feat: Improve file preview with Blob URLs
Utilize `URL.createObjectURL` for richer file previews, especially for PDFs. This approach provides better compatibility and performance compared to Base64 previews.

Introduces memory leak prevention by revoking Blob URLs when the component unmounts or the app resets.
2026-02-06 14:29:07 +01:00
Kenearos
778caa8a45 refactor: Migrate to ESM and Vite for modern build
Updates package.json and index.html to use ES Modules and Vite for development and building. This includes migrating dependencies and removing old build scripts and testing configurations.

Also, simplifies the Gemini API key handling by directly using environment variables and refactors the Gemini response schema for clearer field definitions. Updates React component imports to use ESM paths for better maintainability.
2026-02-06 14:03:50 +01:00
Kenearos
2ed8e57267
Merge pull request #9 from Kenearos/claude/improve-test-coverage-KlDZh
Add comprehensive test suite for App, ApiKeyModal, and LaTeX service
2026-01-31 12:01:12 +01:00
Claude
04fe925891
test: Add comprehensive test coverage for untested modules
Add tests for previously untested components and services:
- apiKeyService.ts: localStorage operations (14 tests)
- ApiKeyModal.tsx: form validation, submission (22 tests)
- App.tsx: state transitions, error handling (23 tests)
- latexService.ts: API calls, template detection (35 tests)
- latex_service.py: LaTeX escaping, compilation (59 tests)
- server.py: Flask routes, field mapping (38 tests)

Also fix geminiService tests by adding proper apiKeyService mock.

Total new test coverage: 173 TypeScript tests, 97 Python tests

https://claude.ai/code/session_01D4k6b4nUjwfcHMvectsri2
2026-01-31 10:33:40 +00:00
Kenearos
1eb00f3d64
Merge pull request #8 from Kenearos/claude/fix-todo-comment-UwYHw
Implement PDF form field filling functionality
2026-01-31 11:15:19 +01:00
Claude
458d3f9b64
fix: Implement fillPdf function that was returning empty array
The fillPdf function was a stub that returned an empty Uint8Array.
Implemented proper PDF form filling using pdf-lib to handle both
text fields and checkboxes.

https://claude.ai/code/session_01SYhhaVHw6we1P6Y2kqLnDe
2026-01-31 10:09:29 +00:00
Kenearos
1eb0683684
Merge pull request #7 from Kenearos/claude/docker-region-config-katQl
Separate Flask and frontend ports to fix Railway deployment
2026-01-29 22:55:37 +01:00
Claude
bf9b4cd3c4
fix: Resolve port conflict causing Railway healthcheck failure
Flask API was using PORT env variable which Railway also assigns to
the frontend static server. Both services were competing for the same
port, causing the container to fail health checks.

Changed Flask to use FLASK_PORT (default 5000) so it runs independently
from the Railway-assigned PORT used by the serve command.

https://claude.ai/code/session_01YEMFAbGgf8K7as4Uqgjv3R
2026-01-29 21:52:27 +00:00
Kenearos
dac7677fcf
Merge pull request #6 from Kenearos/claude/fix-latex-form-filling-GbQtu
fix: Simplify PDF filling - use fillable fields directly
2026-01-29 20:31:17 +01:00
Claude
f7f899dce7
fix: Simplify PDF filling - use fillable fields directly
The previous approach was overcomplicated with LaTeX templates.
Now the system simply:

1. Detects PDF form fields (AcroForm)
2. Sends field names to Gemini for data extraction
3. Gemini returns 'key' matching exact PDF field names
4. Fields are filled directly in the original PDF

Removed:
- LaTeX template detection logic
- G2210-specific field definitions
- Complex mode switching

The fillable PDF approach is simpler and more reliable.

https://claude.ai/code/session_016pQhdznHZ74Fpkvwr3cLBq
2026-01-29 19:00:18 +00:00
Kenearos
e84752fff5
Merge pull request #5 from Kenearos/claude/fix-latex-form-filling-GbQtu
Add LaTeX template support for form generation
2026-01-29 19:47:11 +01:00
Claude
19e96ef59b
feat: Add LaTeX template-based form filling for G2210-11
Replace unreliable visual overlay mode with precise LaTeX templates:

- Add LaTeX template for G2210-11 (Ärztlicher Befundbericht der WAG)
- Create Python Flask backend for LaTeX compilation (latex_service.py, server.py)
- Add frontend latexService.ts for API communication
- Update ReviewPanel with LaTeX mode toggle and preview
- Enhance Gemini prompts with G2210-11 specific field extraction
- Add Dockerfile with TeX Live for Railway deployment
- Update railway.toml to use Docker builder

The LaTeX approach ensures accurate field placement and proper
formatting for German medical/insurance forms.

https://claude.ai/code/session_016pQhdznHZ74Fpkvwr3cLBq
2026-01-29 18:29:22 +00:00
Kenearos
adf8f0240e
Merge pull request #4 from Kenearos/claude/deploy-railway-6hRPP
feat: Store API key locally in browser instead of build-time
2026-01-28 20:08:45 +01:00
Claude
b23daec6e5
feat: Store API key locally in browser instead of build-time
- Add apiKeyService for localStorage-based API key management
- Add ApiKeyModal component for entering/updating API key
- Update geminiService to use dynamic API key
- Remove .env.example as API key is now user-provided
- Update to gemini-2.0-flash model

The API key is now stored only in the user's browser localStorage,
making the app more secure and easier to deploy.

https://claude.ai/code/session_01DBAyjuKW8Qtzixc64qn9KP
2026-01-28 19:07:38 +00:00
Kenearos
24a5c26d45
Merge pull request #3 from Kenearos/claude/deploy-railway-6hRPP
Add environment configuration and production deployment setup
2026-01-28 20:01:43 +01:00
Claude
1a758f9f8c
feat: Add Railway deployment configuration
- Add serve as production server for static files
- Add start script for production deployment
- Create railway.toml with deployment settings
- Create .env.example for required environment variables
- Fix index.html to use Vite bundling instead of ESM imports

https://claude.ai/code/session_01DBAyjuKW8Qtzixc64qn9KP
2026-01-28 18:59:50 +00:00
Kenearos
86bce39a2e
Merge pull request #2 from Kenearos/claude/improve-test-coverage-BRTDA
Add comprehensive test suite for React components and Python utilities
2026-01-28 19:55:08 +01:00
Claude
7b6c9a8630
chore: Add Python cache directories to .gitignore
https://claude.ai/code/session_01Wi3BtYKgQu6v4zbydtG6Sy
2026-01-28 18:53:25 +00:00
Claude
cbacd3430c
feat: Add comprehensive test suite for all services and components
- Set up Vitest with testing-library for React component tests
- Add 20 tests for pdfService (field extraction, PDF filling, visual overlay)
- Add 14 tests for geminiService with mocked API responses
- Add 17 tests for FileUpload component (drag-drop, file selection, preview)
- Add 28 tests for ReviewPanel component (rendering, editing, filtering)
- Add 21 Python tests for fill_pdf.py (extraction, filling, CLI)

Total: 100 tests covering critical functionality

https://claude.ai/code/session_01Wi3BtYKgQu6v4zbydtG6Sy
2026-01-28 18:52:43 +00:00
Kenearos
48306e882d
Merge pull request #1 from Kenearos/claude/pdf-form-filler-LiPT9
Add PDF form filler utility for automated AcroForm field population
2026-01-28 19:37:31 +01:00
Claude
dd590bd22c
feat: Add PDF form filler script for AcroForm fields
Add Python script to automatically fill PDF forms with AcroForm fields:
- extract_fields(): Extract all form field names and types from PDF
- fill_pdf(): Fill PDF with values from JSON input
- Support for both list and dict JSON formats
- Checkbox values support (/On, /Off, /Ja, /Nein)

https://claude.ai/code/session_01Dq1f9hjJFq859ShW2kZ26R
2026-01-28 18:36:54 +00:00
Kenearos
d2ea8a0cd4 feat: Initialize AutoForm AI project structure
Sets up the basic project structure for AutoForm AI, including:
- Vite for build tooling and development server.
- React and ReactDOM for the UI.
- TypeScript for static typing.
- Essential dependencies for PDF manipulation (jspdf, pdf-lib) and AI integration (@google/genai).
- Basic HTML structure and styling.
- Component definitions and service interfaces for future development.
- A README with local development instructions.
2026-01-28 19:23:47 +01:00
Kenearos
f1f796c9ca
Initial commit 2026-01-28 19:19:57 +01:00