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

@@ -21,7 +21,7 @@
- ViewConfig: Display current configuration
.PARAMETER Component
Component to build (All, Frontend, Backend, TelegramBot, DataEntryApp, DataEntryBackend)
Component to build (All, Frontend, Backend)
.PARAMETER TransferMethod
Transfer method (Auto, WindowsShare, SSH)
@@ -58,7 +58,7 @@ param(
[ValidateSet("Build", "TestConnections", "ViewConfig")]
[string]$Action = "",
[ValidateSet("All", "Frontend", "Backend", "TelegramBot", "DataEntryApp", "DataEntryBackend")]
[ValidateSet("All", "Frontend", "Backend")]
[string]$Component = "",
[ValidateSet("Auto", "WindowsShare", "SSH")]
@@ -117,7 +117,7 @@ function Load-Configuration {
try {
$script:Config = Get-Content -Path $script:ConfigFilePath -Raw | ConvertFrom-Json
Write-Host " Configuration loaded successfully" -ForegroundColor Green
Write-Host "[OK] Configuration loaded successfully" -ForegroundColor Green
return $true
} catch {
Write-Host "[ERROR] Failed to load configuration: $_" -ForegroundColor Red
@@ -128,7 +128,7 @@ function Load-Configuration {
function Save-Configuration {
try {
$script:Config | ConvertTo-Json -Depth 10 | Set-Content -Path $script:ConfigFilePath
Write-Host " Configuration saved successfully" -ForegroundColor Green
Write-Host "[OK] Configuration saved successfully" -ForegroundColor Green
return $true
} catch {
Write-Host "[ERROR] Failed to save configuration: $_" -ForegroundColor Red
@@ -272,16 +272,16 @@ function Test-AllConnections {
Write-Host ("=" * 70) -ForegroundColor Cyan
Write-Host "`n Windows Share: " -NoNewline
if ($shareOk) {
Write-Host " Available" -ForegroundColor Green
Write-Host "[OK] Available" -ForegroundColor Green
} else {
Write-Host " Not Available" -ForegroundColor Red
Write-Host "[X] Not Available" -ForegroundColor Red
}
Write-Host " SSH Connection: " -NoNewline
if ($sshOk) {
Write-Host " Available" -ForegroundColor Green
Write-Host "[OK] Available" -ForegroundColor Green
} else {
Write-Host " Not Available" -ForegroundColor Red
Write-Host "[X] Not Available" -ForegroundColor Red
}
Write-Host "`n" + ("=" * 70) -ForegroundColor Cyan
@@ -299,7 +299,7 @@ function Test-AllConnections {
function Invoke-Build {
param(
[Parameter(Mandatory)]
[ValidateSet("All", "Frontend", "Backend", "TelegramBot", "DataEntryApp", "DataEntryBackend")]
[ValidateSet("All", "Frontend", "Backend")]
[string]$Component
)
@@ -558,7 +558,7 @@ function Edit-Configuration {
}
"4" {
Write-Host "`nEdit Build Settings:" -ForegroundColor Yellow
Write-Host "Default Component (All/Frontend/Backend/TelegramBot/DataEntryApp/DataEntryBackend)" -ForegroundColor Gray
Write-Host "Default Component (All/Frontend/Backend)" -ForegroundColor Gray
Write-Host "[current: $($script:Config.build.defaultComponent)]: " -NoNewline
$newComp = Read-Host
if ($newComp) { $script:Config.build.defaultComponent = $newComp }
@@ -660,27 +660,19 @@ function Show-ComponentMenu {
Clear-Host
Write-Host "`n" + ("=" * 70) -ForegroundColor Cyan
Write-Host " Select Component to Build" -ForegroundColor Cyan
Write-Host " Ultrathin Monolith Architecture" -ForegroundColor Cyan
Write-Host ("=" * 70) -ForegroundColor Cyan
Write-Host ""
Write-Host " [1] All Components" -ForegroundColor White
Write-Host " (Reports + Telegram Bot + Data Entry)" -ForegroundColor Gray
Write-Host " (Unified Backend + Frontend)" -ForegroundColor Gray
Write-Host " Includes: Reports, Data Entry, and Telegram modules" -ForegroundColor DarkGray
Write-Host ""
Write-Host " --- Reports App ---" -ForegroundColor Cyan
Write-Host " [2] Reports Frontend + Backend" -ForegroundColor White
Write-Host " (Vue.js build + FastAPI backend)" -ForegroundColor Gray
Write-Host " [2] Frontend + Backend" -ForegroundColor White
Write-Host " (Vue.js SPA build + Unified FastAPI backend)" -ForegroundColor Gray
Write-Host ""
Write-Host " [3] Reports Backend Only" -ForegroundColor White
Write-Host " (FastAPI backend + shared modules)" -ForegroundColor Gray
Write-Host ""
Write-Host " [4] Telegram Bot Only" -ForegroundColor White
Write-Host " (Telegram bot standalone package)" -ForegroundColor Gray
Write-Host ""
Write-Host " --- Data Entry App ---" -ForegroundColor Cyan
Write-Host " [5] Data Entry Frontend + Backend" -ForegroundColor White
Write-Host " (Vue.js build + FastAPI backend)" -ForegroundColor Gray
Write-Host ""
Write-Host " [6] Data Entry Backend Only" -ForegroundColor White
Write-Host " (FastAPI backend only)" -ForegroundColor Gray
Write-Host " [3] Backend Only" -ForegroundColor White
Write-Host " (Unified FastAPI backend + shared modules)" -ForegroundColor Gray
Write-Host " All modules included - control via MODULE_*_ENABLED flags" -ForegroundColor DarkGray
Write-Host ""
Write-Host " [B] Back to Main Menu" -ForegroundColor Yellow
Write-Host ""
@@ -694,12 +686,9 @@ function Show-ComponentMenu {
"1" { return "All" }
"2" { return "Frontend" }
"3" { return "Backend" }
"4" { return "TelegramBot" }
"5" { return "DataEntryApp" }
"6" { return "DataEntryBackend" }
"B" { return "Back" }
default {
Write-Host "Invalid choice. Please select 1-6 or B." -ForegroundColor Red
Write-Host "Invalid choice. Please select 1-3 or B." -ForegroundColor Red
}
}
} while ($true)