feat: Migrate to ultrathin monolith architecture

Consolidate 3 separate applications (reports-app, data-entry-app, telegram-bot) into a unified
architecture with single backend and frontend:

Backend Changes:
- Unified FastAPI backend at backend/ with modular structure
- Modules: reports, data_entry, telegram in backend/modules/
- Centralized config.py and main.py with all routers registered
- Single worker mode (--workers 1) for Telegram bot compatibility
- Shared Oracle connection pool and JWT authentication
- Unified requirements.txt and environment configuration

Frontend Changes:
- Single Vue.js SPA with module-based routing
- Unified frontend at src/ with modules in src/modules/{reports,data-entry}/
- Shared components and stores in src/shared/
- Error boundaries for module isolation
- Dual API proxy in Vite for module communication

Infrastructure:
- New unified startup scripts: start-prod.sh, start-test.sh, start-backend.sh
- Environment templates: .env.dev.example, .env.test.example, .env.prod.example
- Updated deployment scripts for Windows IIS
- Simplified SSH tunnel management

Documentation:
- Comprehensive CLAUDE.md with architecture overview
- Module-specific docs in docs/{data-entry,telegram}/
- Architecture decision records in docs/ARCHITECTURE-DECISIONS.md
- Deployment guides consolidated in deployment/windows/docs/

This migration reduces complexity, improves maintainability, and enables easier
deployment while maintaining all existing functionality.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-29 23:48:14 +02:00
parent 2a101f1ef5
commit c5e051ad80
378 changed files with 7566 additions and 73730 deletions

View File

@@ -350,13 +350,15 @@ JWT_EXPIRE_MINUTES=480
# Server Settings
HOST=127.0.0.1
PORT=8000
WORKERS=4
# NOTE: WORKERS is NOT used in .env - configured in NSSM service (--workers 1)
# Logging
LOG_LEVEL=INFO
LOG_FILE=C:\inetpub\wwwroot\roa2web\backend\logs\app.log
```
**Important:** Worker count is configured in the NSSM Windows service (`--workers 1`), NOT in `.env`. This is required for Telegram bot functionality. See `TELEGRAM-BOT-DEPLOYMENT.md` for details.
### IIS Configuration (web.config)
**Location:** `C:\inetpub\wwwroot\roa2web\frontend\web.config`
@@ -721,20 +723,27 @@ icacls C:\inetpub\wwwroot\roa2web\backend /grant "NT AUTHORITY\LOCAL SERVICE":(O
# Service resource usage
Get-Process -Name python | Format-Table ProcessName, CPU, WS
# Check worker count
Get-Content C:\inetpub\wwwroot\roa2web\backend\.env | Select-String WORKERS
# Check worker count (configured in NSSM, not .env)
nssm get ROA2WEB-Backend AppParameters
```
**Solutions:**
```env
# Reduce workers in .env
WORKERS=2
**Note:** ROA2WEB uses `--workers 1` by default (required for Telegram bot). This is configured in NSSM, not in .env.
# Reduce pool size
ORACLE_MAX_POOL_SIZE=5
```powershell
# Workers are configured in NSSM service parameters
# To reduce memory, adjust Oracle pool size in .env instead:
```
```env
# Reduce Oracle connection pool size
ORACLE_MAX_POOL_SIZE=5
ORACLE_MIN_POOL_SIZE=2
```
**Important:** Do NOT change `--workers 1` to a higher value - this will break the Telegram bot. See `docs/TELEGRAM-BOT-DEPLOYMENT.md` for details.
---
## 🔄 Maintenance