Commit Graph

47 Commits

Author SHA1 Message Date
a77b500e50 fix: merge monitoring deploy into single job
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 51s
Monitoring was in a separate blocked job. Now everything runs in one
SSH session so Prometheus + Grafana always deploy with the app.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 15:23:17 +02:00
4a992e2c90 fix: CONTENT_TYPE_LATEST typo caused backend crash on startup
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 50s
Deploy to Production / Deploy Monitoring (push) Successful in 32s
CONTENT_TYPE_LSP doesn't exist in prometheus_client, causing ImportError.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 15:12:09 +02:00
38b59ba48d fix: rewrite deploy workflow to use SSH-based deployment
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 2m20s
Deploy to Production / Deploy Monitoring (push) Has been skipped
Use ubuntu-24.04 runner with SSH to 192.168.1.151 (same pattern as
memento project). Self-hosted runner is not needed on the server.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 14:53:15 +02:00
26dfa08730 feat: add Prometheus metrics + fix CI/CD health check port
Some checks failed
Deploy to Homelab / Deploy Wordly to 192.168.1.151 (push) Has been cancelled
Deploy to Homelab / Deploy Monitoring (if configured) (push) Has been cancelled
- Add prometheus-client dependency
- Create middleware/metrics.py with PrometheusMiddleware
- Expose /metrics endpoint in Prometheus text format
- Track http_requests_total, translation_total, translation_duration_seconds,
  file_size_bytes
- Instrument translate routes with record_translation() and record_file_size()
- Fix deploy.yml health check: localhost:8000 -> localhost:8001 (Portainer conflict)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 14:33:10 +02:00
a76442b382 feat: add Google Sign-In to login and register pages
- Add GoogleOAuthProvider wrapper in layout.tsx
- Add Google login button to LoginForm with "or continue with email" separator
- Add Google signup button to RegisterForm
- Add Google auth types and API client integration
- Add GOOGLE_CLIENT_ID and NEXT_PUBLIC_GOOGLE_CLIENT_ID to env config
- Add translations (EN/FR) for Google OAuth UI
- Backend already has /api/v1/auth/google endpoint, no changes needed

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 19:47:08 +02:00
d2d0b2c53c fix: expose frontend :3000 and backend :8000 ports
Some checks failed
Deploy to Homelab / Deploy Wordly to 192.168.1.151 (push) Has been cancelled
Deploy to Homelab / Deploy Monitoring (if configured) (push) Has been cancelled
Ports were missing, preventing direct access from the host.
Required for NPM reverse proxy and local testing.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 15:24:25 +02:00
05c5dfcbbb fix: add frontend/src/lib/ to git (was ignored by /lib/ pattern)
Some checks failed
Deploy to Homelab / Deploy Wordly to 192.168.1.151 (push) Has been cancelled
Deploy to Homelab / Deploy Monitoring (if configured) (push) Has been cancelled
The root .gitignore had `lib/` which matched frontend/src/lib/,
causing Docker build to fail with "Module not found: Can't resolve
'@/lib/utils'" and '@/lib/i18n'.

Changed to `/lib/` so it only ignores the Python lib at repo root.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 15:17:22 +02:00
98d82414bb feat: add Node.js setup wizard (replaces broken bash scripts)
Some checks failed
Deploy to Homelab / Deploy Wordly to 192.168.1.151 (push) Has been cancelled
Deploy to Homelab / Deploy Monitoring (if configured) (push) Has been cancelled
Node.js script that actually works:
- Generates JWT_SECRET_KEY, ADMIN_TOKEN_SECRET, POSTGRES_PASSWORD
- Hashes admin password with bcrypt via docker
- Writes ADMIN_PASSWORD (plaintext) + ADMIN_PASSWORD_HASH (bcrypt)
- Sets *_ENABLED=true for chosen provider, false for others
- Writes ALL provider fields (api_key, model, base_url)
- Optionally configures Stripe
- Optionally starts docker compose
- Verified: syntax OK, all env vars match backend expectations

Usage: node scripts/setup.js

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 13:29:28 +02:00
90efc7c0f8 fix: complete .env.production with all provider ENABLED flags
Some checks failed
Deploy to Homelab / Deploy Wordly to 192.168.1.151 (push) Has been cancelled
Deploy to Homelab / Deploy Monitoring (if configured) (push) Has been cancelled
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 12:57:41 +02:00
7e97bbd07b fix: scripts properly set ENABLED flags and all env vars for providers
Some checks failed
Deploy to Homelab / Deploy Wordly to 192.168.1.151 (push) Has been cancelled
Deploy to Homelab / Deploy Monitoring (if configured) (push) Has been cancelled
setup-env.sh:
- Each provider choice now sets its *_ENABLEED=true flag explicitly
- All provider fields written to .env (model, base_url, api_key, enabled)
- Shows active provider status in summary

manage-keys.sh:
- Each provider menu sets *_ENABLEED=true when key is added
- Sets *_ENABLEED=false when key is removed
- Writes all required env vars (model, base_url) not just API key
- Shows provider status with enabled/disabled state
- Better organized menu

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 12:52:06 +02:00
034d6bfce8 docs: rewrite deployment guide with Stripe and API keys management
Some checks failed
Deploy to Homelab / Deploy Wordly to 192.168.1.151 (push) Has been cancelled
Deploy to Homelab / Deploy Monitoring (if configured) (push) Has been cancelled
Complete rewrite of DEPLOYMENT_HOMELAB.md covering:
- IONOS DNS setup (with @ record workaround)
- NPM proxy host config with exact nginx custom config
- Docker server setup with setup-env.sh wizard
- All 7 translation providers (Google, DeepL, OpenAI, DeepSeek, Minimax, OpenRouter, Ollama)
- Full Stripe integration guide (account, products, webhooks, test cards, live mode)
- NAS backup setup
- Prometheus + Grafana monitoring
- Gitea Actions CI/CD runner setup
- Complete checklist

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 12:36:47 +02:00
3c710c52a1 fix(ui): profile page bugs - billing button, cancel button, header subtitle
Some checks failed
Deploy to Homelab / Deploy Wordly to 192.168.1.151 (push) Has been cancelled
Deploy to Homelab / Deploy Monitoring (if configured) (push) Has been cancelled
- Remove billing portal button (not functional without Stripe configured)
- Show cancel subscription only when user has a real Stripe subscription ID
- Remove muted subtitle from dashboard header (was appearing as grayed out)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 12:33:37 +02:00
e6e1678b1d feat: add DeepSeek and Minimax (m2.7) translation providers
Some checks failed
Deploy to Homelab / Deploy Wordly to 192.168.1.151 (push) Has been cancelled
Deploy to Homelab / Deploy Monitoring (if configured) (push) Has been cancelled
New providers:
- DeepSeek: direct API with deepseek-chat model, very cost-effective
- Minimax: MiniMax-M1 model via OpenAI-compatible API, supports m2.7

Changes:
- Full provider implementations with retry, health check, batch support
- Provider config with env vars (DEEPSEEK_*, MINIMAX_*)
- Auto-registration in provider registry
- Updated fallback chain to include new providers
- Updated setup-env.sh wizard with options 6 (deepseek) and 7 (minimax)
- Updated manage-keys.sh with new menu entries and provider switching
- Updated docker-compose.yml with new env vars

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 12:30:36 +02:00
d6d19eaf0c feat: add API key management script
Some checks failed
Deploy to Homelab / Deploy Wordly to 192.168.1.151 (push) Has been cancelled
Deploy to Homelab / Deploy Monitoring (if configured) (push) Has been cancelled
Interactive menu to add/update/clear API keys:
- Translation: OpenAI, DeepL, OpenRouter
- Payment: Stripe (secret, webhook, price IDs)
- Admin password change with bcrypt
- Switch translation provider
- Status overview with masked keys

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 12:18:43 +02:00
3d01f53924 fix: setup wizard compatible sh/dash (read -s fallback)
Some checks failed
Deploy to Homelab / Deploy Wordly to 192.168.1.151 (push) Has been cancelled
Deploy to Homelab / Deploy Monitoring (if configured) (push) Has been cancelled
Use stty -echo instead of read -s for password input,
compatible with dash/sh shells found on Ubuntu/Debian servers.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 12:16:27 +02:00
a9fe6c1fc6 feat: add interactive .env setup wizard
Some checks failed
Deploy to Homelab / Deploy Wordly to 192.168.1.151 (push) Has been cancelled
Deploy to Homelab / Deploy Monitoring (if configured) (push) Has been cancelled
Interactive bash script for server configuration:
- Generates all secrets automatically (JWT, admin token, DB password)
- Hashes admin password with bcrypt
- Configurable translation providers, Stripe, Grafana
- Validates inputs and confirms before writing
- Secures .env with chmod 600

Usage on server: bash scripts/setup-env.sh

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 12:02:44 +02:00
f79a4303ac ci: add Gitea Actions self-hosted deployment workflow
Some checks failed
Deploy to Homelab / Deploy Wordly to 192.168.1.151 (push) Has been cancelled
Deploy to Homelab / Deploy Monitoring (if configured) (push) Has been cancelled
Auto-deploys to 192.168.1.151 on push to production-deployment:
- Builds backend and frontend Docker images
- Starts all services with health checks
- Optionally deploys monitoring stack
- Cleans up old images

Requires a self-hosted runner on the target server.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 11:53:41 +02:00
ce8e150a61 feat: homelab deployment - NPM + IONOS DNS + monitoring + NAS backup
- Restructured docker-compose for Nginx Proxy Manager (no custom nginx)
- Added domain wordly.art configuration
- Added Prometheus + Grafana monitoring stack with pre-configured dashboards
- Added PostgreSQL backup script to NAS (daily/weekly/monthly rotation)
- Added alert rules for backend, system, and Docker metrics
- Updated deployment guide for NPM + IONOS DNS homelab setup
- Added marketing plan document
- PDF translator and watermark support
- Enhanced middleware, routes, and translator modules

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 11:43:28 +02:00
Sepehr Ramezani
16ac7ca2b9 fix(ui): profile page light mode color fixes
Some checks failed
Build and Deploy / Backend Tests (push) Has been cancelled
Build and Deploy / Frontend Build Check (push) Has been cancelled
Build and Deploy / Build Docker Images (push) Has been cancelled
Build and Deploy / Deploy to Server (push) Has been cancelled
- Replace all accent colors with primary (accent is near-white in light mode)
- Add dark: variants for status colors (emerald, red, amber) that were dark-only
- Fix usage bar fill color from bg-accent to bg-primary
- Fix alert boxes with proper light/dark variants (bg-amber-50/dark:bg-amber-500/10)
- Fix danger zone title with dark: variant
- Fix info banner with proper muted background

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-01 16:48:15 +02:00
Sepehr Ramezani
1ed4aaaaa7 fix(ui): light mode visibility + sidebar layout
Some checks failed
Build and Deploy / Backend Tests (push) Has been cancelled
Build and Deploy / Frontend Build Check (push) Has been cancelled
Build and Deploy / Build Docker Images (push) Has been cancelled
Build and Deploy / Deploy to Server (push) Has been cancelled
- Replace accent with primary for upgrade banner (invisible on white bg)
- Fix sidebar actions (theme/logout) stuck at bottom with mt-auto
- Use primary color for user avatar fallback in light mode

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-01 16:40:45 +02:00
Sepehr Ramezani
2f7347b4db feat: fix registration 500, add forgot-password flow, frontend validation
Some checks failed
Build and Deploy / Backend Tests (push) Has been cancelled
Build and Deploy / Frontend Build Check (push) Has been cancelled
Build and Deploy / Build Docker Images (push) Has been cancelled
Build and Deploy / Deploy to Server (push) Has been cancelled
- Fix MissingGreenlet: sync_engine now uses psycopg2 instead of asyncpg
- Fix bcrypt/passlib compat: pin bcrypt<4.1 in requirements
- Fix legacy password_hash NOT NULL: alter column to nullable in migration
- Add frontend password validation (uppercase + lowercase + digit)
- Add forgot-password and reset-password backend endpoints
- Add forgot-password and reset-password frontend pages
- Add email_service.py (SMTP via admin settings)
- Add reset_token/reset_token_expires columns to User model
- Migrate legacy JSON-only users to DB on password reset request
- Mount data/ volume in docker-compose.local.yml for persistence
- Add production deployment config (Dockerfile, nginx, deploy.sh)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-01 16:23:51 +02:00
Sepehr Ramezani
26bd096a06 feat: production deployment - full update with providers, admin, glossaries, pricing, tests
Major changes across backend, frontend, infrastructure:
- Provider system with model selection (Google, DeepL, OpenAI, Ollama, Google Cloud)
- Admin panel: user management, pricing, settings
- Glossary system with CSV import/export
- Subscription and tier quota management
- Security hardening (rate limiting, API key auth, path traversal fixes)
- Docker compose for dev, prod, and IONOS deployment
- Alembic migrations for new tables
- Frontend: dashboard, pricing page, landing page, i18n (en/fr)
- Test suite and verification scripts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-25 15:01:47 +02:00
Sepehr Ramezani
2ba4fedfc8 fix(security): path traversal sur /download et /cleanup, validation UUID session_id et chemin input_path dans reconstruct-document
Made-with: Cursor
2026-03-07 11:44:17 +01:00
Sepehr Ramezani
473b3e26c7 feat: revue de code, doc CODE_REVIEW, forfaits 2026, traduction LLM, providers avec modèle
Made-with: Cursor
2026-03-07 11:42:58 +01:00
3d37ce4582 feat: Update Docker and Kubernetes for database infrastructure
- Update backend Dockerfile with PostgreSQL deps and entrypoint
- Add entrypoint.sh with db/redis wait and auto-migration
- Add /ready endpoint for Kubernetes readiness probe
- Enhance /health endpoint with database and Redis status
- Update k8s deployment with PostgreSQL and Redis services
- Add proper secrets management for database credentials
- Update k8s readiness probe to use /ready endpoint
2025-12-31 10:58:41 +01:00
550f3516db feat: Add PostgreSQL database infrastructure
- Add SQLAlchemy models for User, Translation, ApiKey, UsageLog, PaymentHistory
- Add database connection management with PostgreSQL/SQLite support
- Add repository layer for CRUD operations
- Add Alembic migration setup with initial migration
- Update auth_service to automatically use database when DATABASE_URL is set
- Update docker-compose.yml with PostgreSQL service and Redis (non-optional)
- Add database migration script (scripts/migrate_to_db.py)
- Update .env.example with database configuration
2025-12-31 10:56:19 +01:00
c4d6cae735 Production-ready improvements: security hardening, Redis sessions, retry logic, updated pricing
Changes:
- Removed hardcoded admin credentials (now requires env vars)
- Added Redis session storage with in-memory fallback
- Improved CORS configuration with warnings for development mode
- Added retry_with_backoff decorator for translation API calls
- Updated pricing: Starter=, Pro=, Business=
- Stripe price IDs now loaded from environment variables
- Added redis to requirements.txt
- Updated .env.example with all new configuration options
- Created COMPREHENSIVE_REVIEW_AND_PLAN.md with deployment roadmap
- Frontend: Updated pricing page, new UI components
2025-12-31 10:43:31 +01:00
721b18dbbd Restore provider selection, model selection, and context/glossary in file uploader 2025-11-30 22:57:21 +01:00
dfd45d9f07 Fix admin login endpoint to accept JSON instead of form data 2025-11-30 22:49:39 +01:00
80318a8d43 Complete admin dashboard with user management, config and settings tabs 2025-11-30 22:44:10 +01:00
d31a132808 Commercial frontend cleanup: fix admin TypeError, simplify UI for end users, add Suspense boundaries 2025-11-30 22:28:59 +01:00
3346817a8a Add OpenRouter provider with DeepSeek support - best value for translation (.14/M tokens) 2025-11-30 22:10:34 +01:00
b65e683d32 Add translation cache for faster repeated translations (5000 entry LRU cache with hit rate tracking) 2025-11-30 21:37:11 +01:00
d2b820c6f1 Hide admin section in sidebar, optimize translation service with parallel processing, improve UX 2025-11-30 21:33:44 +01:00
fcabe882cd feat: Add complete monetization system
Backend:
- User authentication with JWT tokens (auth_service.py)
- Subscription plans: Free, Starter (), Pro (), Business (), Enterprise
- Stripe integration for payments (payment_service.py)
- Usage tracking and quotas
- Credit packages for pay-per-use
- Plan-based provider restrictions

Frontend:
- Landing page with hero, features, pricing preview (landing-sections.tsx)
- Pricing page with all plans and credit packages (/pricing)
- User dashboard with usage stats (/dashboard)
- Login/Register pages with validation (/auth/login, /auth/register)
- Ollama self-hosting setup guide (/ollama-setup)
- Updated sidebar with user section and plan badge

Monetization strategy:
- Freemium: 3 docs/day, Ollama only
- Starter: 50 docs/month, Google Translate
- Pro: 200 docs/month, all providers, API access
- Business: 1000 docs/month, team management
- Enterprise: Custom pricing, SLA

Self-hosted option:
- Free unlimited usage with own Ollama server
- Complete privacy (data never leaves machine)
- Step-by-step setup guide included
2025-11-30 21:11:51 +01:00
29178a75a5 feat: Add complete production deployment infrastructure
- Docker configuration:
  - Multi-stage Dockerfiles for backend (Python 3.11) and frontend (Node 20)
  - Production docker-compose.yml with all services
  - Development docker-compose.dev.yml with hot-reload

- Nginx reverse proxy:
  - SSL/TLS termination with modern cipher suites
  - Rate limiting and security headers
  - Caching and compression
  - Load balancing ready

- Kubernetes manifests:
  - Deployment, Service, Ingress configurations
  - ConfigMap and Secrets
  - HPA for auto-scaling
  - PersistentVolumeClaims

- Deployment scripts:
  - deploy.sh: Automated deployment with health checks
  - backup.sh: Automated backup with retention
  - health-check.sh: Service health monitoring
  - setup-ssl.sh: Let's Encrypt SSL automation

- Monitoring:
  - Prometheus configuration
  - Grafana dashboards (optional)
  - Structured logging

- Documentation:
  - DEPLOYMENT_GUIDE.md: Complete deployment instructions
  - Environment templates (.env.production)

Ready for commercial deployment!
2025-11-30 20:56:15 +01:00
8f9ca669cf Performance optimization: batch translation for 5-10x speed improvement
- GoogleTranslationProvider: Added batch translation with separator method
- DeepLTranslationProvider: Added translator caching and batch support
- LibreTranslationProvider: Added translator caching and batch support
- WordTranslator: Collect all texts -> batch translate -> apply pattern
- ExcelTranslator: Collect all texts -> batch translate -> apply pattern
- PowerPointTranslator: Collect all texts -> batch translate -> apply pattern
- Enhanced Ollama/OpenAI prompts with stricter translation-only rules
- Added rule: return original text if uncertain about translation
2025-11-30 20:41:20 +01:00
54d85f0b34 feat: Add admin dashboard with authentication - Admin login/logout with Bearer token authentication - Secure admin dashboard page in frontend - Real-time system monitoring (memory, disk, translations) - Rate limits and cleanup service monitoring - Protected admin endpoints - Updated README with full SaaS documentation 2025-11-30 19:33:59 +01:00
500502440c feat: Add SaaS robustness middleware - Rate limiting with token bucket and sliding window algorithms - Input validation (file, language, provider) - Security headers middleware (CSP, XSS protection, etc.) - Automatic file cleanup with TTL tracking - Memory and disk monitoring - Enhanced health check and metrics endpoints - Request logging with unique IDs 2025-11-30 19:25:09 +01:00
8c7716bf4d Add Next.js frontend with WebLLM, OpenAI support - Add complete Next.js frontend with Tailwind CSS and shadcn/ui - Integrate WebLLM for client-side browser-based translations - Add OpenAI provider support with gpt-4o-mini default - Add Context & Glossary page for LLM customization - Reorganize settings: Translation Services includes all providers - Add system prompt and glossary support for all LLMs - Remove test files and requirements-test.txt 2025-11-30 19:02:41 +01:00
a4ecd3e0ec Add MCP server and configuration for AI assistant integration 2025-11-30 16:53:53 +01:00
e48ea07e44 Add system prompt, glossary, presets for Ollama/WebLLM, image translation support 2025-11-30 16:45:41 +01:00
465cab8a61 Add WebLLM model selection and cache management 2025-11-30 11:57:58 +01:00
9410b07512 Add WebLLM support, fix progress bar blocking at 90%, add timeout protection 2025-11-30 11:54:33 +01:00
1d2784602b Add Ollama vision image translation with checkbox option 2025-11-30 11:48:29 +01:00
abe77e3b29 Add Ollama support, progress bar, and professional UI redesign 2025-11-30 11:27:13 +01:00
793d94c93e Initial commit: Document Translation API with Excel, Word, PowerPoint support 2025-11-30 10:48:58 +01:00