Commit graph

9 commits

Author SHA1 Message Date
Vadym Samoilenko
8da149b84e Migrate storage from JSON files to PostgreSQL (asyncpg)
- Add asyncpg connection pool (db/pool.py) with JSONB codec registration
- Add schema.sql with users, clients, dropdown_categories, export_templates, sheets tables
- Add migrate_json.py one-time migration script for existing JSON data
- Rewrite user_store, sheets/manager, api/clients, api/dropdowns, api/export as async DB-backed
- Update all callers (auth, sheets, admin, ai_command, export) to await async functions
- Add postgres:16-alpine service to docker-compose with named volume and health check
- App container depends_on postgres; DATABASE_URL injected via env
- Schema applied automatically on startup; global categories seeded if DB is empty

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 19:51:37 +00:00
Vadym Samoilenko
fe8ee116ca Pass EMERGENCY_TOKEN and ADMIN_EMAILS through docker-compose env
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 19:16:40 +00:00
Vadym Samoilenko
5231c8bd37 Fix AI model, Language/Country mapping, and Handsontable rendering
- GEMINI_MODEL for AI commands: gemini-2.0-flash-exp → gemini-3-flash-preview
- Language/Country: handle plain 2-letter codes (EN→Language, UK→Country)
  and "EN-UK" split format; previously only split format worked
- Handsontable black screen: add min-h-0 on flex-1 container so height:100%
  resolves correctly inside the flexbox chain

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 16:38:38 +00:00
Vadym Samoilenko
44a4fb7e06 Revert Google model to gemini-3.1-pro-preview
The error was from gemini-2.0-flash-exp (old docker-compose default),
not from gemini-3.1-pro-preview which is valid and working.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 15:53:12 +00:00
Vadym Samoilenko
3d6adb2dcc Fix import empty sheet bug, update Google model, improve error messages
- BriefReviewPage: call loadSheet() after importDeliverables so store
  is refreshed before navigation — fixes 0 items on Sheet page
- Google model: gemini-3.1-pro-preview → gemini-2.5-pro-preview-03-25
  (old model name was invalid, caused API errors)
- docker-compose default: gemini-2.0-flash-exp → gemini-2.5-pro-preview-03-25

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 15:52:22 +00:00
Vadym Samoilenko
ba9af5f93c fix: align env var names between docker-compose and Python config
Two key mismatches caused silent failures in production:

1. core/config.py LLAMACLOUD_API_KEY: was reading LLAMACLOUD_API_KEY but
   docker-compose passes LLAMA_CLOUD_API_KEY (official SDK name).
   Now reads LLAMA_CLOUD_API_KEY with LLAMACLOUD_API_KEY as fallback.

2. core/config.py GOOGLE_API_KEY: was reading GOOGLE_API_KEY but .env /
   docker-compose use GEMINI_API_KEY. Now reads GEMINI_API_KEY first.

3. docker-compose.yml: add MSAL_* aliases for AZURE_* vars so
   server/config_runtime.py picks them up explicitly (not just via defaults).

4. docker-compose.yml: pass SESSION_SECRET from .env to container.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 15:09:45 +00:00
Vadym Samoilenko
15bf9d3935 feat: add full AI provider config to .env.example and docker-compose
- All OpenAI, Gemini, Anthropic model/timeout/temperature settings
- Brief extraction processing config (models, cost limits, concurrency)
- File upload and WebSocket settings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 14:30:16 +00:00
Vadym Samoilenko
dad8f7573a Add deploy script, .env.example, and Apache reverse proxy config
- deploy.sh: idempotent Ubuntu deployment (git pull → docker build →
  extract frontend → copy to /var/www/html/ac-helper/ → restart container)
- .env.example: production template with APP_PORT=8100
- docker-compose.yml: port now ${APP_PORT:-8100}:8000, updated proxy
  comment to Apache VirtualHost snippet
- .gitignore: whitelist .env.example

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 14:05:33 +00:00
Vadym Samoilenko
72c50b2c92 Initial commit — AC Tool unified application
Merges ac-helper (PHP Activation Calendar) and brief-extractor (Python AI)
into a single Docker app with React/TypeScript frontend.

Features:
- Brief upload → AI extraction → review → Activation Calendar import
- Handsontable v17 spreadsheet with dependent dropdowns (148 categories)
- AI natural language commands via Gemini (YOLO mode, voice input)
- Azure AD MSAL SPA PKCE authentication, user roles (user/admin)
- CSV Activation Calendar export
- Real-time WebSocket job progress
- Admin: user management, dropdown Excel upload
- Multi-stage Dockerfile, docker-compose, nginx proxy instructions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 13:24:46 +00:00