How alejoheu/blogg-prosjekt works
This is a small Go blog: visitors browse recent articles, open an article, or submit a new one; article data is read from and written to PostgreSQL, and submitted content is sanitized. The server also exposes a post form, a rudimentary login handler, and static files. The README is empty, and the source excerpt is limited; notably, the login handler requests a template not present in the tree, and POST /login is only a stub.
Main entry points: main.go HTTP server and routes · auth.go Login handler · templates HTML templates · vars.go Article data types
Components 8
Web application
- HTTP server and routes
main.go - Login handler
auth.go
Article content
- Article data types
vars.go - HTML sanitizer
main.go
Views and assets
- HTML templates
templates - Static files
static
Other components
- Visitor
- PostgreSQL
Connections 11
- Visitor → HTTP server and routes: sends requests
- HTTP server and routes → PostgreSQL: queries articles
- PostgreSQL → HTTP server and routes: returns rows
- HTTP server and routes → Article data types: maps article data
- HTTP server and routes → HTML templates: renders pages
- HTTP server and routes → HTML sanitizer: sanitizes submissions
- HTTP server and routes → PostgreSQL: inserts articles
- HTTP server and routes → Visitor: redirects after submit
- HTTP server and routes → Login handler: dispatches login
- Login handler → HTML templates: renders login page
- HTTP server and routes → Static files: serves files