# noah20102021/ownrss architecture

> Architecture diagram of the GitHub repository noah20102021/ownrss, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/noah20102021/ownrss
- Repository: https://github.com/noah20102021/ownrss

## Overview

#### 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`](https://github.com/noah20102021/ownrss/blob/master/app.js) (Express app), [`auth.js`](https://github.com/noah20102021/ownrss/blob/master/auth.js) (Auth service), [`middleware/requireAuth.js`](https://github.com/noah20102021/ownrss/blob/master/middleware/requireAuth.js) (Require auth), [`prisma/schema.prisma`](https://github.com/noah20102021/ownrss/blob/master/prisma/schema.prisma) (Prisma schema)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["HTTP runtime"]
  node_bootstrap["HTTP bootstrap<br/>Node entry point"]
  node_app["Express app<br/>composition root<br/>[app.js]"]
  node_public_routes["Public routes<br/>Express router<br/>[index.js]"]
  node_user_routes["User routes<br/>Express router<br/>[users.js]"]
  node_dashboard_routes["Dashboard routes<br/>protected router<br/>[dashboard.js]"]
  node_package["Runtime dependencies<br/>Node package manifest<br/>[package.json]"]
end

subgraph group_auth["Authentication"]
  node_auth_config{{"Auth service<br/>Better Auth integration<br/>[auth.js]"}}
  node_require_auth["Require auth<br/>Express middleware<br/>[requireAuth.js]"]
  node_auth_client["Auth client JS<br/>browser auth client<br/>[auth-client.js]"]
  node_create_user["User provisioning<br/>operational script<br/>[create-user.js]"]
end

subgraph group_presentation["Presentation"]
  node_views["EJS views<br/>server templates<br/>[index.ejs]"]
  node_static_css["Generated CSS<br/>static asset<br/>[output.css]"]
end

subgraph group_persistence["Persistence"]
  node_prisma_schema["Prisma schema<br/>data model<br/>[schema.prisma]"]
  node_auth_migration["Auth migration<br/>Prisma migration<br/>[migration.sql]"]
  node_sqlite_db[("Development SQLite<br/>database<br/>[dev.db]")]
end

node_browser(("Browser<br/>client"))

node_browser -->|"HTTP requests"| node_bootstrap
node_bootstrap -->|"starts"| node_app
node_app -->|"mounts"| node_public_routes
node_app -->|"mounts"| node_user_routes
node_app -->|"applies to protected paths"| node_require_auth
node_require_auth -->|"authorizes"| node_dashboard_routes
node_dashboard_routes -->|"renders dashboard"| node_views
node_public_routes -->|"renders public pages"| node_views
node_app -->|"renders errors"| node_views
node_app -->|"serves"| node_static_css
node_browser -->|"loads"| node_auth_client
node_auth_client -->|"auth interactions"| node_auth_config
node_require_auth -->|"validates identity"| node_auth_config
node_auth_config -->|"uses identity model"| node_prisma_schema
node_prisma_schema -.->|"evolves through"| node_auth_migration
node_auth_migration -->|"applies to"| node_sqlite_db
node_create_user -->|"provisions through"| node_auth_config
node_package -.->|"supplies runtime"| node_app
node_package -.->|"supplies Prisma"| node_prisma_schema

click node_bootstrap "https://github.com/noah20102021/ownrss/tree/master/bin/www"
click node_app "https://github.com/noah20102021/ownrss/blob/master/app.js"
click node_public_routes "https://github.com/noah20102021/ownrss/blob/master/routes/index.js"
click node_user_routes "https://github.com/noah20102021/ownrss/blob/master/routes/users.js"
click node_dashboard_routes "https://github.com/noah20102021/ownrss/blob/master/routes/dashboard.js"
click node_auth_config "https://github.com/noah20102021/ownrss/blob/master/auth.js"
click node_require_auth "https://github.com/noah20102021/ownrss/blob/master/middleware/requireAuth.js"
click node_auth_client "https://github.com/noah20102021/ownrss/blob/master/public/js/auth-client.js"
click node_views "https://github.com/noah20102021/ownrss/blob/master/views/index.ejs"
click node_static_css "https://github.com/noah20102021/ownrss/blob/master/public/css/output.css"
click node_prisma_schema "https://github.com/noah20102021/ownrss/blob/master/prisma/schema.prisma"
click node_auth_migration "https://github.com/noah20102021/ownrss/blob/master/prisma/migrations/20260712143755_add_better_auth/migration.sql"
click node_sqlite_db "https://github.com/noah20102021/ownrss/blob/master/prisma/dev.db"
click node_create_user "https://github.com/noah20102021/ownrss/blob/master/scripts/create-user.js"
click node_package "https://github.com/noah20102021/ownrss/blob/master/package.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_bootstrap,node_app,node_public_routes,node_user_routes,node_dashboard_routes,node_package toneBlue
class node_auth_config,node_require_auth,node_auth_client,node_create_user toneAmber
class node_views,node_static_css toneMint
class node_prisma_schema,node_auth_migration,node_sqlite_db toneRose
class node_browser toneNeutral
```

## Components

### HTTP runtime

- [HTTP bootstrap](https://github.com/noah20102021/ownrss/tree/master/bin/www): Node entry point · `bin/www`
- [Express app](https://github.com/noah20102021/ownrss/blob/master/app.js): composition root · Configures middleware, static assets, routes, and errors. · `app.js`
- [Public routes](https://github.com/noah20102021/ownrss/blob/master/routes/index.js): Express router · `routes/index.js`
- [User routes](https://github.com/noah20102021/ownrss/blob/master/routes/users.js): Express router · `routes/users.js`
- [Dashboard routes](https://github.com/noah20102021/ownrss/blob/master/routes/dashboard.js): protected router · `routes/dashboard.js`
- [Runtime dependencies](https://github.com/noah20102021/ownrss/blob/master/package.json): Node package manifest · Declares Express, Prisma, and authentication dependencies. · `package.json`

### Authentication

- [Auth service](https://github.com/noah20102021/ownrss/blob/master/auth.js): Better Auth integration · `auth.js`
- [Require auth](https://github.com/noah20102021/ownrss/blob/master/middleware/requireAuth.js): Express middleware · Authorization boundary for protected requests. · `middleware/requireAuth.js`
- [Auth client JS](https://github.com/noah20102021/ownrss/blob/master/public/js/auth-client.js): browser auth client · `public/js/auth-client.js`
- [User provisioning](https://github.com/noah20102021/ownrss/blob/master/scripts/create-user.js): operational script · Creates users outside normal HTTP requests. · `scripts/create-user.js`

### Presentation

- [EJS views](https://github.com/noah20102021/ownrss/blob/master/views/index.ejs): server templates · Includes public, dashboard, and error rendering. · `views/index.ejs`
- [Generated CSS](https://github.com/noah20102021/ownrss/blob/master/public/css/output.css): static asset · `public/css/output.css`

### Persistence

- [Prisma schema](https://github.com/noah20102021/ownrss/blob/master/prisma/schema.prisma): data model · Defines application and authentication identity persistence. · `prisma/schema.prisma`
- [Auth migration](https://github.com/noah20102021/ownrss/blob/master/prisma/migrations/20260712143755_add_better_auth/migration.sql): Prisma migration · Establishes Better Auth-related tables. · `prisma/migrations/20260712143755_add_better_auth/migration.sql`
- [Development SQLite](https://github.com/noah20102021/ownrss/blob/master/prisma/dev.db): database · `prisma/dev.db`

### Other components

- **Browser**: client

## Connections

- 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
