Commit graph

188 commits

Author SHA1 Message Date
Pier-Jean Malandrino
aa73c209bc Update frontend test count in CLAUDE.md (129 tests) 2026-04-05 10:25:38 +02:00
Pier-Jean Malandrino
2ca0d0a984 Update test counts in README and CONTRIBUTING (199 backend, 129 frontend) 2026-04-05 10:25:26 +02:00
Pier-Jean Malandrino
ee57b04f84 Add disclaimer banner for shared deployments (HuggingFace)
Feature-flagged via DEPLOYMENT_MODE env var and /api/health endpoint.
Disabled by default (self-hosted), enabled when deploymentMode=huggingface.
2026-04-04 21:06:38 +02:00
Pier-Jean Malandrino
76e8c55b7c Fix BboxOverlay inline handler breaking production build
Vue template compiler in production mode rejects multi-statement
inline handlers without semicolons. Extract to a named function.
2026-04-03 16:17:23 +02:00
Pier-Jean Malandrino
226ae5994e Format all frontend files with Prettier
Batch reformat to eliminate 23 files with inconsistent formatting
that were accumulating across feature branches.
2026-04-03 15:50:32 +02:00
Pier-Jean Malandrino
1c82a80389 Guard all docling-dependent tests for lightweight CI
local_converter imports docling at module level, so any test that
touches it crashes when docling is not installed. Skip those tests
with importorskip / skipif so the CI (which only has docling-core)
passes cleanly.
2026-04-03 15:46:29 +02:00
Pier-Jean Malandrino
41863152cb
Merge pull request #42 from scub-france/feature/quality-improvements
Skip pipeline options tests when docling is not installed
2026-04-03 15:44:12 +02:00
Pier-Jean Malandrino
d8f87c34bc Skip pipeline options tests when docling is not installed
The docling library (torch, transformers) is too heavy for lightweight
CI environments that only install docling-core. Use importorskip so
these tests are cleanly skipped instead of crashing collection.
2026-04-03 15:42:14 +02:00
Pier-Jean Malandrino
4e6fa0908d
Merge pull request #41 from scub-france/feature/quality-improvements
Feature/quality improvements
2026-04-03 15:22:48 +02:00
Pier-Jean Malandrino
fefd406dc8 Align tests with schema refactoring (AliasChoices, status codes)
Adapt test expectations to external changes: upload returns 200,
ValueError yields 400, and schemas now accept both snake_case and
camelCase via AliasChoices.
2026-04-03 14:21:30 +02:00
Pier-Jean Malandrino
503b7e8a40 Fix import ordering violations (ruff I001)
Reorder first-party imports in local_converter and local_chunker to
satisfy isort rules: domain imports before infra imports.
2026-04-03 14:05:38 +02:00
Pier-Jean Malandrino
a9299e2735 Add document_service tests for upload, preview, and deletion
Cover PDF validation, file size limits, preview generation, page
counting, file deletion with path traversal protection, and the
not-found case — all previously untested code paths.
2026-04-03 13:57:05 +02:00
Pier-Jean Malandrino
d089bb8670 Add in-memory rate limiting middleware
Lightweight sliding-window per-IP rate limiter (100 req/min default)
with no external dependency. Health endpoint is excluded. Returns 429
with Retry-After header when exceeded. Sufficient for single-process
SQLite deployments; document the Redis upgrade path for scale.
2026-04-03 13:56:05 +02:00
Pier-Jean Malandrino
c82fd66ffc Add docstrings to all public methods
Domain model state transitions, repository CRUD operations, and service
methods now have descriptive docstrings to lower the contribution
barrier for an open-source project.
2026-04-03 13:54:52 +02:00
Pier-Jean Malandrino
8ee470f1aa Add database ping to health check endpoint
Health endpoint now verifies SQLite connectivity and reports a
"degraded" status when the database is unreachable, instead of
blindly returning "ok".
2026-04-03 13:53:01 +02:00
Pier-Jean Malandrino
360ea7ea8f Stream upload reads in 64 KB chunks
Read uploaded files in fixed-size chunks instead of a single file.read()
to reduce peak memory pressure. Also enforces the size limit during
streaming so oversized payloads are rejected before fully buffered.
2026-04-03 13:52:32 +02:00
Pier-Jean Malandrino
c2e91262c6 Limit concurrent analyses with asyncio.Semaphore
Unbounded asyncio.create_task calls could exhaust CPU and memory on
modest hardware. Add a configurable semaphore (MAX_CONCURRENT_ANALYSES,
default 3) so excess jobs queue instead of running all at once.
2026-04-03 13:51:53 +02:00
Pier-Jean Malandrino
7bd7d0f793 Validate page bounds on preview endpoint
Reject requests where page exceeds the document page count with a clear
400 error, instead of letting pdf2image fail with an opaque exception.
2026-04-03 13:50:32 +02:00
Pier-Jean Malandrino
661568f2cb Add return type annotations and use 201 for upload
All endpoint functions, lifespan context manager, and get_connection now
have explicit return types. Upload endpoint returns 201 Created instead
of 200 to follow REST conventions.
2026-04-03 13:50:07 +02:00
Pier-Jean Malandrino
69ce1df5a1 Narrow exception handlers for better diagnostics
Replace broad `except Exception` with specific types (FileNotFoundError,
PermissionError, OSError) so errors are properly categorized in logs.
Users reporting bugs will get actionable messages instead of generic ones.
2026-04-03 13:48:33 +02:00
Pier-Jean Malandrino
c50106c185 Centralize config through Settings singleton
UPLOAD_DIR and DB_PATH were read directly from os.environ, bypassing
the Settings dataclass. This caused an inconsistency where overriding
Settings had no effect on these values. Now all modules import from
infra.settings.settings.
2026-04-03 13:47:53 +02:00
Pier-Jean Malandrino
f4e11645c7
Merge pull request #40 from scub-france/fix/audit-release-0.3.0
Fix/audit release 0.3.0
2026-04-03 13:28:54 +02:00
Pier-Jean Malandrino
ab6d42aecd Move bbox.py from domain/ to infra/ and unify coordinate logic
domain/ must be pure with no external dependencies. bbox.py imports
docling_core and belongs in infra/. Also refactor ServeConverter to
use the canonical to_topleft_list via BoundingBox instead of
duplicated manual coordinate conversion. Move docling-core to base
requirements since it is now needed in both modes.
2026-04-03 13:17:26 +02:00
Pier-Jean Malandrino
6a791cec48 Fix i18n placeholder replacement to handle repeated occurrences
Use replaceAll instead of replace to substitute all instances of
a placeholder in translation strings, not just the first one.
2026-04-03 13:05:44 +02:00
Pier-Jean Malandrino
afc9b2e9f2 Document CONVERSION_MODE build variable in .env.example
Clarify the difference between CONVERSION_MODE (docker-compose
build target) and CONVERSION_ENGINE (runtime variable set
automatically by the Docker target).
2026-04-03 13:05:00 +02:00
Pier-Jean Malandrino
dbcd9dfa4c Fix naive datetime fallbacks in repository layer
Use UTC-aware datetimes consistently to prevent TypeError when
comparing aware and naive datetime objects.
2026-04-03 13:04:44 +02:00
Pier-Jean Malandrino
87269b9393 Add PDF type validation to file picker upload
The drop handler validated PDF type but the file picker did not,
allowing non-PDF files to bypass client-side validation.
2026-04-03 13:03:48 +02:00
Pier-Jean Malandrino
8856daf3c9 Force .pdf extension on uploaded files regardless of user input
The file content is already validated as PDF, so the user-supplied
extension should not be trusted or written to disk.
2026-04-03 13:03:21 +02:00
Pier-Jean Malandrino
c28f734e71 Add missing security headers to docker-compose nginx config
Align frontend/nginx.conf with the root nginx.conf by adding
X-Frame-Options, X-Content-Type-Options, X-XSS-Protection,
and Referrer-Policy headers.
2026-04-03 13:02:24 +02:00
Pier-Jean Malandrino
ac4a98e204 Fix GHA cache collision between remote and local release builds
Both matrix targets were sharing the same cache scope, causing
overwrites and cache misses. Scope caches per target.
2026-04-03 13:02:07 +02:00
Pier-Jean Malandrino
2cbef859e7 Fix generate_page_images option silently dropped in remote mode
The form data builder was not forwarding generate_page_images to
Docling Serve, so page image generation was silently ignored.
2026-04-03 13:01:50 +02:00
Pier-Jean Malandrino
e1636e710d Fix ServeConverter not returning document_json for chunking
The remote converter never set document_json in ConversionResult,
silently preventing chunking from working in remote mode.
2026-04-03 13:00:43 +02:00
Pier-Jean Malandrino
b34b56aba2
Merge pull request #39 from scub-france/feature/docker-split-local-remote
Feature/docker split local remote
2026-04-03 12:19:16 +02:00
Pier-Jean Malandrino
abe59c3cb7 Fix health endpoint not reachable through nginx proxy
Move /health to /api/health on backend and update the frontend
feature flag store to match. Without this, the combined Docker
image nginx proxy could not reach the endpoint and feature flags
(chunking/prepare mode) failed to load.
2026-04-03 12:14:15 +02:00
Pier-Jean Malandrino
48c5e4ea6b Fix RapidOCR model download permission in local image
Grant appuser write access to rapidocr/models directory so OCR
models can be downloaded at runtime.
2026-04-03 10:44:20 +02:00
Pier-Jean Malandrino
48b7d5d3e8 Use CPU-only torch in local image to reduce size from 5.8GB to 1.9GB
Install torch and torchvision from the CPU-only index before docling
to avoid pulling CUDA/nvidia/triton dependencies. Update documentation
with measured image sizes (270MB remote, 1.9GB local).
2026-04-03 09:52:22 +02:00
Pier-Jean Malandrino
aa7c539cc3 Update documentation for remote/local image variants
Reflect the two Docker targets across README, getting-started,
contributing guides, and .env.example with new configuration
variables (CONVERSION_ENGINE, DOCLING_SERVE_URL, DOCLING_SERVE_API_KEY).
2026-04-03 09:24:41 +02:00
Pier-Jean Malandrino
3dd7470562 Split release pipeline into remote and local image builds
Matrix strategy builds both targets in parallel. Tags follow the
pattern: v0.3.0-remote, v0.3.0-local, latest-remote, latest-local.
2026-04-03 09:24:41 +02:00
Pier-Jean Malandrino
9ac0840607 Add multi-target Dockerfiles for remote and local builds
Both root and backend Dockerfiles now use a shared base stage with
two targets: remote (lightweight, ~300MB) and local (full Docling,
~2-3GB). docker-compose uses CONVERSION_MODE to select the target.
2026-04-03 09:24:41 +02:00
Pier-Jean Malandrino
8dd917b6ed Split requirements into base and local variants
Remote mode only needs FastAPI, httpx and lightweight deps.
Local mode adds docling and docling-core for in-process conversion.
2026-04-03 09:24:41 +02:00
Pier-Jean Malandrino
b9c701b711
Merge pull request #38 from scub-france/feature/branding
Feature/branding
2026-04-02 17:32:43 +02:00
Pier-Jean Malandrino
1331582e22 Update logo with final version 2026-04-02 17:28:22 +02:00
Pier-Jean Malandrino
f6fa6907d7 Add logo across navbar, home hero, studio, and favicon
Replace generic orange "D" placeholders with the duck mascot logo
in all branding touchpoints: navbar header, home page hero, studio
import view, and browser favicon.
2026-04-02 17:11:31 +02:00
Pier-Jean Malandrino
199785aa29
Merge pull request #37 from scub-france/feature/ui-polish
Feature/UI polish
2026-04-02 17:02:53 +02:00
Pier-Jean Malandrino
598b370e1a Add icons to home stats cards with accent hover
Add document and clock icons above the stat numbers for better visual
context. Accent border and icon color on hover for consistent
interactive feedback across the app.
2026-04-02 16:42:04 +02:00
Pier-Jean Malandrino
8ed0e33313 Compact settings toggles as segmented controls
Reduce toggle width to fit-content with inner padding and individual
border-radius, matching the studio tabs design. Narrower max-width
for a tighter settings layout.
2026-04-02 16:41:34 +02:00
Pier-Jean Malandrino
e4bbffe258 Redesign history list as cards with subtle completed badges
Replace flat rows with rounded cards matching documents page style.
Reduce COMPLETED badge to a green dot so exceptions (FAILED, RUNNING)
stand out visually instead of blending into a wall of green badges.
2026-04-02 16:41:06 +02:00
Pier-Jean Malandrino
a78c9ec415 Redesign documents page rows as cards with accent hover
Replace flat border-bottom rows with rounded cards that have a subtle
border and accent-colored border on hover for better visual hierarchy.
2026-04-02 16:40:20 +02:00
Pier-Jean Malandrino
126c41a033 Fix studio topbar title wrapping when sidebar is open
Prevent multi-line title by adding ellipsis truncation and min-width
constraints on the topbar-left container.
2026-04-02 16:39:08 +02:00
Pier-Jean Malandrino
c60407f7a2
Merge pull request #35 from scub-france/feature/studio-tabs-redesign
Redesign studio mode tabs with icons and accent highlight
2026-04-02 16:28:19 +02:00