Picfix
59-page image & PDF processing suite — exam photo resizing, PDF engine, and local open-source AI microservices with queued workers.
Counted 2026-09-13: 59 directories under frontend/app with a page.tsx (system routes excluded); 12 route files + 11 controllers under backend/src. Older README copy says 67+; the filesystem count (59) is authoritative. No live public demo link is claimed — the repo documents Hugging Face / Vercel deployment paths.
01 — Problem
Exam portals (SSC, UPSC, Passport, PAN) reject photos on dimension or file-size grounds; PDF/image tools either charge money or upload your documents to someone else's cloud. Users need calibrated, private, free tooling.
02 — Solution & Architecture
Next.js 14 frontend (59 tool pages) → Express API gateway (12 route groups, 11 controllers) → two execution paths: Sharp pipeline for transforms, BullMQ + Redis workers + FastAPI AI microservice (rembg/U2Net, EasyOCR, MediaPipe, OpenCV — models held in memory) for heavy AI jobs.
frontend/app/ — 59 tool pages (passport, ssc, pan, compress-*KB, pdf-*)
backend/src/ — routes(12) · controllers(11) · services(10) · worker.js (BullMQ)
ai-service/main.py — FastAPI: rembg/new_session, easyocr, mediapipe, cv2
supabase/ · render.yaml · docker-compose — deployable, not just runnable03 — Engineering challenges
How do heavy AI jobs avoid blocking the API?
BullMQ queue + shared Redis connections absorb image jobs asynchronously; retries are handled inline with AI_TIMEOUT semantics instead of blind queue retries.
How do exam specs stop being guesswork?
Algorithmic dimension, aspect-ratio and strict KB compressors (20KB–500KB images; 100KB–1MB PDFs) built from actual portal rejection rules.
What about billing and credits?
Dedicated API groups (/api/billing/*, /api/credits/*, /api/user/*) with webhook verification — monetization plumbed without touching tool code.
04 — Security
- Redis-backed rate limiting (rate-limit-redis) with trust-proxy hardening — covered by unit test
- Multer binary-stream handling; node-cron temp-file hygiene so uploads never accumulate
- Supabase auth routes for gated tools
05 — Testing
- Backend vitest suite (trust-proxy + syntax-check gate via
npm run check) - Load-test harness under
backend/test/load/for worker throughput
06 — Result
A privacy-first suite where every tool page maps to a real backend route, heavy AI runs in queued workers, and exam specs are algorithms rather than sliders. The architecture diagram in the repo README matches the code — verify route by route.