# atlegang-dotcom/work-station architecture

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

- Interactive diagram: https://gitdiagram.com/atlegang-dotcom/work-station
- Repository: https://github.com/atlegang-dotcom/work-station

## Overview

EDG Workstation is an internal client and project workflow application with Sales, R&D, and P&M stations. Users authenticate, manage client records and project details, then coordinate project-plan review and status updates across departments; mail and file-transfer integrations support notifications and documents, while mail-tracking endpoints record engagement. The route modules contain substantial inline HTML as well as request handling. Evidence is limited to the README-free tree, SOURCE INDEX references, and sampled excerpts, so unsampled subsystem links are omitted where their runtime relationship is not shown.

Main entry points: [`index.js`](https://github.com/atlegang-dotcom/work-station/blob/main/index.js) (HTTP application), [`routes/R&D/add.js`](https://github.com/atlegang-dotcom/work-station/blob/main/routes/R%26D/add.js) (R&D projects), [`routes/P&M/add.js`](https://github.com/atlegang-dotcom/work-station/blob/main/routes/P%26M/add.js) (P&M projects), [`server.js`](https://github.com/atlegang-dotcom/work-station/blob/main/server.js) (Shared connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtime"]
  node_entry["HTTP application<br/>[index.js]"]
  node_db[("MySQL database")]
  node_sessionstore[("Session store")]
  node_server["Shared connection<br/>[server.js]"]
  node_auth["Authentication<br/>[auth.js]"]
  node_ping["Mailer tracking<br/>[ping.js]"]
  node_datetime["Date formatting<br/>[dateTime.js]"]
end

subgraph group_sales["Sales workflows"]
  node_salesclients["Client management<br/>[add.js]"]
  node_salespipeline["Client pipeline<br/>[view.js]"]
  node_salesnav["Sales navigation<br/>[head.js]"]
  node_salesdata["Navigation data<br/>[dashData.js]"]
  node_footer["Page footer<br/>[footer.js]"]
end

subgraph group_rnd["R&amp;D workflows"]
  node_rndworkflow["R&amp;D projects<br/>[add.js]"]
  node_rndnav["R&amp;D navigation<br/>[head.js]"]
  node_rnddata["R&amp;D navigation data<br/>[dashData.js]"]
  node_rndview["R&amp;D view routes<br/>[view.js]"]
end

subgraph group_pm["P&amp;M workflows"]
  node_pmworkflow["P&amp;M projects<br/>[add.js]"]
  node_pmnav["P&amp;M navigation<br/>[head.js]"]
  node_pmdata["P&amp;M navigation data<br/>[dashData.js]"]
  node_pmview["P&amp;M view routes<br/>[view.js]"]
end

node_browser(("Workstation user"))
node_smtp["Mail service"]
node_sftp["File transfer"]

node_browser -->|"sends requests"| node_entry
node_entry -->|"uses connection"| node_server
node_server -->|"opens connection"| node_db
node_entry -->|"configures sessions"| node_sessionstore
node_entry -->|"mounts routes"| node_ping
node_entry -->|"mounts routes"| node_auth
node_entry -->|"mounts routes"| node_salesclients
node_entry -->|"mounts routes"| node_salespipeline
node_entry -->|"mounts routes"| node_rndworkflow
node_entry -->|"mounts routes"| node_pmworkflow
node_entry -->|"backs sessions"| node_db
node_entry -->|"stores sessions"| node_sessionstore
node_auth -->|"uses connection"| node_server
node_auth -->|"queries users"| node_db
node_ping -->|"uses connection"| node_server
node_ping -->|"reads tracking data"| node_db
node_ping -->|"imports date helpers"| node_datetime
node_auth -.->|"sends recovery mail"| node_smtp
node_salesclients -->|"uses connection"| node_server
node_salesclients -->|"updates client records"| node_db
node_salespipeline -->|"uses connection"| node_server
node_salespipeline -->|"queries client records"| node_db
node_salespipeline -->|"renders navigation"| node_salesnav
node_salespipeline -->|"renders footer"| node_footer
node_salesnav -->|"builds menus from"| node_salesdata
node_salesclients -->|"renders navigation"| node_salesnav
node_salesclients -->|"renders footer"| node_footer
node_rndworkflow -->|"uses connection"| node_server
node_rndworkflow -.->|"queries project data"| node_db
node_rndworkflow -->|"renders navigation"| node_rndnav
node_rndworkflow -->|"renders footer"| node_footer
node_rndnav -->|"builds menus from"| node_rnddata
node_rndworkflow -->|"transfers project files"| node_sftp
node_rndworkflow -->|"sends notifications"| node_smtp
node_pmworkflow -->|"uses connection"| node_server
node_pmworkflow -->|"creates project tables"| node_db
node_pmworkflow -->|"renders navigation"| node_pmnav
node_pmworkflow -->|"renders footer"| node_footer
node_pmnav -->|"builds menus from"| node_pmdata
node_pmworkflow -->|"transfers project files"| node_sftp
node_pmworkflow -->|"sends notifications"| node_smtp

click node_entry "https://github.com/atlegang-dotcom/work-station/blob/main/index.js"
click node_server "https://github.com/atlegang-dotcom/work-station/blob/main/server.js"
click node_auth "https://github.com/atlegang-dotcom/work-station/blob/main/routes/auth/auth.js"
click node_ping "https://github.com/atlegang-dotcom/work-station/blob/main/routes/ping.js"
click node_datetime "https://github.com/atlegang-dotcom/work-station/blob/main/routes/dateTime.js"
click node_salesclients "https://github.com/atlegang-dotcom/work-station/blob/main/routes/add.js"
click node_salespipeline "https://github.com/atlegang-dotcom/work-station/blob/main/routes/view.js"
click node_salesnav "https://github.com/atlegang-dotcom/work-station/blob/main/routes/components/head.js"
click node_salesdata "https://github.com/atlegang-dotcom/work-station/blob/main/routes/components/dashData.js"
click node_footer "https://github.com/atlegang-dotcom/work-station/blob/main/routes/components/footer.js"
click node_rndworkflow "https://github.com/atlegang-dotcom/work-station/blob/main/routes/R%26D/add.js"
click node_rndnav "https://github.com/atlegang-dotcom/work-station/blob/main/routes/R%26D/head.js"
click node_rnddata "https://github.com/atlegang-dotcom/work-station/blob/main/routes/R%26D/dashData.js"
click node_rndview "https://github.com/atlegang-dotcom/work-station/blob/main/routes/R%26D/view.js"
click node_pmworkflow "https://github.com/atlegang-dotcom/work-station/blob/main/routes/P%26M/add.js"
click node_pmnav "https://github.com/atlegang-dotcom/work-station/blob/main/routes/P%26M/head.js"
click node_pmdata "https://github.com/atlegang-dotcom/work-station/blob/main/routes/P%26M/dashData.js"
click node_pmview "https://github.com/atlegang-dotcom/work-station/blob/main/routes/P%26M/view.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_entry,node_db,node_sessionstore,node_server,node_auth,node_ping,node_datetime,node_browser toneBlue
class node_salesclients,node_salespipeline,node_salesnav,node_salesdata,node_footer toneAmber
class node_rndworkflow,node_rndnav,node_rnddata,node_rndview toneMint
class node_pmworkflow,node_pmnav,node_pmdata,node_pmview toneRose
class node_smtp,node_sftp toneIndigo
```

## Components

### Application runtime

- [HTTP application](https://github.com/atlegang-dotcom/work-station/blob/main/index.js): `index.js`
- **MySQL database**
- **Session store**
- [Shared connection](https://github.com/atlegang-dotcom/work-station/blob/main/server.js): `server.js`
- [Authentication](https://github.com/atlegang-dotcom/work-station/blob/main/routes/auth/auth.js): `routes/auth/auth.js`
- [Mailer tracking](https://github.com/atlegang-dotcom/work-station/blob/main/routes/ping.js): `routes/ping.js`
- [Date formatting](https://github.com/atlegang-dotcom/work-station/blob/main/routes/dateTime.js): `routes/dateTime.js`

### Sales workflows

- [Client management](https://github.com/atlegang-dotcom/work-station/blob/main/routes/add.js): `routes/add.js`
- [Client pipeline](https://github.com/atlegang-dotcom/work-station/blob/main/routes/view.js): `routes/view.js`
- [Sales navigation](https://github.com/atlegang-dotcom/work-station/blob/main/routes/components/head.js): `routes/components/head.js`
- [Navigation data](https://github.com/atlegang-dotcom/work-station/blob/main/routes/components/dashData.js): `routes/components/dashData.js`
- [Page footer](https://github.com/atlegang-dotcom/work-station/blob/main/routes/components/footer.js): `routes/components/footer.js`

### R&D workflows

- [R&D projects](https://github.com/atlegang-dotcom/work-station/blob/main/routes/R%26D/add.js): `routes/R&D/add.js`
- [R&D navigation](https://github.com/atlegang-dotcom/work-station/blob/main/routes/R%26D/head.js): `routes/R&D/head.js`
- [R&D navigation data](https://github.com/atlegang-dotcom/work-station/blob/main/routes/R%26D/dashData.js): `routes/R&D/dashData.js`
- [R&D view routes](https://github.com/atlegang-dotcom/work-station/blob/main/routes/R%26D/view.js): `routes/R&D/view.js`

### P&M workflows

- [P&M projects](https://github.com/atlegang-dotcom/work-station/blob/main/routes/P%26M/add.js): `routes/P&M/add.js`
- [P&M navigation](https://github.com/atlegang-dotcom/work-station/blob/main/routes/P%26M/head.js): `routes/P&M/head.js`
- [P&M navigation data](https://github.com/atlegang-dotcom/work-station/blob/main/routes/P%26M/dashData.js): `routes/P&M/dashData.js`
- [P&M view routes](https://github.com/atlegang-dotcom/work-station/blob/main/routes/P%26M/view.js): `routes/P&M/view.js`

### Other components

- **Workstation user**
- **Mail service**
- **File transfer**

## Connections

- Workstation user → HTTP application: sends requests (evidence: `index.js`)
- HTTP application → Shared connection: uses connection (evidence: `index.js`)
- Shared connection → MySQL database: opens connection (evidence: `server.js`)
- HTTP application → Session store: configures sessions (evidence: `index.js`)
- HTTP application → Mailer tracking: mounts routes (evidence: `index.js`)
- HTTP application → Authentication: mounts routes (evidence: `index.js`)
- HTTP application → Client management: mounts routes (evidence: `index.js`)
- HTTP application → Client pipeline: mounts routes (evidence: `index.js`)
- HTTP application → R&D projects: mounts routes (evidence: `index.js`)
- HTTP application → P&M projects: mounts routes (evidence: `index.js`)
- HTTP application → MySQL database: backs sessions (evidence: `index.js`)
- HTTP application → Session store: stores sessions (evidence: `index.js`)
- Authentication → Shared connection: uses connection (evidence: `routes/auth/auth.js`)
- Authentication → MySQL database: queries users (evidence: `routes/auth/auth.js`)
- Mailer tracking → Shared connection: uses connection (evidence: `routes/ping.js`)
- Mailer tracking → MySQL database: reads tracking data (evidence: `routes/ping.js`)
- Mailer tracking → Date formatting: imports date helpers (evidence: `routes/ping.js`)
- Authentication → Mail service: sends recovery mail
- Client management → Shared connection: uses connection (evidence: `routes/add.js`)
- Client management → MySQL database: updates client records (evidence: `routes/add.js`)
- Client pipeline → Shared connection: uses connection (evidence: `routes/view.js`)
- Client pipeline → MySQL database: queries client records (evidence: `routes/view.js`)
- Client pipeline → Sales navigation: renders navigation (evidence: `routes/view.js`)
- Client pipeline → Page footer: renders footer (evidence: `routes/view.js`)
- Sales navigation → Navigation data: builds menus from (evidence: `routes/components/head.js`)
- Client management → Sales navigation: renders navigation (evidence: `routes/add.js`)
- Client management → Page footer: renders footer (evidence: `routes/add.js`)
- R&D projects → Shared connection: uses connection (evidence: `routes/R&D/add.js`)
- R&D projects → MySQL database: queries project data
- R&D projects → R&D navigation: renders navigation (evidence: `routes/R&D/add.js`)
- R&D projects → Page footer: renders footer (evidence: `routes/R&D/add.js`)
- R&D navigation → R&D navigation data: builds menus from (evidence: `routes/R&D/head.js`)
- R&D projects → File transfer: transfers project files (evidence: `routes/R&D/add.js`)
- R&D projects → Mail service: sends notifications (evidence: `routes/R&D/add.js`)
- P&M projects → Shared connection: uses connection (evidence: `routes/P&M/add.js`)
- P&M projects → MySQL database: creates project tables (evidence: `routes/P&M/add.js`)
- P&M projects → P&M navigation: renders navigation (evidence: `routes/P&M/add.js`)
- P&M projects → Page footer: renders footer (evidence: `routes/P&M/add.js`)
- P&M navigation → P&M navigation data: builds menus from (evidence: `routes/P&M/head.js`)
- P&M projects → File transfer: transfers project files (evidence: `routes/P&M/add.js`)
- P&M projects → Mail service: sends notifications (evidence: `routes/P&M/add.js`)
