Commit graph

23 commits

Author SHA1 Message Date
Vadym Samoilenko
1f83ed8c82 Add login page with Microsoft SSO button
Dark heatmap-inspired design with animated concentric rings,
OliVAS wordmark, and a clean Microsoft sign-in button.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 14:12:52 +00:00
Vadym Samoilenko
5e7b7a1fab Fix auth for all image loading paths
- Extract useAuthBlobUrl hook from AuthImage
- Fix /api/api double prefix bug
- Use AuthImage in GazeSequence
- Use useAuthBlobUrl in HeatmapOverlay (new Image() pattern)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 14:07:12 +00:00
Vadym Samoilenko
05b25e382c Fix type-only import for ImgHTMLAttributes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 14:03:07 +00:00
Vadym Samoilenko
e9e19fbd9f Load API images via authenticated fetch instead of bare img src
img tags don't send Authorization headers; AuthImage component fetches
via axios (with Bearer token) and renders a blob URL.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 14:01:33 +00:00
Vadym Samoilenko
b471c7c500 Set BrowserRouter basename to /olivas for subpath deploy
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 13:55:15 +00:00
Vadym Samoilenko
8484aab187 Fix Apache rewrite — match by extension instead of REQUEST_FILENAME
REQUEST_FILENAME doesn't resolve correctly with Alias; use extension check instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 13:54:19 +00:00
Vadym Samoilenko
a6e688d2b9 Remove SSL from Apache config — SSL terminates at load balancer
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 13:42:21 +00:00
Vadym Samoilenko
91a0104138 Fix frontend base path and Apache config for /olivas/ subpath
- Add base: '/olivas/' to Vite config so assets resolve correctly
- Switch Apache DocumentRoot to /var/www/html with Alias for /olivas/
- Fix RewriteBase to /olivas/ for SPA routing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 13:38:31 +00:00
Vadym Samoilenko
ce1d10d9b2 Fix matplotlib.colormaps import in processing service
colormaps is a module attribute, not a submodule — remove the explicit import.
Also relax matplotlib pin back to >=3.5 (minimum for colormaps attribute).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 13:34:00 +00:00
Vadym Samoilenko
0b7964b3dc Override alembic DB URL from DATABASE_URL env var
Fixes migrations inside Docker container where postgres is at postgres:5432,
not localhost:5453 as hardcoded in alembic.ini.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 13:32:20 +00:00
Vadym Samoilenko
8eac800442 Pin matplotlib==3.9.4 in processing Cloud Run service
matplotlib.colormaps requires >=3.5; pinning avoids stale cache resolving an older version.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 13:30:55 +00:00
Vadym Samoilenko
2c7b89670d Fix alembic PYTHONPATH in deploy script
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 13:29:11 +00:00
Vadym Samoilenko
c6cd329c2f Deploy to optical-dev.oliver.solutions
- Update Azure redirect URI and CORS origins to optical-dev
- Remove root requirement from deploy.sh, use chmod instead of chown
- Make CORS_ORIGINS configurable via env var in docker-compose
- Add Apache VirtualHost config for optical-dev.oliver.solutions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 13:02:04 +00:00
Vadym Samoilenko
f217a5aea6 Add Azure AD SSO authentication for backend and frontend
Replace X-User-Id header auth with Azure AD JWT token validation.
Backend validates tokens via JWKS, frontend uses MSAL for login/token
acquisition. Adds logout button, 401 handling, and configurable
AZURE_AUTH_ENABLED toggle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:41:06 +00:00
Vadym Samoilenko
7925264307 Add idempotent production deploy script and docker-compose override
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:40:32 +00:00
Vadym Samoilenko
2c5e17c7c4 Add Google Cloud Run offloading for ML inference and image processing
- Create cloud_run/saliency: FastAPI service running DeepGaze I/IIE/III
  on Cloud Run (4 vCPU, 16GB RAM); pre-downloads model weights in Docker
  build to eliminate cold-start delays; returns saliency map + gaze
  sequence + hotspots + design scores
- Create cloud_run/processing: lightweight FastAPI service for heatmap
  generation and gaze sequence visualization (2 vCPU, 4GB RAM)
- Add cloud_run/deploy.sh for gcloud deployment to project optical-414516
  in region europe-west2
- Refactor analysis pipeline to route via Cloud Run when
  CLOUD_RUN_SALIENCY_URL is set, with local fallback for dev mode
- Add cloud_run_client.py with sync httpx wrappers for background tasks
- Split pyproject.toml: base = API-only deps, [ml] = torch/deepgaze for
  local dev; production Dockerfile is now lightweight (~no PyTorch)
- Preserve Dockerfile.full + docker-compose.dev.yml for local ML dev
- Auth via X-Internal-Secret header (CLOUD_RUN_SECRET env var)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 19:39:52 +00:00
DJP
c1b80eb9a7 Replace entropy score with composite Design Effectiveness Score
The pure Shannon entropy score penalized well-designed ads with multiple
intentional visual elements (e.g. hero product + text + logo scored ~8/100).

New composite score (0-100) weights four components:
- Peak Dominance (30%): strength of #1 hotspot vs rest
- Hierarchy Clarity (25%): monotonic intensity ordering
- Gaze Coherence (25%): smooth spatial gaze path
- Entropy Concentration (20%): sqrt-softened entropy

The raw entropy score is preserved as entropy_score for users who want it,
visible in the ScoreCard hover tooltip and PDF report.

Also adds auto-create DB tables on startup for fresh Docker deploys.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 22:50:12 -05:00
DJP
8df679c9c8 Add psycopg2-binary to Docker build for sync DB access
Background tasks use synchronous psycopg2 for database writes after
analysis completion. Without this package, analyses stayed stuck on
"pending" status in Docker deployments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 22:30:24 -05:00
DJP
f95d5efbf7 Fix Docker build: add missing deps and .dockerignore
- Replace deprecated libgl1-mesa-glx with libgl1 (Debian Trixie)
- Add CLIP, einops, ftfy, regex dependencies for DeepGaze models
- Add backend .dockerignore to exclude .venv (128MB → 1.6MB context)
- Update Makefile with CLIP install step
- All 3 models load successfully in Docker

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 22:16:58 -05:00
DJP
2425cd2677 Fix Docker and install files for current codebase
- Fix backend Dockerfile: install deps before copying source for
  proper layer caching (non-editable install)
- Add ai_insights, ai_score, ai_score_reason, ai_cost_usd columns
  to initial Alembic migration so fresh Docker deploys have full schema
- Add ANTHROPIC_API_KEY to docker-compose.yml, docker-compose.dev.yml,
  and .env.example
- Remove accidental backend/=0.40 pip artifact file

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 21:54:41 -05:00
DJP
2ef458ec72 Add individual analysis deletion from AnalysisView and ProjectDetail
- Delete button on AnalysisView header (red, with confirmation dialog)
- Trash icon on each analysis card in ProjectDetail grid
- useDeleteAnalysis hook with query invalidation
- Navigates back after successful deletion

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 21:48:10 -05:00
DJP
92062b254d Add score clarity, AI design score, image format fix, cost tracking
- Replace bare score badge with rich ScoreCard component showing
  color-coded score (green/amber/red), label, and hover tooltip
  explaining what the 0-100 Attention Focus score means
- Add AI Design Effectiveness Score (1-10) from Claude alongside
  qualitative insights, with score_reason explanation
- Fix image/png media type error by converting all images to PNG
  before sending to Claude API
- Save ai_score and ai_score_reason to DB
- Display AI score badge in InsightsPanel with color coding

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 20:37:03 -05:00
DJP
3467dbcf03 Initial commit — OliVAS visual attention analysis platform
Full-stack application for predicting where humans look in images using
DeepGaze saliency models. Includes heatmap overlays, gaze sequence prediction,
hotspot detection, AOI analysis, rule-based insights, optional Claude AI
design analysis, and professional PDF report generation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 20:20:58 -05:00