Commit graph

76 commits

Author SHA1 Message Date
357483cfd2 fix: install zstd dependency before Ollama installer 2026-05-30 15:22:03 +00:00
57f501e0c8 docs: update one-liner install command in README 2026-05-30 15:21:25 +00:00
1aa5ec456e chore: install.sh asks for domain name instead of raw URL
- Prompts for domain and HTTPS preference
- Builds proper BASE_URL from domain + protocol
- Defaults to http://localhost:8080
2026-05-30 15:08:26 +00:00
c0d3002e22 fix: remove hardcoded credentials from .env.example and source
- .env.example: placeholder values only
- gemini.go: error on missing API key instead of fallback
- main.go: dynamic from address from SMTP_USER
- Security: old credentials removed from active codebase
2026-05-30 15:08:01 +00:00
7fdfba8095 chore: change install dir from /opt/rx to /opt/receiptnext 2026-05-30 15:06:20 +00:00
39fa7f6a12 chore: rewrite install.sh with AI provider choice + -update flag + pure Go
- install.sh now:
  • Clones repo to /opt/rx
  • Builds pure-Go binary (no CGO)
  • Prompts AI choice: Gemini / OpenAI / Ollama
  • If Ollama: auto-installs Ollama + pulls qwen3.5:2b
  • Creates .env interactively
  • Creates systemd service
  • Supports -update flag (pull, rebuild, restart)
- README.md fully rewritten for new install flow
- All binaries removed from git tracking (dist/ in .gitignore)
2026-05-30 15:03:39 +00:00
6de9c27f9c chore: switch from mattn/go-sqlite3 (CGO) to modernc.org/sqlite (pure Go)
- Zero CGO dependencies — builds with CGO_ENABLED=0
- Fully static binaries, no libc required
- Cross-compilation now works without any GCC cross-compilers
- ldd confirms: 'not a dynamic executable'
- Updates go.mod to Go 1.23 (required by modernc.org/sqlite)
2026-05-30 15:02:07 +00:00
b780ac1e1f chore: interactive install.sh — prompts user for credentials, installs to /opt/rx
- install.sh copies binary + assets to /opt/rx/
- Prompts for SMTP, Gemini, port, URL interactively
- Creates .env file with chmod 600
- Creates systemd service pointing to /opt/rx/
- Handles both pre-built and dist/ binaries
2026-05-30 14:23:42 +00:00
f50048e833 chore: rename to ReceiptNext + deployment scripts
- Full rename: module path, imports, directory structure
- install.sh: one-command bare-metal deployment
- contrib/receiptnext.service: systemd service file
- Makefile: build, install, manage service
- .gitenv updated to ReceiptNext
- New Releases page on git.lohmar.co.uk/cclohmar/ReceiptNext
2026-05-30 14:20:49 +00:00
5ca3ff7555 feat: configurable AI provider system (Gemini, OpenAI, Ollama)
- New provider architecture with common interface
- Provider selected via AI_PROVIDER env var (gemini/openai/ollama)
- Gemini (default): existing implementation, uses GEMINI_API_KEY
- OpenAI-compatible: uses OPENAI_API_KEY + AI_MODEL + AI_BASE_URL
  - Works with OpenAI, Perplexity, Together AI, Groq, etc.
- Ollama: local LLM, uses AI_BASE_URL + AI_MODEL
  - Supports llava, bakllava, and other vision models
- deepseek.go renamed to llm.go (cleanup)
- .env.example updated with all AI provider options
2026-05-30 14:05:19 +00:00
646378df64 feat: gallery upload + PDF receipt support
- Two upload buttons: Camera (capture) and Upload (gallery/PDF)
- PDF receipts from Uber/email now accepted and processed by Gemini Vision
- PDF detection via %PDF magic bytes in both handler and AI module
- Descriptions updated to reflect broader file support
2026-05-30 13:50:22 +00:00
dcb43b08a0 feat: send receipt images as ZIP attachment with report
- Email now includes both report (CSV/PDF) + ZIP of all receipt images
- ZIP images named {event-name}-{index}.{ext} matching list order
- Uses Go's archive/zip (stdlib, no external deps)
- Sender.SendReport now accepts []*Attachment for multiple files
- Gracefully skips missing image files with warnings
2026-05-30 13:38:23 +00:00
e22bd56169 fix: form fields too tight - increased spacing and padding
- Input padding increased from 12px to 16px
- Label-to-input gap increased from 4px to 8px
- Form group spacing increased from 16px to 20px
- Buttons padding increased from 8px/16px to 12px/20px
- Login card padding increased for more breathing room
- Added .form-row with responsive flex gap layout
- Added .main-content class with generous padding
2026-05-30 13:08:28 +00:00
67f5ed5624 feat: rebrand to ReceiptNext with 'The Terminal Mint' dark palette
- New favicon: Rx symbol in emerald green square (prescription/receipt)
- Dark theme: #0F172A base, #1E293B cards, #F8FAFC text
- Emerald #10B981 primary accent throughout
- Dashboard simplified to list view with event name + Open button
- Event page: receipt list with edit, Add Receipt button, Submit Event form
- Submit form shows total claim amount + email + format selection
- PWA manifest + service worker updated for ReceiptNext branding
- Variables-based theming for easy palette switching
2026-05-30 13:05:58 +00:00
ded4954c72 feat: add expense editing - view and edit all existing receipts
- Added ✏️ edit button on every expense in the list
- Clicking loads the receipt form pre-filled with the expense data
- Changes are saved via PUT /expenses/{id}
- Receipt form auto-switches between create (POST) and edit (PUT) mode
- Full HTMX multi-target response: form resets + list refreshes
2026-05-30 12:43:33 +00:00
e00c3373cb feat: replace abstract exchange rate with sample-based conversion
- Instead of entering a hard-to-calculate rate like 0.00773,
  users now enter a real sample (e.g. receipt=1000 KES, claimed=7.73 USD)
- The system computes the rate automatically: 7.73 / 1000 = 0.00773
- Users can get the sample values from their payment app notification
- Much more intuitive, especially for currencies with small exchange rates
2026-05-30 12:33:48 +00:00
4895b3d608 feat: add KES support + base currency + exchange rate for expense claims
- Added KES and 12+ additional currencies to receipt form
- Events now have base_currency (claim currency) and exchange_rate fields
- Receipts show original amount + auto-computed converted amount
- Converted amounts stored per expense in database
- CSV and PDF reports include both original and converted amounts
- Dashboard shows claim currency per event card
2026-05-30 12:23:31 +00:00
46c78ef507 chore: use gemini-2.0-flash-lite (most cost-effective model) 2026-05-30 12:14:46 +00:00
127046c9b7 feat: switch AI provider from DeepSeek to Google Gemini Vision API
- DeepSeek API does not support vision (only chat UI supports images)
- Google Gemini Vision supports native image analysis via inline_data
- Images are sent directly as base64 with proper MIME type detection
- No more OCR pipeline needed - Gemini sees the image directly
- Supports: JPEG, PNG, WebP, GIF, BMP, TIFF, HEIC, AVIF
- Updated .env.example to use GEMINI_API_KEY instead of DEEPSEEK_API_KEY
- Also: log OTP code in server log for easier debugging
2026-05-30 12:11:20 +00:00
fecf4af8a2 fix: AI receipt extraction now uses OCR (Tesseract) + LLM (DeepSeek) pipeline
- Problem: deepseek-v4-flash is text-only, cannot process base64 images - hallucinated fake data
- Solution: Two-step pipeline that actually extracts real data:
  1. Tesseract OCR extracts raw text from the receipt image
  2. DeepSeek v4 parses the OCR text into structured JSON
- Benefits: works with any image format, fast, accurate, no hallucinated data
- Properly handles HEIC/HEIF via heif-convert before OCR
2026-05-30 12:00:40 +00:00
ebe06082cf fix: support HEIC/HEIF photos from iPhone + broaden accepted image formats
- detectImageExtension now handles: JPEG, PNG, WebP, GIF, BMP, TIFF, HEIC, AVIF
- Added heif-convert + ImageMagick fallback for decoding unsupported formats
- AI extraction properly converts HEIC to JPEG before analysis
- Model: deepseek-v4-flash (confirmed working)
2026-05-30 11:54:31 +00:00
dc407fbf06 fix: DeepSeek Vision API changed - use text-embedded base64 + image compression instead of image_url content type
- DeepSeek no longer supports image_url in chat completions
- Images are now resized (max 300px) and JPEG-compressed (quality 50)
- Base64 data embedded directly in text prompt for processing
- Increased API timeout to 120s for larger prompts
- Also fixed mobile receipt capture (missing name attribute on file input)
- Also fixed OTP htmx:targetError (outerHTML → innerHTML swap)
2026-05-30 11:46:49 +00:00
64f5b9a65b fix: mobile receipt capture not working - missing name attribute on file input + htmx targetError on OTP verification 2026-05-30 11:34:36 +00:00
6b6196a59a fix: nil pointer panic when EmailSender is not configured 2026-05-29 20:05:01 +00:00
10c22bcaee chore: comprehensive README with binary distribution docs + build-all.sh 2026-05-29 19:54:20 +00:00
ca970104ee chore: initial commit — ExpenseFlow AI-Powered Expense Tracker
- Passwordless email OTP authentication
- Event-based expense tracking with HTMX UI
- AI receipt extraction via DeepSeek Vision API
- CSV/PDF report generation with email filing
- PWA with service worker and manifest
- Mobile-first responsive design
- SQLite database with auto-migration
2026-05-29 19:43:30 +00:00