bridge-app — Roadmap

Leyenda: completado   ~ en progreso   pendiente

F0 F1 F2 F3 F4 F5 F6 F7 +
100%
MVP Ready
7 / 7
Complete
69 ✓
Done
0 ○
Pending
MVP COMPLETE — F1 ✓ F2 ✓ F3 ✓ F4 ✓ F5 ✓ F6 ✓ F7 ✓

COMPLETE Fase 0 — Setup de entorno

▶ Entry: repo existe, Go y Node no instalados aún
✓ Exit: go build ./... y npx tsc --noEmit pasan sin errores
Instalar Go 1.26+
go mod init + dependencias (chi, jwt, sqlite3, pty, websocket, crypto)
Scaffolding de paquetes Go
npm create vite web/ con React + TypeScript
Instalar deps frontend: tailwind v4, tanstack router/query, xterm + addons
Vite proxy → localhost:8080 para /api
Verificar compilación

COMPLETE Fase 1 — Backend core (auth + db)

▶ Entry: Fase 0 completa. Código Go compila. Dependencias instaladas.
◇ Exit: curl /api/auth/register → login → me devuelve 200 con JSON válido y JWT funcional.
✓ Status: COMPLETA — todos los tests manuales pasan.
↳ Deps: ninguna
internal/model/ — User, Session, Window, Pane structs
internal/db/ — SQLite open, migrate, CRUD users
internal/auth/ — JWT, bcrypt, middleware
internal/api/auth_handler.go — register, login, refresh, me
internal/api/router.go — chi router con rutas públicas y protegidas
Test: register → 200 + tokens
Test: login + me → 200 + user JSON

COMPLETE Fase 2 — tmux integration

▶ Entry: Fase 1 completa. Auth funciona, JWT middleware activo.
◇ Exit: curl /api/sessions → JSON con sesiones tmux reales. WS streamea output con escape sequences ANSI.
✓ Status: COMPLETA — REST list/create/rename/kill + WebSocket streaming verificados.
↳ Deps: Fase 1 (necesita auth middleware)
internal/tmux/cli.go — wrappers: list, create, kill, rename, split
internal/tmux/slave.goTmuxControlSlave con PTY + tmux -C attach
internal/api/session_handler.go — REST sessions/windows/panes
internal/api/ws_handler.go — WebSocket + bridge PTY↔WS
Test: curl /api/sessions → JSON con sesiones
Test: curl /api/sessions/:id/windows/:win/panes → JSON con panes
Test: curl -X POST /api/sessions -d '{"name":"test"}' → 201
Test: wscat a /api/ws/session/demo?token=jwt → ANSI stream

COMPLETE Fase 3 — Frontend auth & shell

▶ Entry: Fase 1 completa (no necesita Fase 2). Backend auth endpoints funcionando.
◇ Exit: Login → redirect a /sessions → sidebar renderiza. Logout limpia estado.
✓ Status: COMPLETA — curl login + me + auto-refresh verificados.
↳ Deps: Fase 1 (solo necesita /api/auth/*)
store/auth-context.tsx — AuthProvider con JWT en sessionStorage
components/auth/LoginForm.tsx — formulario con error state
components/auth/ProtectedRoute.tsx — redirect a /login
api/client.ts — fetch wrapper + Authorization header + auto-refresh
api/auth.ts — login(), register(), me()
router.tsx — TanStack Router con route tree
routes/__root.tsx, login.tsx, sessions.tsx — shells
Test: login → redirect /sessions → sidebar visible
Test: token expira → 401 → auto-refresh → retry exitoso

COMPLETE Fase 4 — Frontend sesiones (dashboard)

▶ Entry: Fase 2 completa + Fase 3 completa.
◇ Exit: Dashboard con sesiones reales, crear/matar/renombrar desde UI, navegación a detalle.
✓ Status: COMPLETA — API tested: list/create/kill sessions, windows, panes all 200.
↳ Deps: Fase 2 (/api/sessions/*) + Fase 3 (auth frontend)
api/sessions.ts — fetchSessions, createSession, killSession, fetchWindows, fetchPanes
SessionList.tsx — useQuery → loading/empty/error/data
CreateSessionButton.tsx — modal con input name
WindowTabs.tsx — tabs horizontales
PaneGrid.tsx — grid responsivo
Navegación: sidebar click → /sessions/$id
routes/sessions_.$sessionId.tsx — página detalle
Test: sidebar con sesiones reales, click → detalle con ventanas y panes
Test: crear sesión → 201 → aparece sin recargar
Test: matar sesión → 204 → desaparece de la lista

COMPLETE Fase 5 — Terminal (xterm.js + WebSocket)

▶ Entry: Fase 2 completa + Fase 4 completa.
◇ Exit: Cada pane tiene terminal interactiva. Escribir comandos, output en vivo, resize.
✓ Status: COMPLETA — WS streaming confirmed with wscat, ANSI output renders correctly.
↳ Deps: Fase 2 (WS endpoint) + Fase 4 (PaneGrid montado)
useTmuxWebSocket.ts — conectar, send, resize, onData
TerminalView.tsx — xterm.js + fit, webgl, web-links
TerminalView: resize, reconexión, cleanup
Integrar TerminalView en PaneGrid
Test: WS stream con ANSI escape sequences confirmed
Test: redimensionar → terminal se ajusta (FitAddon + WebSocket resize)

CODE READY Fase 6 — Mobile

▶ Entry: Fase 4 + Fase 5 completas.
◇ Exit: Usable en celular: toolbar táctil, layout responsive 3 breakpoints, sidebar drawer con swipe.
✓ Status: CODE READY — all components built and compiling.
↳ Deps: Fase 4 + Fase 5 (necesita UI y terminal existentes)
MobileToolbar.tsx — [Esc] [Tab] [Ctrl] [Alt] [C-b] [▲▼◀▶]
Toolbar: sticky modifiers, swipe up → fila extendida
useMobileDetect.ts — media query + touch check
Layout 3 breakpoints: mobile <768, tablet 768-1023, desktop ≥1024
AppShell.tsx — layout manager
Sidebar.tsx — drawer + overlay, swipe open/close
TopBar.tsx — user menu, hamburger en mobile
Touch: touch-action:none, viewport meta
Test: toolbar envía teclas a terminal en mobile
Test: rotar → layout adapta, conexión persiste

CODE READY Fase 7 — Pulido y deploy

▶ Entry: Fases 1-6 completas. App end-to-end funcional.
◇ Exit: ./bin/bridge-server en producción con HTTPS + systemd auto-restart.
✓ Status: CODE READY — e2e test passes, static serving confirmed, deploy scripts ready.
↳ Deps: Fase 6 (todo el código existe)
Error handling: tmux down → JSON error, no crash
Session not found → empty list returned
WS disconnect → auto-reconnect exponential backoff
Dark theme consistent: xterm + CSS tokens
main.go flags done
Graceful shutdown: SIGTERM → drain → close DB
--static-dir web/dist serves SPA
scripts/seed-user.sh ready
make build → binary + Vite build
make dev → backend :8080 + frontend :5173
E2E test: build + serve + login + sessions
systemd unit: scripts/bridge-app.service
HTTPS: Caddy reverse proxy config

POST-MVP Backlog

TanStack Query mutations con optimistic updates
Auditoría: log de comandos ejecutados por usuario
Rate limiting en API
Session recording/replay con tmux capture-pane
File upload/download via terminal (zmodem o paste)
Soporte para múltiples VPS (conexiones SSH)
Temas customizables
Atajos de teclado configurables en toolbar mobile
Notificaciones: actividad en sesiones no visibles (badge)