How noah20102021/ownrss works
Purpose and entry points
This is a server-rendered Node.js application with authentication and an authenticated dashboard. The Express application is assembled in app.js and launched through the conventional HTTP bootstrap at bin/www. Route modules provide public, user, and dashboard endpoints.
Paths: app.js, bin/www, routes/index.js
HTTP application composition
app.js is the central composition boundary: it configures Express middleware, serves public assets, registers route modules, and renders errors. Request handling is split by route domain rather than a single controller layer.
Paths: app.js, routes/users.js, routes/dashboard.js
Authentication and access control
Authentication is defined separately from the HTTP app in auth.js, likely using Better Auth based on the database migration naming. Protected request paths pass through middleware/requireAuth.js, which is the authorization boundary before dashboard behavior runs. Browser-side auth interactions are supported by dedicated public JavaScript.
Paths: auth.js, middleware/requireAuth.js, public/js/auth-client.js
Dashboard flow
The primary protected flow is: browser request → authentication middleware → dashboard router → EJS dashboard rendering. The dashboard is therefore server-rendered and can rely on request/session identity established before route execution.
Paths: routes/dashboard.js, middleware/requireAuth.js, views/dashboard.ejs
Persistence and identity schema
Prisma owns the persistence schema and migration history. Development uses a local SQLite database, while migrations establish both initial application data structures and Better Auth-related tables. Database access and auth identity are coupled at the Prisma schema/migration boundary.
Paths: prisma/schema.prisma, prisma/migrations/20260712143755_add_better_auth/migration.sql, prisma/dev.db
Presentation and client assets
Views are EJS templates rendered by Express. Static CSS, fonts, images, favicon resources, and limited client JavaScript are delivered from public/. Styling includes a PostCSS input/output pipeline, but the deployed application consumes the generated static CSS.
Paths: views/index.ejs, views/error.ejs, public/css/output.css
Runtime and operational dependencies
The material runtime is Node.js/Express with an HTTP server created by bin/www; Prisma supplies database schema management and data access; Better Auth is the external authentication framework indicated by the auth module and migrations. A user-provisioning script supports operational/bootstrap workflows outside normal HTTP requests.
Paths: package.json, scripts/create-user.js, prisma/migrations/migration_lock.toml
Main entry points: app.js Express app · auth.js Auth service · requireAuth.js Require auth · schema.prisma Prisma schema
Components 16
HTTP runtime
- HTTP bootstrap
bin/www - Express app · Configures middleware, static assets, routes, and errors.
app.js - Public routes
routes/index.js - User routes
routes/users.js - Dashboard routes
routes/dashboard.js - Runtime dependencies · Declares Express, Prisma, and authentication dependencies.
package.json
Authentication
- Auth service
auth.js - Require auth · Authorization boundary for protected requests.
middleware/requireAuth.js - Auth client JS
public/js/auth-client.js - User provisioning · Creates users outside normal HTTP requests.
scripts/create-user.js
Presentation
- EJS views · Includes public, dashboard, and error rendering.
views/index.ejs - Generated CSS
public/css/output.css
Persistence
- Prisma schema · Defines application and authentication identity persistence.
prisma/schema.prisma - Auth migration · Establishes Better Auth-related tables.
prisma/migrations/20260712143755_add_better_auth/migration.sql - Development SQLite
prisma/dev.db
Other components
- Browser
Connections 19
- Browser → HTTP bootstrap: HTTP requests
- HTTP bootstrap → Express app: starts
- Express app → Public routes: mounts
- Express app → User routes: mounts
- Express app → Require auth: applies to protected paths
- Require auth → Dashboard routes: authorizes
- Dashboard routes → EJS views: renders dashboard
- Public routes → EJS views: renders public pages
- Express app → EJS views: renders errors
- Express app → Generated CSS: serves
- Browser → Auth client JS: loads
- Auth client JS → Auth service: auth interactions
- Require auth → Auth service: validates identity
- Auth service → Prisma schema: uses identity model
- Prisma schema → Auth migration: evolves through
- Auth migration → Development SQLite: applies to
- User provisioning → Auth service: provisions through
- Runtime dependencies → Express app: supplies runtime
- Runtime dependencies → Prisma schema: supplies Prisma