Margin Mirror on Forgejo
  • TypeScript 36.5%
  • JavaScript 23.1%
  • Go 21.8%
  • CSS 11%
  • HTML 3.1%
  • Other 4.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-28 01:08:42 -08:00
.forgejo/workflows forgejo workflows 2026-07-09 05:44:18 -08:00
.github fix build for arm 2026-05-18 05:51:14 -08:00
avatar improvemetns and stuff 2026-04-16 19:48:04 -08:00
backend Bluesky embeds, semble card improvements, and some other improvements 2026-07-27 23:43:36 -08:00
edge fix: reading room custom domain title/favicon/handle + add load more pagination 2026-07-08 12:42:34 -08:00
extension move ci_scripts next to xcodeproj for xcode cloud 2026-07-07 04:21:18 -08:00
lexicons/at/margin margin pro init 2026-07-08 09:59:32 -08:00
web gif fix and other fixes 2026-07-28 01:08:42 -08:00
.dockerignore fix dockerfile 2026-02-08 19:35:08 -09:00
.env.example margin pro init 2026-07-08 09:59:32 -08:00
.gitignore fixes 2026-07-08 10:38:15 -08:00
docker-compose.yml xcode project + fixes 2026-07-07 04:05:53 -08:00
Dockerfile fixes 2026-06-28 23:16:49 -08:00
LICENSE update license to AGPLv3 2026-04-14 23:21:40 -08:00
README.md update readme with translation stuff 2026-04-24 10:33:38 -08:00

Margin

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.

Project Structure

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

Getting Started

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.

Development

Backend

cd backend
go mod tidy
go run ./cmd/server

API server runs on http://localhost:8081

Web App

cd web
bun install
bun run dev

Dev server runs on http://localhost:4321 and proxies API requests to the backend.

Browser Extension

Built with WXT:

cd extension
bun install
bun run dev          # Chrome dev mode
bun run dev:firefox  # Firefox dev mode

Architecture

In production, a single Docker container runs both services:

  • Astro SSR (port 8080, public) — serves the web app, handles SSR for OG meta tags, generates dynamic OG images via satori, and proxies API/auth requests to the backend.
  • Go API (port 8081, internal) — handles all API endpoints, OAuth, firehose ingestion, and data storage.

Domain

Domain: margin.at Lexicon Namespace: at.margin.*

Tech Stack

  • Backend: Go + Chi + SQLite
  • Frontend: Astro 5 (SSR) + React 19 + Tailwind CSS
  • OG Images: satori + @resvg/resvg-js
  • Extension: WXT + React + Tailwind CSS
  • Protocol: AT Protocol (Bluesky)

Sponsors

Thank you for making Margin possible!

Infrastructure Sponsor

Bryan
@chaosgreml.in

GitHub Sponsors

Translations

Help translate Margin at translate.margin.at.

Translation status

License

MIT