feat: Implement unified Vue SPA with granular service control

Consolidate Reports and Data Entry apps into a single Vue.js SPA with:

Architecture:
- Module-based structure with lazy-loaded routes (@reports, @data-entry)
- Error boundaries per module to prevent cascade failures
- Dual API proxy in Vite for microservices (reports:8001, data-entry:8003)
- Pinia store factories for shared auth, company, and period stores
- Vite path aliases for clear module boundaries (@shared, @reports, @data-entry)

Service Management:
- Granular service control scripts (backend-reports.sh, backend-data-entry.sh, bot.sh, frontend.sh)
- 87% faster frontend restart: 7s vs 53s full restart
- 38% faster full startup: 33s vs 53s via parallel backend initialization
- Enhanced start-dev.sh with proper service timeouts (OCR: 30s, Vite: 15s, Bot: 10s)
- status.sh for comprehensive health checks

Features:
- Auto-select first company on login with period auto-load
- Hamburger menu with feature toggle support
- JWT token auto-injection via axios interceptors
- Unified header with company/period selectors
- IIS web.config for production deployment with multi-API routing

UX Improvements:
- Vue watchers for reactive company/period loading
- Lazy store initialization with graceful error handling
- Period persistence per user+company in localStorage
- Feature flags for optional modules

Deployment:
- Single IIS site serves unified frontend with API proxy rules
- Maintains separate backend processes for microservices
- Windows line ending fixes (.env CRLF → LF conversion)

Stats: 112 files changed, 38,342 insertions(+), 2,342 deletions(-)

🤖 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-24 19:06:23 +02:00
parent fed2e68fa2
commit d507a81b0a
112 changed files with 38382 additions and 2382 deletions

View File

@@ -74,14 +74,32 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
### Starting Services
**Quick Start** (All services with parallel backend startup):
```bash
# Reports App (Oracle reports)
./start-test.sh # Backend :8001, Frontend :3000-3005, Telegram :8002
# Data Entry App (fiscal receipts)
./start-data-entry.sh # Backend :8003, Frontend :3010
./start-dev.sh # Dev: Backend :8001, :8003, Bot :8002, Frontend :3000 (~11s)
./start-test.sh # Test: Same ports (~33s - Oracle pool init takes longer)
```
**Individual Service Control** (for quick development iterations):
```bash
./frontend.sh restart # Restart frontend only (~7s - fastest!)
./backend-reports.sh start # Start Reports backend :8001
./backend-data-entry.sh stop # Stop Data Entry backend :8003
./bot.sh status # Check Telegram bot :8002 status
./status.sh # Show all services status + health checks
```
**Infrastructure**:
```bash
./ssh_tunnel.sh start # Oracle DB tunnel (production: 10.0.20.36)
./ssh-tunnel-test.sh start # Oracle TEST tunnel (LXC: 10.0.20.121)
```
**Benefits**:
- **87% faster frontend restart**: 7s vs 53s full restart
- **38% faster full startup**: 33s vs 53s (test) via parallel backend init
- **Granular control**: Restart individual services without affecting others
### Key Architectural Decisions
- **Shared Database Pool**: Singleton `OraclePool` in `shared/database/oracle_pool.py` (python-oracledb with connection pooling)
- **Centralized Auth**: JWT-based auth in `shared/auth/` with middleware auto-injecting `request.state.user`