# mahdiiwm1/piplineproject architecture

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

- Interactive diagram: https://gitdiagram.com/mahdiiwm1/piplineproject
- Repository: https://github.com/mahdiiwm1/piplineproject

## Overview

This is a small Express/SQLite blog with account registration and login, cookie-backed sessions, post creation and listing, and an admin-only page. The main workflow routes requests through app.js, which loads a user from the session cookie and serves blog views; authentication routes handle account operations. The README only identifies a pipeline test project and documents no further product capabilities. The graph reflects shown source; separate route modules and templates not demonstrated as wired into the app are omitted.

Main entry points: [`Blog/app.js`](https://github.com/mahdiiwm1/piplineproject/blob/main/Blog/app.js) (Request handlers), [`Blog/routes/auth.js`](https://github.com/mahdiiwm1/piplineproject/blob/main/Blog/routes/auth.js) (Auth routes), [`Blog/routes/authUtils.js`](https://github.com/mahdiiwm1/piplineproject/blob/main/Blog/routes/authUtils.js) (Auth utilities), [`Blog/routes/roles.js`](https://github.com/mahdiiwm1/piplineproject/blob/main/Blog/routes/roles.js) (User roles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Request handlers<br/>[app.js]"]
end

subgraph group_identity["Identity and access"]
  node_auth["Auth routes<br/>[auth.js]"]
  node_auth_utils["Auth utilities<br/>[authUtils.js]"]
  node_roles["User roles<br/>[roles.js]"]
end

subgraph group_content["Blog content"]
  node_db[("SQLite database<br/>[database.js]")]
  node_views["Blog views"]
end

node_visitor(("Visitor"))

node_visitor -->|"sends requests"| node_app
node_app -->|"loads session; reads posts; inserts posts"| node_db
node_app -->|"mounts routes"| node_auth
node_app -->|"checks admin role"| node_roles
node_app -->|"logs denied access"| node_auth_utils
node_app -->|"renders pages"| node_views
node_auth -->|"reads and updates accounts"| node_db
node_auth -->|"validates; creates sessions; logs"| node_auth_utils
node_auth -->|"creates users"| node_roles
node_auth -->|"renders login and registration"| node_views
node_auth_utils -->|"creates user"| node_roles

click node_app "https://github.com/mahdiiwm1/piplineproject/blob/main/Blog/app.js"
click node_auth "https://github.com/mahdiiwm1/piplineproject/blob/main/Blog/routes/auth.js"
click node_auth_utils "https://github.com/mahdiiwm1/piplineproject/blob/main/Blog/routes/authUtils.js"
click node_roles "https://github.com/mahdiiwm1/piplineproject/blob/main/Blog/routes/roles.js"
click node_db "https://github.com/mahdiiwm1/piplineproject/blob/main/Blog/database.js"
click node_views "https://github.com/mahdiiwm1/piplineproject/tree/main/Blog/views"

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_app toneBlue
class node_auth,node_auth_utils,node_roles toneAmber
class node_db,node_views toneMint
class node_visitor toneIndigo
```

## Components

### Web application

- [Request handlers](https://github.com/mahdiiwm1/piplineproject/blob/main/Blog/app.js): `Blog/app.js`

### Identity and access

- [Auth routes](https://github.com/mahdiiwm1/piplineproject/blob/main/Blog/routes/auth.js): `Blog/routes/auth.js`
- [Auth utilities](https://github.com/mahdiiwm1/piplineproject/blob/main/Blog/routes/authUtils.js): `Blog/routes/authUtils.js`
- [User roles](https://github.com/mahdiiwm1/piplineproject/blob/main/Blog/routes/roles.js): `Blog/routes/roles.js`

### Blog content

- [SQLite database](https://github.com/mahdiiwm1/piplineproject/blob/main/Blog/database.js): `Blog/database.js`
- [Blog views](https://github.com/mahdiiwm1/piplineproject/tree/main/Blog/views): `Blog/views`

### Other components

- **Visitor**

## Connections

- Visitor → Request handlers: sends requests (evidence: `Blog/app.js`)
- Request handlers → SQLite database: loads session; reads posts; inserts posts (evidence: `Blog/app.js`)
- Request handlers → Auth routes: mounts routes (evidence: `Blog/app.js`)
- Request handlers → User roles: checks admin role (evidence: `Blog/app.js`)
- Request handlers → Auth utilities: logs denied access (evidence: `Blog/app.js`)
- Request handlers → Blog views: renders pages (evidence: `Blog/app.js`)
- Auth routes → SQLite database: reads and updates accounts (evidence: `Blog/routes/auth.js`)
- Auth routes → Auth utilities: validates; creates sessions; logs (evidence: `Blog/routes/auth.js`)
- Auth routes → User roles: creates users (evidence: `Blog/routes/auth.js`)
- Auth routes → Blog views: renders login and registration (evidence: `Blog/routes/auth.js`)
- Auth utilities → User roles: creates user (evidence: `Blog/routes/authUtils.js`)
