Commit graph

72 commits

Author SHA1 Message Date
Randall Stillwell
a6270a605a Add reprocess action to data table row dropdown
Cards with OCR error status now show a "Reprocess" option in the
row actions dropdown menu on the dashboard, triggering the existing
reprocess API endpoint.

Made-with: Cursor
2026-03-12 10:46:15 -05:00
Randall Stillwell
38f4229d3b Add profile page, user dropdown, and Authentik SSO integration
- Profile dropdown in header shows user name/email/avatar with links
  to profile, settings, support, theme submenu, and sign out
- New /profile page with editable user info (job title, company, bio)
  and read-only SSO fields when behind Authentik forward-auth
- /api/auth/me endpoint reads X-authentik-* headers and enriches
  with avatar from Authentik API
- Settings page gains Preferences tab with appearance theme picker
  and notification toggle switches
- User profile context backed by localStorage, merges with Authentik
  data when available

Made-with: Cursor
2026-03-12 10:42:39 -05:00
Randall Stillwell
59c4af5db6 Show placeholder text in filter dropdowns instead of __all__
Pass null instead of "__all__" as the Select value when no filter is
active, so the placeholder text (Visit Type, Attendance, Service) is
displayed by the base-ui SelectValue component.

Made-with: Cursor
2026-03-11 18:40:29 -05:00
Randall Stillwell
1168c96ae2 Fix right-click column visibility context menu crash
Replace base-ui DropdownMenu (requires anchor trigger) with a custom
positioned panel for the header right-click context menu. The base-ui
Menu primitive cannot be rendered free-floating without a trigger element.

Made-with: Cursor
2026-03-11 16:16:00 -05:00
Randall Stillwell
7ff9724a63 Unified dashboard redesign: Quicksand font, charcoal theme, merged upload
- Switch font from Geist to Google Quicksand
- Replace indigo/violet primary with charcoal gray (rgb 31,32,29)
- Update gradient-mesh to warm neutral tones (amber/sage)
- Remove sidebar, add fixed top header bar with profile dropdown
- Merge dashboard and upload pages into single table-centric view
- Stat cards now act as clickable table filters with active highlight
- Simplified filter toolbar: search + dropdowns left, export + upload right
- Upload modal with drag-drop, per-file XHR progress, background uploads
- Global drag-and-drop listener opens upload modal from anywhere
- Table rows are clickable (navigate to detail page)
- Right-click column headers for visibility context menu
- Mobile-responsive card layout below md breakpoint
- Uploading row placeholders with animated progress bars
- Floating selection toolbar slides in at bottom on multi-select
- Delete sidebar, dashboard-hero, quick-actions, upload page

Made-with: Cursor
2026-03-11 15:26:56 -05:00
Randall Stillwell
eabfb4935d Fix nullable Json field in reprocess and Prisma import path
Use Prisma.DbNull instead of null for the cardIds Json? field,
and correct the generated client import path.

Made-with: Cursor
2026-03-11 11:49:33 -05:00
Randall Stillwell
77b9fbea4c Fix AI test endpoint min token requirement
OpenAI requires maxOutputTokens >= 16; bump from 10 to 20.

Made-with: Cursor
2026-03-11 11:46:25 -05:00
Randall Stillwell
2db14b7336 Switch to Vercel AI Gateway for multi-provider OCR
Replace individual provider SDKs (@ai-sdk/openai, @ai-sdk/google,
@ai-sdk/anthropic) with the Vercel AI Gateway. Cloud models are now
accessed via a single AI_GATEWAY_API_KEY with provider/model strings
(e.g. openai/gpt-4o-mini, google/gemini-2.5-flash). Ollama remains
available as a local fallback via @ai-sdk/openai-compatible.

Made-with: Cursor
2026-03-11 11:05:38 -05:00
Randall Stillwell
1ec50d9033 Integrate Vercel AI SDK for multi-provider OCR
Replace the raw Ollama fetch-based OCR with the Vercel AI SDK,
adding support for OpenAI, Google Gemini, Anthropic, and Ollama
as selectable providers from the Settings page. Uses generateText
with Output.object() and Zod schemas for type-safe structured
data extraction.

Made-with: Cursor
2026-03-11 09:24:15 -05:00
Randall Stillwell
c879328775 Update npm packages and remove unused minio dependency
- Remove unused minio package (using @aws-sdk/client-s3 instead)
- Update @aws-sdk/client-s3, s3-request-presigner to latest
- Update react, react-dom to 19.2.4
- Update @types/node to v25
- Update shadcn to 4.0.5
- Run npm audit fix for non-breaking fixes
- Remaining 9 vulns are in Prisma's transitive deps (hono, lodash)
  and cannot be fixed without downgrading Prisma

Tested: local Docker build passes
Made-with: Cursor
2026-03-11 07:55:34 -05:00
Randall Stillwell
3018198196 Add /api/health endpoint to diagnose MinIO connectivity
Tests S3 bucket access and falls back to a raw HTTP fetch to show
what the endpoint actually returns (helps identify port misconfiguration).

Made-with: Cursor
2026-03-10 14:11:16 -05:00
Randall Stillwell
414e10ad13 Remove --skip-generate flag from prisma db push
Prisma v7 no longer supports this option.

Made-with: Cursor
2026-03-10 14:03:20 -05:00
Randall Stillwell
f174bd9977 Fix prisma CLI in production container for db push
Use a separate Docker stage to install prisma CLI + all transitive
deps, then merge into the runner's node_modules with correct ownership.
Verified: prisma --version works inside the container.

Made-with: Cursor
2026-03-10 13:45:04 -05:00
Randall Stillwell
3b8d580ded Add database auto-migration, storage cleanup, and startup fixes
- Add start.sh that runs prisma db push before starting the server,
  creating tables automatically on first deploy
- Copy prisma CLI + engines into production image for runtime migrations
- Add configurable storage cleanup: source PDF retention (default 30d)
  and image retention (default 180d) with manual trigger in Settings
- Add /api/cleanup endpoint (GET for status, POST to run)
- Add retention settings to AppSettings schema
- Add ListObjectsV2 helper to minio.ts for bulk cleanup

Tested: local Docker build passes
Made-with: Cursor
2026-03-10 13:21:05 -05:00
Randall Stillwell
1c4a474ad7 Add public directory required by Next.js standalone output
The Dockerfile COPY step for /app/public fails when the directory
doesn't exist. Verified with local Docker build.

Made-with: Cursor
2026-03-10 08:28:43 -05:00
Randall Stillwell
0e6e2b72d1 Skip postinstall during npm ci in deps stage
The postinstall script runs prisma generate, but the prisma schema
files aren't available in the deps stage (only package.json is copied).
The builder stage already runs prisma generate after copying all files.

Made-with: Cursor
2026-03-10 08:00:55 -05:00
Randall Stillwell
a8799100e5 Bump Docker base image to Node 24 LTS (v24.14.0)
Made-with: Cursor
2026-03-10 07:52:28 -05:00
Randall Stillwell
b597bb898a Bump Docker base image from Node 18 to Node 22 LTS
Prisma v7, AWS SDK v3, Tailwind v4, Next.js 16, and chokidar 5 all
require Node >= 20. Node 22 is the current LTS release.

Made-with: Cursor
2026-03-10 07:51:39 -05:00
Randall Stillwell
53d8e021ae Fix Docker build: switch from Alpine to Debian slim
Alpine's apk package manager fails in Coolify's build environment due to
network permission issues. Debian slim's apt-get is more reliable in
containerized CI/CD pipelines.

Made-with: Cursor
2026-03-10 07:40:35 -05:00
Randall Stillwell
7e423a3e50 Build Echo OCR app: full-stack response card scanner
- Next.js 15 + Tailwind v4 + shadcn/ui + TanStack Table
- Prisma + PostgreSQL schema for ResponseCard, ProcessingJob, AppSettings
- Ollama vision integration with structured extraction prompts
- PDF-to-image pipeline with pdf2pic + sharp
- MinIO S3 storage for uploaded files and extracted images
- Chokidar-based folder monitoring for automatic processing
- REST API (9 endpoints) ready for Monday.com integration
- Dashboard with filterable data table, chip filters, bulk actions, CSV export
- Card detail page with editable fields and side-by-side scanned images
- Upload page with drag-and-drop and real-time processing queue
- Settings page for Ollama, folder watch, and Monday.com config
- Dockerfile (multi-stage) + docker-compose for local dev
- Configured for Coolify deployment at echo.stillwell.cloud

Made-with: Cursor
2026-03-10 07:17:45 -05:00
Randall Stillwell
6a6a140139 feat: initial commit 2026-03-09 15:31:45 -05:00
Randall Stillwell
95d05ac92e Initial commit from Create Next App 2026-03-09 15:31:21 -05:00