How sm-joe/linkforge works
LinkForge is a self-hosted URL shortener: users create and manage validated short links in the web dashboard, then follow redirects and inspect QR codes, click analytics, and destination-health history. The Go API owns these workflows and persists link, click, and health data in SQLite; destination validation is a separate Go package. Arrows below follow sampled calls or explicit README/API documentation. Several handlers and storage modules were not excerpted, so their internal wiring is represented only where documented.
Main entry points: main.go Go HTTP API · service.go Link service · api.ts API client · page.tsx Home page
Components 23
Web dashboard
- Home page
apps/web/app/page.tsx - Create form
apps/web/components/links/CreateLinkForm.tsx - Links dashboard
apps/web/components/links/Dashboard.tsx - Link card
apps/web/components/links/LinkCard.tsx - API client
apps/web/lib/api.ts
API workflows
- Go HTTP API
apps/api/cmd/server/main.go - Link endpoints
apps/api/internal/http/link_handler.go - Link management
apps/api/internal/http/link_management_handler.go - Click analytics
apps/api/internal/http/analytics_handler.go - QR endpoint
apps/api/internal/http/qr_handler.go - Redirect endpoint
apps/api/internal/http/redirect_handler.go - Health endpoints
apps/api/internal/http/health_handler.go - Health history
apps/api/internal/http/health_history_handler.go
Link domain
- Link service
apps/api/internal/link/service.go - Health service
apps/api/internal/link/health_service.go - Safe health client
apps/api/internal/link/health_client.go
SQLite state
- SQLite link repository
apps/api/internal/link/sqlite_repository.go - Click records
apps/api/internal/link/click_repository.go - Health records
apps/api/internal/link/health_repository.go - SQLite database
apps/api/internal/link/database.go
Destination safety
- URL and IP validation
packages/url-validation/validator.go
Other components
- Browser
- Destination host
Connections 32
- Browser → Home page: opens dashboard
README.md - Home page → Create form: renders
apps/web/app/page.tsx - Home page → Links dashboard: renders
apps/web/app/page.tsx - Create form → API client: creates link
apps/web/components/links/CreateLinkForm.tsx - Links dashboard → API client: lists links
apps/web/components/links/Dashboard.tsx - Links dashboard → Link card: renders
apps/web/components/links/Dashboard.tsx - Link card → API client: manages link
apps/web/components/links/LinkCard.tsx - API client → Go HTTP API: HTTP requests
README.md - Go HTTP API → Link endpoints: routes link requests
apps/api/cmd/server/main.go - Go HTTP API → Link management: routes management
apps/api/cmd/server/main.go - Go HTTP API → Click analytics: routes analytics
apps/api/cmd/server/main.go - Go HTTP API → QR endpoint: routes QR
apps/api/cmd/server/main.go - Go HTTP API → Redirect endpoint: routes short codes
apps/api/cmd/server/main.go - Go HTTP API → Health endpoints: routes health
apps/api/cmd/server/main.go - Go HTTP API → Health history: routes history
apps/api/cmd/server/main.go - Link endpoints → Link service: delegates
- Link management → Link service: calls
apps/api/internal/http/link_management_handler.go - Click analytics → Click records: reads analytics
- Redirect endpoint → Click records: records clicks
- Health endpoints → Health service: runs checks
- Health endpoints → Link service: gets link
- Health history → Health records: reads history
- Link service → URL and IP validation: validates destination
apps/api/internal/link/service.go - Link service → SQLite link repository: persists links
- Health service → Safe health client: checks destination
- Health service → Health records: stores checks
- Safe health client → URL and IP validation: validates host
apps/api/internal/link/health_client.go - Safe health client → Destination host: requests health
apps/api/internal/link/health_client.go - SQLite link repository → SQLite database: reads and writes
- Click records → SQLite database: reads and writes
apps/api/internal/link/click_repository.go - Health records → SQLite database: reads and writes
- URL and IP validation → Destination host: resolves host
README.md