How jerelintusalo/blog works
This is a server-rendered blog application. A visitor registers or logs in through the authentication routes; successful login stores a session identifier in SQLite and sets a cookie. On later requests, the app looks up that session, then serves the post list, accepts new posts, or renders the admin page for the admin user. Pug views provide the login, registration, post, and admin screens. The graph reflects the sampled app and auth code; the README is empty, and the separate index and users routers are not mounted in the sampled app.
Main entry points: app.js Express app · auth.js Auth routes · blog.db Blog database · database.js Database setup
Components 10
Web application
- Express app
app.js - Post list view
views/index.pug - New post view
views/new-post.pug - Admin view
views/admin.pug
Authentication
- Auth routes
routes/auth.js - Login view
views/login.pug - Register view
views/register.pug
Persistence
- Database setup
database.js - Blog database
blog.db
Other components
- Visitor
Connections 16
- Visitor → Express app: sends requests
- Express app → Auth routes: dispatches auth
- Express app → Database setup: checks session
- Database setup → Blog database: initializes tables
- Express app → Blog database: reads posts
- Express app → Blog database: inserts posts
- Auth routes → Database setup: queries users
- Auth routes → Blog database: updates users
- Auth routes → Blog database: creates users
- Express app → Post list view: renders posts
- Express app → New post view: renders form
- Express app → Admin view: renders admin
- Auth routes → Login view: renders login
- Auth routes → Register view: renders registration
- Express app → Visitor: responds
- Auth routes → Visitor: sets cookie