How sniksax/openward works
OpenWard is a WireGuard-based, zone-segmented network access manager. An administrator signs in to the dashboard, provisions peers with a role and configuration, and monitors or revokes them; users can also claim accounts from an active peer. The Go service exposes the API, persists users and peers in SQLite, and regenerates the gateway’s WireGuard configuration as peers change. The README documents the zone firewall policy and single-origin static dashboard serving. Several backend helpers and dashboard pages are unsampled, so their internal links are omitted where not evidenced.
Main entry points: main.router.go API Router · api.ts API Client · users.controller.go User Controller · peers.service.go Peer Lifecycle Service
Components 20
Management Dashboard
- Login Page
frontend/app/page.tsx - API Client
frontend/lib/api.ts - Peer Deployment
frontend/app/(dashboard)/dashboard/deploy/page.tsx - Peer Management
frontend/app/(dashboard)/peers/page.tsx - Live Stats Hook
frontend/hooks/use-live-stats.ts - Network Overview
frontend/app/(dashboard)/dashboard/page.tsx - User Management
frontend/app/(dashboard)/dashboard/users/page.tsx - Static Dashboard Files
frontend
API and Identity
- HTTP Server
backend/src/main.go - API Router
backend/src/routers/main.router.go - User Controller
backend/src/controllers/users.controller.go - Account Services
backend/src/services/users.service.go - User Repository
backend/src/db/users.db.go
Peer Lifecycle
- Peer Controller
backend/src/controllers/peers.controller.go - Peer Lifecycle Service
backend/src/services/peers.service.go - Peer Repository
backend/src/db/peers.db.go
Gateway Network
- WireGuard Config Sync
backend/src/services - Zone Firewall Policy
backend/src/services - WireGuard Gateway
Other components
- Administrator
Connections 21
- Administrator → Login Page: signs in
frontend/app/page.tsx - Login Page → API Client: requests login
frontend/app/page.tsx - Peer Deployment → API Client: creates peer
frontend/app/(dashboard)/dashboard/deploy/page.tsx - Peer Management → API Client: loads peers
frontend/app/(dashboard)/peers/page.tsx - Peer Management → Live Stats Hook: uses live stats
frontend/app/(dashboard)/peers/page.tsx - Administrator → Peer Deployment: provisions access
- Administrator → Network Overview: reviews network
- Administrator → User Management: manages users
- HTTP Server → API Router: registers routes
backend/src/main.go - API Router → Peer Controller: routes peer requests
backend/src/routers/main.router.go - API Router → User Controller: routes user requests
backend/src/routers/main.router.go - API Router → Static Dashboard Files: serves files
backend/src/routers/main.router.go - User Controller → Account Services: authenticates accounts
backend/src/controllers/users.controller.go - User Controller → User Repository: reads users
backend/src/controllers/users.controller.go - Peer Controller → Peer Lifecycle Service: handles peer actions
backend/src/controllers/peers.controller.go - Peer Lifecycle Service → Peer Repository: stores peer records
backend/src/services/peers.service.go - Peer Lifecycle Service → WireGuard Config Sync: syncs configuration
backend/src/services/peers.service.go - WireGuard Config Sync → Peer Repository: reads active peers
README.md - WireGuard Config Sync → WireGuard Gateway: writes wg0 config
README.md - Zone Firewall Policy → WireGuard Gateway: enforces segmentation
README.md - API Client → HTTP Server: calls API
README.md