8.5 KiB
CollabTable
CollabTable is a collaborative list/table system: a Go server holding lists with custom-typed, ordered columns (fields) and rows (items), a SvelteKit web dashboard for browsing that data, and a native Android app (Jetpack Compose, offline-first with Room) that syncs against the server's HTTP API. It's built for things like shopping lists with price tracking, product catalogs, or any structured data collection that several people and devices need to keep in sync.
Tech Stack
| Layer | Technology |
|---|---|
| Database | PostgreSQL |
| Backend | Go (net/http) |
| Web dashboard | SvelteKit (static SPA, embedded in the Go binary) |
| Android app | Kotlin, Jetpack Compose, Room, Retrofit/OkHttp |
| Container | Docker (single image, no Compose) |
Repository Layout
backend/ Go backend: lists/fields/items/sync/notifications, auth, embedded dashboard
frontend/ SvelteKit dashboard (static SPA, read-only viewer, embedded by the backend build)
CollabTableAndroid/ Native Android client (Kotlin, Jetpack Compose, Room, Retrofit)
docker/ Single multi-stage Dockerfile
shared/ Design system and backend helpers shared with sibling projects
Configuration
CollabTable's browser dashboard authenticates through AuthGuard, a centralized identity service shared across projects (AUTHGUARD_URL): create a username, email, and password on first launch, then sign in with the username or email. AuthGuard hashes passwords and issues the auth_session cookie the browser holds; CollabTable itself stores no account credentials, only a small local flag recording that its one-time setup screen has run. Unlike the single-admin-tool projects in this workspace, CollabTable is a genuinely multi-user app that already supported full admin user management (list/create/edit/delete accounts, assign roles) before this integration — that maps directly onto AuthGuard's own /api/admin/users endpoints, which CollabTable proxies to rather than re-implementing the same authorization rules locally.
AuthGuard integration has three states:
AUTHGUARD_URLset — used immediately.AUTHGUARD_URLunset,AUTH_DISABLEDunset/false (the default) — "pending": auth stays fully enabled/gated, waiting for ProjectConfigurator to push a live URL (see below), and fails closed on auth calls until one arrives.AUTH_DISABLED=true— authentication is fully off (no login screen, nothing gated, every request treated as authenticated) — only use this for local development or a deployment you are certain does not need access control.
Because AuthGuard doesn't know "this is CollabTable's initial account" and can't answer "have any accounts been registered yet" (it's a shared identity store other projects and other CollabTable instances may already use), the one-time setup screen is instead gated by a small local flag in Postgres, independent of AuthGuard's own state.
AUTHGUARD_URL and CARRIERNODE_URL are also only the bootstrap fallback: once CollabTable is registered in ProjectConfigurator's Projects workspace, ProjectConfigurator pushes both values here automatically (PUT /api/core-services/internal, X-Internal-Auth-gated with SECRET) and keeps them current with no restart — see Core/ProjectConfigurator/README.md's "Pushing core service info to other projects". This means AUTHGUARD_URL no longer needs to be set at all for a registered deployment: it stays "pending" until the first push. A push never overrides AUTH_DISABLED=true; it only ever retargets an already-enabled AuthGuard connection. CarrierNode isn't used by any feature here yet, but the client is wired and ready.
The device-sync API token (generated from the dashboard's Settings page, used by the Android app's Authorization: Bearer header for /api/lists, /api/fields, /api/items, /api/sync, and notification polling) is unrelated to AuthGuard and unaffected by whether it's configured: it's a long-lived per-account credential for a user's own devices, not a browser session, and stays entirely local to CollabTable's own Postgres.
| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL |
Yes | — | PostgreSQL connection string (bring your own instance) |
AUTHGUARD_URL |
No | unset (pending) | Optional bootstrap/override base URL of the AuthGuard identity service. Leaving it unset does not disable authentication — it leaves the service "pending" until ProjectConfigurator pushes a URL, failing closed on auth calls until then. Use AUTH_DISABLED to actually turn auth off. |
AUTH_DISABLED |
No | false |
Set true to disable authentication entirely (no login screen, nothing gated, every request treated as authenticated) — for local development or a standalone deployment with no AuthGuard integration at all. |
CARRIERNODE_URL |
No | unset | Base URL of a CarrierNode instance. Bootstrap fallback only — see below; not used by any feature here yet. |
SECRET |
No | unset (push endpoint refuses every caller) | Shared secret, the same value CarrierNode/ProjectConfigurator were configured with, checked against X-Internal-Auth on PUT /api/core-services/internal. |
PORT |
No | 8080 |
HTTP listen port |
APP_VERSION |
No | dev |
Version label shown on the dashboard's About page |
COOKIE_SECURE |
No | false |
Set true once served over HTTPS, to mark cookies Secure |
DB_INIT_RETRY_INTERVAL_MS |
No | 5000 |
Delay between database-connection retry attempts at startup |
DB_INIT_RETRY_MAX_ATTEMPTS |
No | 0 (retry forever) |
Max database-connection retry attempts at startup |
SYNC_MAX_FUTURE_SKEW_MS |
No | 0 |
Client clock skew tolerated in sync timestamps, to avoid re-sending future-dated rows in hot loops |
NOTIF_RETENTION_MS |
No | 604800000 (7 days) |
How long sync notifications are retained before cleanup |
Quick Start
Requires an existing PostgreSQL instance reachable from the container.
docker build -t collabtable:local -f docker/Dockerfile .
docker run -d \
--name collabtable \
--restart unless-stopped \
-p 8080:8080 \
-e DATABASE_URL="postgresql://user:password@host:5432/collabtable" \
-e AUTHGUARD_URL="https://auth.example.com" \
collabtable:local
Open http://<host>:8080, complete setup (this registers the first account against AuthGuard), then generate a device-sync API token from the dashboard's Settings page for the Android app.
Development
Prerequisites: Go 1.26+, Node.js 22+, a local PostgreSQL instance. For Android development: Android Studio, Android SDK 26+, JDK 21.
Backend
cd backend
DATABASE_URL="postgresql://user:password@localhost:5432/collabtable" go run .
# Add AUTHGUARD_URL="http://localhost:8081" to authenticate against a local
# AuthGuard instance, or AUTH_DISABLED=true to run with authentication
# disabled entirely.
Frontend
The shared @gabriel20xx/web-ui package must be built once before the dashboard can resolve it (it's a file: dependency resolved from its built dist/ output, which is intentionally not committed — see shared/README.md):
cd shared
npm install
cd ../frontend
npm install
npm run dev # Vite dev server on :5173
Other frontend scripts: npm run build, npm run format.
Android
Open CollabTableAndroid in Android Studio, let Gradle sync, and run on an emulator or device. In the app's Settings, point it at the backend (http://10.0.2.2:8080/api/ for an emulator) with the API token generated from the dashboard.
Testing
cd backend
go test ./...
cd ../frontend
npm run check
npm run lint
Android: ./gradlew build, ./gradlew ktlintCheck, ./gradlew detekt from CollabTableAndroid.
CI/CD
Every push runs three GitHub Actions workflows against the backend and frontend (the Android app has no CI in this repo):
docker.yml— builds a multi-arch image (linux/amd64+linux/arm64onmain,linux/amd64otherwise) fromdocker/Dockerfileand pushes${DOCKERHUB_USERNAME}/collabtableserverto Docker Hub on pushes tomain, tagged by branch name,sha-<short-sha>, andlatest.lint.yml— runsnpm run lint(ESLint) againstfrontend.tests.yml— runsgo test ./...againstbackendandnpm run checkagainstfrontend.
Required secrets / variables in your GitHub repository settings:
| Type | Name | Value |
|---|---|---|
| Variable | DOCKERHUB_USERNAME |
Your Docker Hub username |
| Secret | DOCKERHUB_TOKEN |
Docker Hub access token |