How prashantrahul141/taurl works
Taurl is a Go URL-shortening service. Users submit a URL through the API, which validates it and asks the database manager to create or retrieve a short link; they can then resolve links through lookup endpoints or browser redirects. The manager uses an in-memory cache and SQLite, with FNV-based IDs. The README documents API behavior, while the sampled code shows route registration and handlers. Static assets and template contents were not sampled, so their internal behavior is not inferred.
Main entry points: app.go App setup · db.go URL manager · pages.go Page handlers · main.go Program entry
Components 12
Startup and routing
- Program entry
main.go - Environment config
app/config.go - App setup
app/app.go
Web and API
- Page handlers
app/pages.go - API handlers
app/api.go - HTML templates
assets/templates/index.tmpl - Static assets
assets/static/index.js
Link resolution
- URL manager
app/db.go - Short ID generation
app/utils.go
Persistence
- In-memory cache
app/db.go - SQLite URL store
app/db.go
Other components
- Browser or API client
Connections 13
- Browser or API client → App setup: sends requests
README.md - Program entry → Environment config: loads config
main.go - Program entry → App setup: starts app
main.go - App setup → Page handlers: registers routes
app/app.go - App setup → API handlers: registers routes
app/app.go - App setup → HTML templates: loads templates
app/app.go - App setup → Static assets: serves assets
app/app.go - Page handlers → HTML templates: renders pages
app/pages.go - Page handlers → URL manager: looks up links
app/pages.go - API handlers → URL manager: looks up or creates
app/api.go - URL manager → In-memory cache: checks and updates
app/db.go - URL manager → SQLite URL store: queries and stores
app/db.go - URL manager → Short ID generation: generates short ID
app/db.go