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:
@@ -19,11 +19,9 @@ import asyncio
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
# Import shared database pool
|
||||
import sys
|
||||
import os
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
|
||||
|
||||
from database.oracle_pool import oracle_pool
|
||||
# IMPORTANT: Use shared.database.oracle_pool to ensure singleton consistency
|
||||
# DO NOT use relative imports like 'database.oracle_pool'
|
||||
from shared.database.oracle_pool import oracle_pool
|
||||
from .jwt_handler import jwt_handler
|
||||
from .models import TokenResponse, CurrentUser
|
||||
|
||||
|
||||
@@ -1599,7 +1599,7 @@ locust -f shared/tests/load/test_multi_tenant_load.py --host=http://localhost:80
|
||||
cat reports-app/backend/.env > docs/pre_migration_env.txt
|
||||
|
||||
# Save current SSH tunnel config
|
||||
./ssh_tunnel.sh status > docs/pre_migration_ssh.txt
|
||||
./ssh-tunnel-prod.sh status > docs/pre_migration_ssh.txt
|
||||
```
|
||||
|
||||
- [ ] **Test deployment în environment non-production**
|
||||
@@ -2444,7 +2444,7 @@ Multi-Tenant (10 tenants):
|
||||
- **JWT Handler:** `shared/auth/jwt_handler.py` - Token creation/validation (needs tenant_id)
|
||||
- **Auth Middleware:** `shared/auth/middleware.py` - JWT verification (needs tenant validation)
|
||||
- **Backend Main:** `reports-app/backend/app/main.py` - Startup logic (needs MultiTenantPoolManager)
|
||||
- **SSH Tunnel Script:** `ssh_tunnel.sh` - Single tunnel script (needs per-tenant manager)
|
||||
- **SSH Tunnel Script:** `ssh-tunnel-prod.sh` - Single tunnel script (needs per-tenant manager)
|
||||
|
||||
### Inspiration & Patterns
|
||||
|
||||
|
||||
Reference in New Issue
Block a user