# chikashishirozu/pro-blog-app-28 architecture

> Architecture diagram of the GitHub repository chikashishirozu/pro-blog-app-28, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chikashishirozu/pro-blog-app-28
- Repository: https://github.com/chikashishirozu/pro-blog-app-28

## Overview

##### Project type and purpose
- This is a monolithic full-stack blog application named “pro-blog-app-28.”
- It uses Node.js/Express on the backend, EJS templates on the server for rendering views, and a SQLite database for persistence.
- It provides user signup/login (via Passport), article CRUD operations, search, and static asset serving.

##### File structure
- Top-level files:
– app.js: main Express server and route definitions
– setup.js / init_db.js / init_db_user_id.js: DB initialization scripts
– blog.db / new.db / dump.sql: SQLite database files and dumps
– send_url.js: likely a helper for generating shareable links
- Directories:
– config/passport.js: authentication strategy setup
– components/ArticleList.js & UserList.js: UI components (could be client-side modular scripts)
– public/: static assets (CSS, images, client JS, sample JSON data)
– views/: EJS templates for all pages (login, signup, list, article detail, edit, etc.)
- No separate “API” or microservice folders—this is a single service that handles both UI and data access.

##### README insights
- Minimal instructions: install Node.js 22.12.0, sqlite3, run `npm install`, then `node app.js [IP] [Port]`

##### Elements
- Client components in another

Summary

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Side
    subgraph "Client (Browser)" 
        Browser["Web Browser"]:::client
        subgraph "Client-side UI Modules"
            ArticleList["components/ArticleList.js"]:::module
            UserList["components/UserList.js"]:::module
        end
    end

    %% Server Side
    subgraph "Server (Monolith)" 
        Express["Express Server (app.js)"]:::server
        Passport["Passport Auth (config/passport.js)"]:::auth
        subgraph "View Layer (EJS Templates)"
            AddArticles["add_articles.ejs"]:::view
            ArticleView["article.ejs"]:::view
            EditArticle["edit_article.ejs"]:::view
            Header["header.ejs"]:::view
            ListView["list.ejs"]:::view
            Login["login.ejs"]:::view
            SearchResults["search_results.ejs"]:::view
            Signup["signup.ejs"]:::view
            Top["top.ejs"]:::view
        end
        subgraph "Static Assets (public/)"
            CSS1["css/style.css"]:::static
            CSS2["style.css"]:::static
            Images["images/"]:::static
            DataArticles["data/articles.json"]:::static
            DataUsers["data/users.json"]:::static
            PublicSendURL["send_url.js"]:::static
        end
        Config["Configuration (package.json & package-lock.json)"]:::config
        Utils["send_url.js"]:::util
    end

    %% Database Layer
    subgraph "Database Layer"
        DB["SQLite DB (blog.db)"]:::db
        NewDB["new.db"]:::db
        Dump["dump.sql"]:::db
        InitDB["init_db.js"]:::script
        InitUserID["init_db_user_id.js"]:::script
        Setup["setup.js"]:::script
    end

    %% Relationships
    Browser -->|HTTP GET/POST| Express
    Express -->|uses| Passport
    Express -->|renders| AddArticles
    Express -->|renders| ArticleView
    Express -->|renders| EditArticle
    Express -->|renders| Header
    Express -->|renders| ListView
    Express -->|renders| Login
    Express -->|renders| SearchResults
    Express -->|renders| Signup
    Express -->|renders| Top
    Browser -->|fetch static| CSS1
    Browser -->|fetch static| CSS2
    Browser -->|fetch static| Images
    Browser -->|fetch static| DataArticles
    Browser -->|fetch static| DataUsers
    Browser -->|fetch static| PublicSendURL
    Express -->|DB Query| DB
    Express -->|DB Query| NewDB
    Express -->|DB Query| Dump
    Express -->|init script| InitDB
    Express -->|init script| InitUserID
    Express -->|init script| Setup
    Express -->|read config| Config
    Express -->|uses util| Utils
    Browser -->|imports| ArticleList
    Browser -->|imports| UserList

    %% Click Events
    click Express "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/app.js"
    click Passport "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/config/passport.js"
    click AddArticles "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/views/add_articles.ejs"
    click ArticleView "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/views/article.ejs"
    click EditArticle "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/views/edit_article.ejs"
    click Header "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/views/header.ejs"
    click ListView "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/views/list.ejs"
    click Login "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/views/login.ejs"
    click SearchResults "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/views/search_results.ejs"
    click Signup "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/views/signup.ejs"
    click Top "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/views/top.ejs"
    click CSS1 "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/public/css/style.css"
    click CSS2 "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/public/style.css"
    click Images "https://github.com/chikashishirozu/pro-blog-app-28/tree/main/public/images/"
    click DataArticles "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/public/data/articles.json"
    click DataUsers "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/public/data/users.json"
    click PublicSendURL "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/public/send_url.js"
    click DB "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/blog.db"
    click NewDB "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/new.db"
    click Dump "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/dump.sql"
    click InitDB "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/init_db.js"
    click InitUserID "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/init_db_user_id.js"
    click Setup "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/setup.js"
    click Config "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/package.json"
    click Utils "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/send_url.js"
    click ArticleList "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/components/ArticleList.js"
    click UserList "https://github.com/chikashishirozu/pro-blog-app-28/blob/main/components/UserList.js"

    %% Styles
    classDef client fill:#f9f,stroke:#333,stroke-width:1px
    classDef server fill:#bbf,stroke:#333,stroke-width:1px
    classDef auth fill:#fcf,stroke:#333,stroke-width:1px
    classDef view fill:#bfb,stroke:#333,stroke-width:1px
    classDef static fill:#ffd,stroke:#333,stroke-width:1px
    classDef db fill:#fdd,stroke:#333,stroke-width:1px
    classDef script fill:#dfd,stroke:#333,stroke-width:1px
    classDef config fill:#ddf,stroke:#333,stroke-width:1px
    classDef util fill:#dff,stroke:#333,stroke-width:1px
    classDef module fill:#eef,stroke:#333,stroke-width:1px
```
