How msudipta888/dockview-dashboard works
Purpose and Launch Model
DockView is a local Docker Engine management and monitoring dashboard. It is distributed as an npm CLI that verifies/uses the local Docker daemon, launches a Python backend and Next.js frontend, then opens the browser. Primary entry points: bin/cli.js, backend/app/main.py, and frontend/src/app/layout.tsx.
Process Orchestration Boundary
The Node CLI is the product launcher and owns process-level concerns: command-line ports, development mode, browser opening, and starting the two servers. The backend and frontend remain independently runnable services behind localhost ports. Paths: bin/cli.js, package.json, backend/Dockerfile.
Backend API and Docker Adapter
FastAPI exposes REST operations for Docker resources and summary data. Docker SDK interaction is centralized behind a client wrapper, insulating route handlers from Docker Engine access details. This is the trust boundary to the local Docker socket/daemon: dashboard requests become Docker lifecycle, inspection, and deletion calls. Paths: backend/app/main.py, backend/app/docker_client.py, backend/app/routes/containers.py.
Resource Management Stages
REST route modules divide management by Docker resource: containers (list/start/stop/restart/remove), images, volumes, builds, and aggregate system summary. These routes are the request/response path consumed by the frontend API client. Paths: backend/app/routes/images.py, backend/app/routes/volumes.py, backend/app/routes/builds.py, backend/app/routes/summary.py.
Real-Time Streaming Plane
Socket handlers provide persistent streams distinct from REST: Docker daemon events, container stdout/stderr logs, per-container stats, and live build output. The backend bridges Docker’s streaming interfaces into Socket.IO/WebSocket-facing events; clients subscribe through a dedicated frontend WebSocket layer. Paths: backend/app/sockets/events.py, backend/app/sockets/logs.py, backend/app/sockets/stats.py, frontend/src/lib/api/ws.ts.
Frontend Dashboard Composition
The Next.js App Router frontend renders separate operational pages for overview, containers, images, volumes, builds, logs, and event/error feed. Shared shell components provide navigation and command-palette navigation, while domain hooks fetch resource data. Paths: frontend/src/app/page.tsx, frontend/src/app/containers/page.tsx, frontend/src/app/builds/page.tsx, frontend/src/components/layout/sidebar.tsx.
Client State and Service Integration
Frontend REST calls are centralized in an API client; TypeScript types define the frontend/backend data contract. Zustand-style stores hold daemon/dashboard state, supporting cross-page status and live updates. Material runtime dependencies are Node.js 18+, Python 3.9+, FastAPI/Uvicorn, Next.js, Socket.IO, and the Docker Python SDK; the sole external operational dependency is an accessible local Docker Engine. Paths: frontend/src/lib/api/client.ts, frontend/src/lib/types/index.ts, frontend/src/store/use-daemon-store.ts, backend/requirements.txt.
Main entry points: main.py FastAPI application · layout.tsx App shell · docker_client.py Docker client wrapper · client.ts REST API client
Components 19
Launch
- DockView CLI · Starts local services and opens the browser.
bin/cli.js - Package runtime
package.json
Backend service
- FastAPI application · REST and streaming service behind localhost.
backend/app/main.py - Docker client wrapper · Centralizes Docker SDK access.
backend/app/docker_client.py - Container routes · Lifecycle and inspection operations.
backend/app/routes/containers.py - Resource routes · Images, volumes, builds, and summary endpoints.
backend/app/routes/images.py - Event stream · Bridges Docker daemon events.
backend/app/sockets/events.py - Log stream · Bridges container stdout and stderr.
backend/app/sockets/logs.py - Stats stream · Bridges per-container metrics.
backend/app/sockets/stats.py
Frontend dashboard
- App shell · Shared dashboard shell and navigation.
frontend/src/app/layout.tsx - Operational pages · Overview and Docker resource views.
frontend/src/app/page.tsx - Containers page
frontend/src/app/containers/page.tsx - Builds page
frontend/src/app/builds/page.tsx - Sidebar navigation
frontend/src/components/layout/sidebar.tsx - REST API client · Centralizes backend REST calls.
frontend/src/lib/api/client.ts - WebSocket client · Subscribes to live backend streams.
frontend/src/lib/api/ws.ts - Data contracts · Frontend/backend payload definitions.
frontend/src/lib/types/index.ts - Daemon state store · Cross-page daemon status and live state.
frontend/src/store/use-daemon-store.ts
Local Docker Engine
- Docker daemon · Local Docker Engine and socket.
Connections 26
- Package runtime → DockView CLI: defines CLI runtime
- DockView CLI → FastAPI application: starts
- DockView CLI → App shell: starts frontend
- FastAPI application → Container routes: serves REST
- FastAPI application → Resource routes: serves REST
- FastAPI application → Event stream: hosts stream
- FastAPI application → Log stream: hosts stream
- FastAPI application → Stats stream: hosts stream
- Container routes → Docker client wrapper: Docker operations
- Resource routes → Docker client wrapper: Docker operations
- Event stream → Docker client wrapper: daemon events
- Log stream → Docker client wrapper: container logs
- Stats stream → Docker client wrapper: container stats
- Docker client wrapper → Docker daemon: Docker SDK/socket
- App shell → Sidebar navigation: renders
- App shell → Operational pages: hosts
- App shell → Containers page: hosts
- App shell → Builds page: hosts
- Operational pages → REST API client: fetches data
- Containers page → REST API client: manages containers
- Builds page → REST API client: manages builds
- REST API client → FastAPI application: REST requests
- WebSocket client → FastAPI application: stream subscriptions
- WebSocket client → Daemon state store: live updates
- REST API client → Data contracts: uses payload types
- Daemon state store → App shell: dashboard state