Write in the margins of the web
A web annotation layer built on AT Protocol that lets you annotate, highlight, and bookmark any URL on the internet.
margin/
├── lexicons/ # AT Protocol lexicon schemas
│ └── at/margin/
│ ├── annotation.json
│ ├── bookmark.json
│ ├── collection.json
│ ├── collectionItem.json
│ ├── highlight.json
│ ├── like.json
│ ├── reply.json
│ ├── apikey.json
│ ├── preferences.json
│ └── profile.json
├── backend/ # Go API server
│ ├── cmd/server/
│ └── internal/
├── web/ # Astro SSR + React web app
│ └── src/
├── extension/ # Browser extension (WXT)
│ └── src/
└── avatar/ # Cloudflare Worker for avatar proxying
Run the full stack with Docker:
docker compose up -d --build
This builds both the Go backend and the Astro frontend into a single container. The Astro SSR server handles all frontend routing, static assets, and OG image generation, while the Go backend serves the API internally.
cd backend
go mod tidy
go run ./cmd/server
API server runs on http://localhost:8081
cd web
bun install
bun run dev
Dev server runs on http://localhost:4321 and proxies API requests to the backend.
Built with WXT:
cd extension
bun install
bun run dev # Chrome dev mode
bun run dev:firefox # Firefox dev mode
In production, a single Docker container runs both services:
Domain: margin.at
Lexicon Namespace: at.margin.*
Thank you for making Margin possible!
Bryan
@chaosgreml.in
Help translate Margin at translate.margin.at.
MIT