Backend API server, WebSocket relay, and update service for CoLink.
Tech stack: Go 1.24 · Gin · GORM · PostgreSQL 16 · Gorilla WebSocket · golang-jwt · Docker
docker compose -f docker-compose.dev.yml up -d --buildThe server container serves the production console. For frontend development, run the Vite development server from another terminal:
pnpm --dir web/console install --frozen-lockfile
pnpm --dir web/console devTo use a specific .env file:
docker compose --env-file .env -f docker-compose.dev.yml up -d --buildNote: when the same variable exists in both the terminal environment and the .env file, the terminal value takes precedence. Use --env-file to force file values.
# Get a Github token at https://github.com/settings/personal-access-tokens, remember to enable the read:packages permission for this token
# `docker login ghcr.io` via this token
mkdir -p colink-server/deploy/nginx
cd colink-server
curl -fsSLO https://raw.githubusercontent.com/CoLinkDev/colink-server/master/.env.example
curl -fsSLO https://raw.githubusercontent.com/CoLinkDev/colink-server/master/docker-compose.yml
curl -fsSLo deploy/nginx/default.conf https://raw.githubusercontent.com/CoLinkDev/colink-server/master/deploy/nginx/default.conf
cp .env.example .env
# Edit .env and fill in required variables
docker compose pull
docker compose up -dThe Docker image builds the Vue console from web/console and embeds its dist
output into the server binary.
See .env.example. CoLink binaries read COLINK_* variables directly, and Docker Compose passes the same names into containers.
| Service | Responsibility |
|---|---|
nginx |
Public entrypoint and path routing |
server |
Auth, account, device API, WebSocket tickets, WebSocket relay, frontend fallback |
update |
GitHub release checks, cached update metadata, update asset downloads |
postgres |
PostgreSQL storage |
The server does not persist messages, files, or clipboard content — it only relays WebSocket frames between authenticated devices belonging to the same user.