Archiving my basement renovation: scraping Salesforce and captioning 400+ photos with Ollama + RTX 5090
Pulling 400+ progress photos and Chatter updates out of a locked-down Salesforce Experience Cloud contractor portal into a local React timeline, using Ollama on an RTX 5090 to caption the images.
During a basement renovation, the contractor's portal ends up holding everything: site visit notes, progress photos, payment schedules, and change orders. Mine ran on Salesforce Experience Cloud.
Customer portal accounts don't get Salesforce REST or Chatter API access (/services/data/ returns 401 INVALID_SESSION_ID / 403 API_DISABLED_FOR_ORG). Once the project wraps up—or if you just want to search months of updates, keep full-resolution copies of the photos (400+ images, ~670 MB), or export a PDF—you're stuck clicking through a slow web feed. And since raw contractor photos are named things like IMG_8598.jpeg, finding a specific photo (like the bathroom rough-in before drywall) means scrolling through hundreds of thumbnails.
So I put together basement-reno-salesforce (Live Static Demo) to scrape the portal into a local React timeline and caption every photo locally with Ollama instead of sending home photos to a paid cloud API.

How the pipeline works
- Scraping (
sync_portal.py): Headless Chromium via Playwright handles the Salesforce Experience Cloud login, walks the My Group feed, and extracts Account Summary, Payments, and Change Orders from the DOM. Rather than downloading 400+ images one by one through Playwright, it copies Chromium's authenticated cookies into a requests.Session and batch-downloads full-resolution photos across an 8-worker ThreadPoolExecutor, deduplicating by Salesforce post ID (seen_posts.json) and writing live Mbps/Kbps throughput to dist/progress.json.
- Timeline UI (
frontend/): A Vite + React + Tailwind CSS v4 dark-mode timeline with search, author/date/type filters, a Before/After comparison slider, Time-Lapse playback, client-side Export PDF (jspdf with aspect-ratio-preserving 220px canvas thumbnails), and Add Post (dist/user_data/ with user_-prefixed IDs).
- Server + offline
file:// output: build_timeline.py writes dist/timeline/data.js (window.TIMELINE_DATA = ...) instead of relying on fetch('/data.json'), so dist/timeline/index.html works both through src/server.py (ThreadingHTTPServer on port 8090 with /api/* endpoints) and directly over file:// without CORS issues.
- Docker / Unraid & tests: Multi-stage
Dockerfile (node:22-slim builds frontend/, mcr.microsoft.com/playwright/python:v1.50.0-noble runs the backend) plus docker-compose.yml bundling Ollama. Unit tests (tests/test_unit.py) and end-to-end ThreadingHTTPServer tests (tests/test_e2e.py) run against a local sanitized Salesforce HTML fixture server so sync_portal.py can be exercised with headless Playwright.
System architecture
Sync and analysis sequence
Local vision with Ollama + RTX 5090
For each new photo, analyze_photos.py resizes an in-memory copy with Pillow (default MAX_IMAGE_DIM=1024), base64-encodes it, and sends it along with that day's Chatter text to Ollama's /api/generate endpoint ("format": "json", "num_ctx": 4096, "temperature": 0.1, "keep_alive": "10m" so the model stays loaded in VRAM across the batch). It asks for three fields:
- Construction phase (e.g., Framing, Electrical, Drywall, Paint, Tiling)
- Room / area
- Descriptive caption
Before starting, it checks GET /api/tags—if Ollama is offline it skips gracefully, and if the selected model isn't pulled yet it calls POST /api/pull. It also records prompt_eval_count + eval_count from every response to log total tokens and live tok/s.
On an RTX 5090, gemma3:27b (~17 GB) fits comfortably in 32 GB of GDDR7 VRAM with room for ANALYZE_WORKERS=2, so chewing through hundreds of photos takes minutes with no API rate limits. On lighter hardware (or CPU/iGPU), the Settings dialog lets you switch to qwen3-vl:2b, qwen3-vl:8b, minicpm-v, llama3.2-vision:11b, gemma3:12b, or any model installed on your Ollama server.

Adding my own updates
Homeowners take plenty of photos the contractor doesn't upload, so I added an Add Post modal for my own notes and photo batches (dist/user_data/). Leaving a photo's description blank lets Ollama caption it on the next analysis run.

Frontend and browser state
The UI started as an inline Babel script inside Python before I moved it into frontend/:
- Vite 6 + React 18 + Tailwind CSS v4 (
@tailwindcss/vite): Builds in ~1.1s into dist/timeline/ with base: './' so relative paths work on both localhost:8090 and file://.
jspdf: Generates basement-renovation-timeline.pdf client-side by downscaling each photo on an offscreen <canvas> to a 220px JPEG thumbnail while keeping portrait/landscape aspect ratios intact.
marked: Renders README.md inside the in-app Help modal (fetching /api/readme locally or ./README.md on GitHub Pages).
localStorage and sessionStorage: Keeps the last 20 sync/analysis runs with expandable step logs in localStorage, and uses sessionStorage to reopen the Settings modal after Reset Data reloads.
GitHub Actions, GHCR, and Wiki
- GitHub Pages (
.github/workflows/pages.yml): Builds frontend/ on every push to main and publishes a sanitized static demo (demo/data.js + anonymized photos).
- Container releases (
.github/workflows/release.yml): Triggers on v* tags, builds the multi-stage Docker image, pushes :latest and :<version> to ghcr.io with GITHUB_TOKEN, and creates a GitHub Release.
- GitHub Wiki: Holds the longer API, Docker/Unraid, Ollama tuning, and testing notes so
README.md stays short.
Repo: fahim-a/basement-reno-salesforce