Phase 1 MVP: gateway, CRUD handlers, frontend components

Backend:
- WebSocket gateway (hub, client, events) with fanout broadcast
- Server CRUD handlers (create, list, get, update, delete)
- Channel CRUD handlers (create, list, get, update, delete)
- Message CRUD handlers (list with cursor pagination, create, update, delete)
- cmd/migrate standalone migration CLI (up/down)
- cmd/server wired to all handlers + WebSocket + static file serving

Frontend:
- Zustand stores: auth, server, channel, message, websocket
- API client with fetch wrapper
- Terminal-styled components: Layout, LoginForm, ChatArea, ChannelList, ServerBar, MemberList
- React Router with login and main routes
- Gruvbox dark palette throughout

Ops:
- Docker Compose with app service (multi-stage build)
- Caddyfile with WebSocket upgrade support
- Makefile for common tasks
This commit is contained in:
2026-06-26 14:47:29 -04:00
parent aa7854aee2
commit bb5a56816b
32 changed files with 2310 additions and 339 deletions
+9 -2
View File
@@ -3,18 +3,25 @@
}
:80 {
# API routes
handle_path /api/* {
reverse_proxy app:8080
}
handle_path /ws {
reverse_proxy app:8080
# WebSocket gateway
handle /ws {
reverse_proxy app:8080 {
header_up Connection {>Connection}
header_up Upgrade {>Upgrade}
}
}
# LiveKit (if proxied)
handle_path /livekit/* {
reverse_proxy livekit:7880
}
# SPA fallback - serve index.html for all other routes
handle {
root * /srv/web
try_files {path} /index.html
+3 -2
View File
@@ -2,13 +2,14 @@ FROM golang:1.24-alpine AS go-builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
COPY cmd/ cmd/
COPY internal/ internal/
RUN CGO_ENABLED=0 GOOS=linux go build -o /bin/dumpster-server ./cmd/server
FROM node:22-alpine AS web-builder
WORKDIR /app
COPY web/package.json web/package-lock.json ./
RUN npm ci
RUN npm ci --include=dev
COPY web/ .
RUN npm run build
+30 -12
View File
@@ -1,6 +1,26 @@
version: '3.8'
services:
app:
build:
context: ..
dockerfile: docker/Dockerfile
container_name: dumpster-app
env_file:
- ../.env
environment:
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
VALKEY_URL: redis://valkey:6379
MINIO_ENDPOINT: minio:9000
ports:
- "8080:8080"
depends_on:
postgres:
condition: service_healthy
valkey:
condition: service_healthy
postgres:
image: postgres:16
container_name: dumpster-postgres
@@ -13,7 +33,7 @@ services:
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-dumpster} -d ${POSTGRES_DB:-dumpster}"]
interval: 5s
timeout: 5s
retries: 5
@@ -47,8 +67,7 @@ services:
livekit:
image: livekit/livekit-server:latest
container_name: dumpster-livekit
command: >
--config /etc/livekit.yaml
command: --config /etc/livekit.yaml
ports:
- "7880:7880"
- "7881:7881"
@@ -57,19 +76,18 @@ services:
volumes:
- ./livekit.yaml:/etc/livekit.yaml:ro
environment:
LIVEKIT_KEYS: "${LIVEKIT_API_KEY}:${LIVEKIT_API_SECRET}"
depends_on:
- coturn
LIVEKIT_KEYS: "${LIVEKIT_API_KEY:-devkey}:${LIVEKIT_API_SECRET:-secret}"
coturn:
image: coturn/coturn:latest
container_name: dumpster-coturn
command: >
-n --log-file=stdout
--external-ip=$$(detect-external-ip)
--min-port=10000 --max-port=20000
--realm=${DUMPSTER_HOST:-localhost}
--user=${LIVEKIT_API_KEY}:${LIVEKIT_API_SECRET}
command:
- "-n"
- "--log-file=stdout"
- "--min-port=10000"
- "--max-port=20000"
- "--realm=${DUMPSTER_HOST:-localhost}"
- "--user=${LIVEKIT_API_KEY:-devkey}:${LIVEKIT_API_SECRET:-secret}"
ports:
- "3478:3478/tcp"
- "3478:3478/udp"