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:
32
backend/modules/telegram/routers/__init__.py
Normal file
32
backend/modules/telegram/routers/__init__.py
Normal file
@@ -0,0 +1,32 @@
|
||||
"""Telegram module router factory."""
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
|
||||
def create_telegram_router() -> APIRouter:
|
||||
"""
|
||||
Create and configure Telegram module router.
|
||||
|
||||
Includes all Telegram bot internal API endpoints:
|
||||
- /auth/verify-user - Verify Telegram user authentication
|
||||
- /auth/generate-code - Generate auth code for linking
|
||||
- /auth/verify-code - Verify auth code
|
||||
- /stats - Bot database statistics
|
||||
|
||||
Returns:
|
||||
APIRouter: Configured router for Telegram module
|
||||
"""
|
||||
router = APIRouter()
|
||||
|
||||
# Import routers here to avoid circular imports
|
||||
from .auth_codes import router as auth_codes_router
|
||||
from .internal_api import internal_api as internal_api_router
|
||||
|
||||
# Include all sub-routers (no prefix - already prefixed in main.py with /api/telegram)
|
||||
# Auth codes router provides /auth/* endpoints
|
||||
router.include_router(auth_codes_router, tags=["telegram-auth"])
|
||||
|
||||
# Internal API router provides additional endpoints like /stats
|
||||
router.include_router(internal_api_router, tags=["telegram-internal"])
|
||||
|
||||
return router
|
||||
Reference in New Issue
Block a user