How andyxning/shortme works
ShortMe is a Go URL-shortening service. Its principal workflow validates a submitted HTTP(S) URL, allocates a unique sequence, encodes it into a short code, stores the mapping, then serves it through expansion or a temporary redirect. The repository also provides a browser interface with QR codes and previews, plus version and health endpoints. Edges are grounded in the sampled callers or README; unsampled details of web assets and database schemas are not inferred.
Main entry points: web.go HTTP routing · short/short.go Shortening service · api/short.go Short and expand API · main.go Application startup
Components 16
Runtime and configuration
- Application startup
main.go - Configuration
conf/conf.go
Shortening and expansion
- Shortening service
short/short.go - Base conversion
base/base.go
Persistence and sequence
- URL mapping store
schema/shortme.sql - Sequence registry
sequence/sequence.go - MySQL sequence generator
sequence/db/sequence.go - Sequence store
schema/sequence.sql
HTTP and web interfaces
- HTTP routing
web/web.go - Short and expand API
web/api/short.go - Version and health
web/api/generic.go - Web page handler
web/www/www.go - Browser short/expand UI
static/js/shortme.js - Web templates
template - Static assets
static
Other components
- API or web user
Connections 18
- API or web user → HTTP routing: sends HTTP
README.md - Application startup → Configuration: loads settings
main.go - Application startup → Shortening service: starts service
main.go - Application startup → HTTP routing: starts server
main.go - HTTP routing → Short and expand API: routes requests
web/web.go - HTTP routing → Version and health: routes status
web/web.go - HTTP routing → Web page handler: routes page
web/web.go - HTTP routing → Static assets: serves assets
web/web.go - Web page handler → Web templates: renders template
web/www/www.go - Browser short/expand UI → Short and expand API: posts requests
static/js/shortme.js - Short and expand API → Shortening service: shortens or expands
web/api/short.go - Shortening service → Base conversion: encodes sequence
short/short.go - Shortening service → URL mapping store: reads and writes mappings
short/short.go - Shortening service → Sequence registry: requests sequence
short/short.go - MySQL sequence generator → Sequence registry: registers generator
sequence/db/sequence.go - MySQL sequence generator → Sequence store: allocates sequence
sequence/db/sequence.go - Short and expand API → API or web user: returns response
README.md - Configuration → Shortening service: configures behavior
short/short.go