# yogendrabaskota/nodeproject architecture

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

- Interactive diagram: https://gitdiagram.com/yogendrabaskota/nodeproject
- Repository: https://github.com/yogendrabaskota/nodeproject

## Overview

This is a small Express/EJS blog application scaffold. A browser can request home, login, and registration pages; the server renders their views and accepts a registration POST, though that handler currently does not persist the submitted fields. At startup, the app initializes Sequelize models and attempts to authenticate and synchronize a MySQL database. The graph captures that implemented flow and the available templates and styles; view internals were not sampled, so no form-submission or navigation behavior is inferred.

Main entry points: [`app.js`](https://github.com/yogendrabaskota/nodeproject/blob/main/app.js) (Express routes), [`model/index.js`](https://github.com/yogendrabaskota/nodeproject/blob/main/model/index.js) (Sequelize setup), [`public/css`](https://github.com/yogendrabaskota/nodeproject/tree/main/public/css) (CSS assets), [`views/home.ejs`](https://github.com/yogendrabaskota/nodeproject/blob/main/views/home.ejs) (Home view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web server"]
  node_server["Express routes<br/>[app.js]"]
  node_styles["CSS assets"]
end

subgraph group_views["Rendered views"]
  node_home["Home view<br/>[home.ejs]"]
  node_login["Login view<br/>[login.ejs]"]
  node_register["Registration view<br/>[register.ejs]"]
  node_navbar["Navbar template<br/>[navbar.ejs]"]
end

subgraph group_data["Persistence"]
  node_initializer["Sequelize setup<br/>[index.js]"]
  node_config["MySQL config<br/>[dbConfig.js]"]
  node_users["User model<br/>[userModel.js]"]
  node_blogs["Blog model<br/>[blogModel.js]"]
end

node_browser(("Browser"))
node_mysql[("MySQL database")]

node_browser -->|"requests pages"| node_server
node_server -->|"renders"| node_home
node_server -->|"renders"| node_login
node_server -->|"renders"| node_register
node_server -->|"serves static files"| node_styles
node_server -->|"initializes"| node_initializer
node_initializer -->|"loads settings"| node_config
node_initializer -->|"creates model"| node_users
node_initializer -->|"creates model"| node_blogs
node_initializer -->|"authenticates and syncs"| node_mysql

click node_server "https://github.com/yogendrabaskota/nodeproject/blob/main/app.js"
click node_home "https://github.com/yogendrabaskota/nodeproject/blob/main/views/home.ejs"
click node_login "https://github.com/yogendrabaskota/nodeproject/blob/main/views/auth/login.ejs"
click node_register "https://github.com/yogendrabaskota/nodeproject/blob/main/views/auth/register.ejs"
click node_navbar "https://github.com/yogendrabaskota/nodeproject/blob/main/views/components/navbar.ejs"
click node_styles "https://github.com/yogendrabaskota/nodeproject/tree/main/public/css"
click node_initializer "https://github.com/yogendrabaskota/nodeproject/blob/main/model/index.js"
click node_config "https://github.com/yogendrabaskota/nodeproject/blob/main/config/dbConfig.js"
click node_users "https://github.com/yogendrabaskota/nodeproject/blob/main/model/userModel.js"
click node_blogs "https://github.com/yogendrabaskota/nodeproject/blob/main/model/blogModel.js"

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_server,node_styles,node_browser toneBlue
class node_home,node_login,node_register,node_navbar,node_mysql toneAmber
class node_initializer,node_config,node_users,node_blogs toneMint
```

## Components

### Web server

- [Express routes](https://github.com/yogendrabaskota/nodeproject/blob/main/app.js): `app.js`
- [CSS assets](https://github.com/yogendrabaskota/nodeproject/tree/main/public/css): `public/css`

### Rendered views

- [Home view](https://github.com/yogendrabaskota/nodeproject/blob/main/views/home.ejs): `views/home.ejs`
- [Login view](https://github.com/yogendrabaskota/nodeproject/blob/main/views/auth/login.ejs): `views/auth/login.ejs`
- [Registration view](https://github.com/yogendrabaskota/nodeproject/blob/main/views/auth/register.ejs): `views/auth/register.ejs`
- [Navbar template](https://github.com/yogendrabaskota/nodeproject/blob/main/views/components/navbar.ejs): `views/components/navbar.ejs`

### Persistence

- [Sequelize setup](https://github.com/yogendrabaskota/nodeproject/blob/main/model/index.js): `model/index.js`
- [MySQL config](https://github.com/yogendrabaskota/nodeproject/blob/main/config/dbConfig.js): `config/dbConfig.js`
- [User model](https://github.com/yogendrabaskota/nodeproject/blob/main/model/userModel.js): `model/userModel.js`
- [Blog model](https://github.com/yogendrabaskota/nodeproject/blob/main/model/blogModel.js): `model/blogModel.js`

### Other components

- **Browser**
- **MySQL database**

## Connections

- Browser → Express routes: requests pages (evidence: `app.js`)
- Express routes → Home view: renders (evidence: `app.js`)
- Express routes → Login view: renders (evidence: `app.js`)
- Express routes → Registration view: renders (evidence: `app.js`)
- Express routes → CSS assets: serves static files (evidence: `app.js`)
- Express routes → Sequelize setup: initializes (evidence: `app.js`)
- Sequelize setup → MySQL config: loads settings (evidence: `model/index.js`)
- Sequelize setup → User model: creates model (evidence: `model/index.js`)
- Sequelize setup → Blog model: creates model (evidence: `model/index.js`)
- Sequelize setup → MySQL database: authenticates and syncs (evidence: `model/index.js`)
