feat: multi-Oracle server support with runtime switching

Complete implementation of multi-server Oracle database support:

Backend:
- Multi-pool Oracle with lazy loading per server
- Email-to-server cache for automatic server discovery
- JWT tokens include server_id claim
- /auth/check-identity and /auth/check-email endpoints
- /auth/my-servers endpoint for listing user's accessible servers
- Server switch with password re-authentication

Frontend:
- New ServerSelector component for header dropdown
- Multi-step login flow (identity → server → password)
- Server switching from header with password modal
- Mobile drawer menu with server selection
- Dark mode support for all new components
- URL bookmark support with ?server= query param

Scripts:
- Unified start.sh replacing start-prod.sh/start-test.sh
- Unified ssh-tunnel.sh with multi-server support
- Updated status.sh for new architecture

Tests:
- E2E tests for multi-server and single-server login flows
- Backend unit tests for all new endpoints
- Oracle multi-pool integration tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-01-26 22:39:06 +00:00
parent 5f99ee2fd0
commit b137e80b71
102 changed files with 9398 additions and 2787 deletions

View File

@@ -4,14 +4,14 @@
### PROD Environment (server PRODUCȚIE 10.0.20.36)
```bash
./start-prod.sh # Pornește tot: SSH tunnel + backend + frontend
./start-prod.sh stop # Oprește toate serviciile
./start.sh prod # Pornește tot: SSH tunnel + backend + frontend
./start.sh prod stop # Oprește toate serviciile
```
### TEST Environment (server TEST 10.0.20.121)
```bash
./start-test.sh # Pornește tot: SSH tunnel + backend + frontend
./start-test.sh stop # Oprește toate serviciile
./start.sh test # Pornește tot: backend + frontend (conexiune directă)
./start.sh test stop # Oprește toate serviciile
```
## Verificare Status
@@ -42,12 +42,12 @@ Unified Backend → Port 8000
| Script | Descriere |
|--------|-----------|
| `./start-prod.sh` | Pornește tot pentru PROD (Oracle PROD: 10.0.20.36) |
| `./start-test.sh` | Pornește tot pentru TEST (Oracle TEST: 10.0.20.121) |
| `./start.sh prod` | Pornește tot pentru PROD (Oracle PROD: 10.0.20.36 + SSH) |
| `./start.sh test` | Pornește tot pentru TEST (Oracle TEST: 10.0.20.121 direct) |
| `./start.sh <env> stop` | Oprește toate serviciile |
| `./status.sh` | Verifică status-ul serviciilor |
| `./start-backend.sh start/stop/restart` | Control granular backend |
| `./start-frontend.sh restart` | Restart rapid frontend (~7s) |
| `./test-unified-backend.sh` | Rulează testele comprehensive |
## API Endpoints
@@ -84,7 +84,7 @@ tail -n 50 /tmp/unified_backend_dev.log
lsof -i :8000
# Oprește procesul vechi
./start-prod.sh stop
./start.sh prod stop
```
### Frontend nu pornește
@@ -99,26 +99,24 @@ npm install
### SSH Tunnel nu se conectează
```bash
# DEV (PRODUCȚIE)
./ssh-tunnel-prod.sh stop
./ssh-tunnel-prod.sh start
# Pentru servere care necesită SSH tunnel (producție)
./ssh-tunnel.sh stop
./ssh-tunnel.sh start
# TEST
./ssh-tunnel-test.sh stop
./ssh-tunnel-test.sh start
# TEST - conexiune directă, nu necesită tunnel
```
## Configurare Inițială
1. **Backend**: Creează `backend/.env` din `backend/.env.example`
2. **Configurează variabilele** pentru mediul dorit (DEV/TEST)
3. **Pornește serviciile**: `./start-prod.sh` sau `./start-test.sh`
3. **Pornește serviciile**: `./start.sh prod` sau `./start.sh test`
## Diferențe DEV vs TEST
| Aspect | DEV | TEST |
|--------|-----|------|
| SSH Tunnel | `./ssh-tunnel-prod.sh` | `./ssh-tunnel-test.sh` |
| SSH Tunnel | `./ssh-tunnel.sh` | Nu necesită (conexiune directă) |
| Server Oracle | 10.0.20.36 (PROD) | 10.0.20.121 (TEST) |
| Schema Test | ROMFAST (id=114) | MARIUSM_AUTO (id=110) |
| .env File | `backend/.env` | `backend/.env.test``backend/.env` |