Gabriel20xx 0fd1805502
Lint / Lint (push) Successful in 1m29s
Security / Secrets (gitleaks) (push) Successful in 1m11s
Security / Dependencies (Trivy) (push) Successful in 1m59s
Tests / Dashboard checks (push) Successful in 1m49s
Security / Code (Semgrep) (push) Successful in 3m8s
Tests / Go backend (push) Successful in 2m50s
Docker / Docker Build & Push (push) Successful in 8m42s
build(android): upgrade toolchain and migrate Room to KSP
- Target API 37 and use build-tools 37 for release signature checks
- Adjust list pagination spacing and clarify shared backend docs
2026-11-01 21:48:05 +01:00

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_URL set — used immediately.
  • AUTHGUARD_URL unset, AUTH_DISABLED unset/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 — browser-session gates are off. List access still requires membership; the placeholder identity used in this mode has no memberships, so dashboard data is empty and sync tokens minted for it are rejected. Use this only to develop the auth shell, not for a working data deployment.

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 browser-session gates. List access remains membership-scoped; the placeholder identity has no memberships and its sync tokens are rejected. Use only for auth-shell development, not for a working data deployment.
CARRIERNODE_URL No unset Base URL of a CarrierNode instance. Bootstrap fallback only — see below; not used by any feature here yet.
SECRET Yes, unless AUTH_DISABLED=true unset Shared secret, the same value CarrierNode/ProjectConfigurator were configured with, checked against X-Internal-Auth on PUT /api/core-services/internal and PUT /api/auth/access/internal. Without it, GET /api/auth/status reports SECRET environment variable is not set. and every auth-gated route returns 500, and the internal endpoints refuse every caller.
ALLOWED_ORIGINS No unset Comma-separated browser origins that may call the API cross-origin with credentials. Leave unset: the dashboard is same-origin and needs no CORS.
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. It marks only the cookies CollabTable clears on logout as Secure; the session cookie's Secure, SameSite and Domain attributes are set by AuthGuard.
TRUSTED_PROXIES No unset Comma-separated IPs or CIDR ranges of reverse proxies. X-Forwarded-For (client IP for rate limits) and X-Forwarded-Proto are read only from these peers.
PRODUCTION No false Set true to refuse plain HTTP: requests must arrive over TLS or through a TRUSTED_PROXIES proxy sending X-Forwarded-Proto: https. Requires TRUSTED_PROXIES. With false, the server logs a warning that TLS is off.
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" \
  -e SECRET="<long-random-shared-secret>" \
  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 ./...
# The handler and sync tests need a disposable PostgreSQL and are skipped without one.
# Never point this at your real DATABASE_URL: each test creates and drops its own schema.
TEST_DATABASE_URL='postgres://postgres:postgres@localhost:5432/collabtable_test?sslmode=disable' go test ./...

cd ../frontend
npm test
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/arm64 on main, linux/amd64 otherwise) from docker/Dockerfile and pushes ${DOCKERHUB_USERNAME}/collabtableserver to Docker Hub on pushes to main, tagged by branch name, sha-<short-sha>, and latest.
  • lint.yml — runs npm run lint (ESLint) against frontend.
  • tests.yml — runs go test ./... against backend (with a PostgreSQL service container, so the database-backed tests run) and npm test and npm run check against frontend.

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
S
Description
A collaborative list management system with Android app and server for creating and managing shared lists with custom fields and items.
Readme
19 MiB
0 Stars 1 Watchers 0 Forks
Languages
Go 37.5%
Kotlin 20.6%
Python 12.6%
JavaScript 9.9%
Java 7%
Other 12.4%