# laurenmbell/directcrm architecture

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

- Interactive diagram: https://gitdiagram.com/laurenmbell/directcrm
- Repository: https://github.com/laurenmbell/directcrm

## Overview

DirectCRM is an Express/EJS CRM administration app. A user opens a resource page, the app reads MySQL data and renders a page; submitted forms invoke database queries or stored procedures and redirect to the resource. The tree also shows schema, data, and procedure SQL files, but their contents were not sampled, so their internal relationships are not asserted. The available excerpts confirm several page renders and database calls; other route details may be incomplete.

Main entry points: [`app.js`](https://github.com/laurenmbell/directcrm/blob/master/app.js) (Routes and CRUD), [`db-connector.js`](https://github.com/laurenmbell/directcrm/blob/master/db-connector.js) (Connection pool), [`pages`](https://github.com/laurenmbell/directcrm/tree/master/pages) (Resource pages), [`views/partials`](https://github.com/laurenmbell/directcrm/tree/master/views/partials) (Shared page partials)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_routes["Routes and CRUD<br/>[app.js]"]
  node_pages["Resource pages"]
  node_shared["Shared page partials"]
end

subgraph group_data["Data layer"]
  node_connector["Connection pool<br/>[db-connector.js]"]
  node_mysql[("MySQL database")]
end

subgraph group_sql["SQL assets"]
  node_schema["Schema definition<br/>[DDL.sql]"]
  node_seeddata["Data statements<br/>[DML.sql]"]
  node_procedures["Stored procedures<br/>[PL.SQL]"]
end

node_user(("CRM user"))

node_user -->|"uses routes"| node_routes
node_routes -->|"queries data"| node_connector
node_connector -->|"opens pool"| node_mysql
node_routes -->|"renders pages"| node_pages
node_routes -->|"calls procedures"| node_procedures
node_routes -.-> node_shared

click node_routes "https://github.com/laurenmbell/directcrm/blob/master/app.js"
click node_pages "https://github.com/laurenmbell/directcrm/tree/master/pages"
click node_shared "https://github.com/laurenmbell/directcrm/tree/master/views/partials"
click node_connector "https://github.com/laurenmbell/directcrm/blob/master/db-connector.js"
click node_schema "https://github.com/laurenmbell/directcrm/blob/master/DDL.sql"
click node_seeddata "https://github.com/laurenmbell/directcrm/blob/master/DML.sql"
click node_procedures "https://github.com/laurenmbell/directcrm/blob/master/PL.SQL"

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_routes,node_pages,node_shared,node_user toneBlue
class node_connector,node_mysql toneAmber
class node_schema,node_seeddata,node_procedures toneMint
```

## Components

### Web application

- [Routes and CRUD](https://github.com/laurenmbell/directcrm/blob/master/app.js): `app.js`
- [Resource pages](https://github.com/laurenmbell/directcrm/tree/master/pages): `pages`
- [Shared page partials](https://github.com/laurenmbell/directcrm/tree/master/views/partials): `views/partials`

### Data layer

- [Connection pool](https://github.com/laurenmbell/directcrm/blob/master/db-connector.js): `db-connector.js`
- **MySQL database**

### SQL assets

- [Schema definition](https://github.com/laurenmbell/directcrm/blob/master/DDL.sql): `DDL.sql`
- [Data statements](https://github.com/laurenmbell/directcrm/blob/master/DML.sql): `DML.sql`
- [Stored procedures](https://github.com/laurenmbell/directcrm/blob/master/PL.SQL): `PL.SQL`

### Other components

- **CRM user**

## Connections

- CRM user → Routes and CRUD: uses routes
- Routes and CRUD → Connection pool: queries data (evidence: `app.js`)
- Connection pool → MySQL database: opens pool (evidence: `db-connector.js`)
- Routes and CRUD → Resource pages: renders pages (evidence: `app.js`)
- Routes and CRUD → Stored procedures: calls procedures (evidence: `app.js`)
- Routes and CRUD → Shared page partials
