Skip to content

Latest commit

ย 

History

History
346 lines (244 loc) ยท 12.8 KB

File metadata and controls

346 lines (244 loc) ยท 12.8 KB
WatchDocs logo

๐Ÿ‘‹ WatchDocs โ€” Engineer Workspace

Automation โ€ข Preview โ€ข Notes โ€ข Diagram
Site Survey Tooling for Network & CCTV


๐Ÿ“Š Overview

๐Ÿ‘ฉโ€๐Ÿš€Vision

An engineer-first workspace that unifies automation, documentation, site-survey, and architecture diagramming in one lightweight container.

WatchDocs is a single-surface productivity canvas built for the day-to-day work of network, CCTV, and IT-infrastructure engineers. Automate routine checks, sketch topologies, annotate floor plans, and ship living documentation without juggling five separate tools.

๐Ÿ“ฝ๏ธFeature Pillars

  • Automation Playground - Visual node editor with typed input / process / output nodes, variables, and simulated runs
  • Preview - Split-pane Markdown and HTML live preview
  • Fast-Note - Rich text notes tuned for field surveys
  • Playground Diagram - Network and CCTV topology with floor-plan overlay, styled cables, and flow animations

๐Ÿ“ธ Screenshots & Views

View Screenshot Purpose Highlights
Automation Playground
(Dark & Light Mode)

Build repeatable workflows with input, process, and output nodes Drag-and-drop canvas, per-type inspector, variables, simulated runs
Preview
(Markdown & HTML)

Render live Markdown or HTML next to the source Split-pane, font size control, export and share
Fast-Note Capture on-site notes in a mobile-friendly rich editor Font family and size, alignment, save-to-device, share
Playground Diagram Map network and CCTV devices over a real floor plan SVG brand icons, styled connections, annotations, flow animations

๐Ÿซ€ Tech Stack

Frontend & UI

Runtime & Delivery


โ„น๏ธDeployment Profile

Attribute Value
Public URL https://watchdocs.dynamicdev.asia
Port mapping 3355:3355 (host : container)
Container name watchdocs
Image tag watchdocs:1.0.0
Docker network dynamicdev-net (shared, external)
Restart policy unless-stopped
Runs as non-root user nextjs (UID 1001)
Healthcheck HTTP GET / on 127.0.0.1:3355 every 30s

๐Ÿ–๏ธQuick Start

1. Clone the repository

git clone https://github.com/dynamicdev-official/watchdocs.git
cd watchdocs

2. Ensure the shared network exists

The compose stack expects dynamicdev-net to already be present on the Docker host. Create it once - every service in the ecosystem (Postgres, Traefik, Syscare, WatchDocs) attaches to the same network so containers can reach each other by name.

docker network create dynamicdev-net || true

3. Provide environment variables

cp .env.example .env
# edit DATABASE_URL, NEXT_PUBLIC_APP_URL, etc.

4. Build and start

docker compose up -d --build

5. Verify

docker compose ps
docker compose logs -f watchdocs
curl -I http://127.0.0.1:3355/

Open https://watchdocs.dynamicdev.asia once the reverse proxy has picked up the Traefik labels, or http://<host>:3355 for direct access during bring-up.


๐ŸŽ‹ Project Structure

watchdocs/
โ”œโ”€โ”€ app/                      # Next.js App Router (pages, layouts, globals)
โ”œโ”€โ”€ components/
โ”‚   โ”œโ”€โ”€ ui/                   # shadcn/ui primitives
โ”‚   โ””โ”€โ”€ watchdocs/            # Feature components (4 views)
โ”‚       โ”œโ”€โ”€ navbar.tsx
โ”‚       โ”œโ”€โ”€ status-bar.tsx
โ”‚       โ”œโ”€โ”€ automation-playground.tsx
โ”‚       โ”œโ”€โ”€ preview-view.tsx
โ”‚       โ”œโ”€โ”€ fast-note.tsx
โ”‚       โ”œโ”€โ”€ playground-diagram.tsx
โ”‚       โ””โ”€โ”€ diagram-icons.tsx
โ”œโ”€โ”€ lib/                      # Shared utilities
โ”œโ”€โ”€ public/                   # Static assets
โ”œโ”€โ”€ Dockerfile                # Multi-stage production image
โ”œโ”€โ”€ docker-compose.yml        # Stack definition (dynamicdev-net)
โ”œโ”€โ”€ DEPLOYMENT.md             # Detailed self-host guide with Postgres
โ””โ”€โ”€ README.md                 # This file

๐Ÿ‘จโ€๐Ÿ’ปOperational Commands

Action Command
Build image only docker compose build
Start in background docker compose up -d
Stop and remove docker compose down
Rebuild from clean state docker compose up -d --build --force-recreate
Follow logs docker compose logs -f watchdocs
Inspect running container docker exec -it watchdocs sh
Check health docker inspect --format '{{.State.Health.Status}}' watchdocs
Prune stale images docker image prune -f

๐Ÿ“Š Architecture

graph LR
    A[Client Browser] -->|HTTPS| B[Traefik / Edge Proxy]
    B -->|watchdocs.dynamicdev.asia :443| C[WatchDocs Container :3355]
    C -->|Read / Write| D[(PostgreSQL)]
    C -->|Shared LAN| E[Other Services on dynamicdev-net]
    style B fill:#24A1C1,color:#fff
    style C fill:#B03A2E,color:#fff
    style D fill:#4169E1,color:#fff
Loading

All services share the external dynamicdev-net Docker network so that internal hostnames like postgres, traefik, and watchdocs resolve without exposing extra ports.


๐Ÿ›ข๏ธ Database

WatchDocs can run in demo mode (in-memory, no DB) for quick evaluation. For multi-user and persistent workspaces, pair it with a Postgres container on the same network. Full schema, migration SQL, and connection wiring are documented in DEPLOYMENT.md.

Table Purpose
app_users Account records (replace Supabase Auth)
notes Fast-Note documents
preview_docs Preview view Markdown / HTML snippets
automations Saved automation graphs
automation_runs Historical simulation / execution logs
diagrams Playground Diagram devices, connections, regions

๐Ÿ” Security & Hardening

  • Runs as non-root user inside the container (UID 1001)
  • Reverse-proxy termination for TLS - do not expose 3355 to the public internet
  • Bind-mount nothing into the container by default
  • .env secrets stay on the host, never baked into the image
  • Logging capped at 10 MB per file, 5 rotations, to avoid disk pressure
  • Recommended companion services on the same network: Traefik (TLS), Watchtower (auto-update), Uptime Kuma (monitoring)

๐Ÿšฃ Roadmap

Milestone Status
v1.0 - Four-view workspace Released
v1.1 - Real workflow executor Planned
v1.2 - Multi-user realtime (Yjs) Research
v1.3 - MCP-driven device probes Discovery
v2.0 - Offline PWA for field engineers Proposed

๐Ÿ‘จโ€๐Ÿ’ป Contributing

Pull requests are welcome for bug fixes, performance improvements, and new diagram icons. For larger changes, open an issue first so we can align on scope and direction.

# Install dependencies
pnpm install

# Start the dev server on http://localhost:3000
pnpm dev

# Produce a production build locally
pnpm build && pnpm start

๐Ÿ–ฅ๏ธ Support & Contact

Technical Support

For bugs, deployment questions, and service inquiries

Partnership

Integration, custom deployment, and collaboration

Follow

Stay updated with the rest of the ecosystem


๐Ÿ” License

Released under the MIT License. See LICENSE for details.


Copyright ยฉ 2026 dynamicdev_ official - All Rights Reserved

Engineered in Bangkok, Thailand