# techatanus/eazy architecture

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

- Interactive diagram: https://gitdiagram.com/techatanus/eazy
- Repository: https://github.com/techatanus/eazy

## Overview

Eazy is a web-based procurement system. Its principal workflow is for clients or administrators to create procurement opportunities, suppliers to submit responses, and authorized users to review submissions and approve bids; suppliers can then initiate payment through M-PESA. Express routes connect these activities to controller logic and MySQL, with EJS views presenting the application. The excerpts show the main route/controller/database wiring and payment callbacks; many controller and admin-route details are unsampled, so the graph preserves documented capabilities without inferring their internal call sequence.

Main entry points: [`app.js`](https://github.com/techatanus/eazy/blob/main/app.js) (Express application), [`routes/admin.js`](https://github.com/techatanus/eazy/blob/main/routes/admin.js) (Admin routes), [`routes/index.js`](https://github.com/techatanus/eazy/blob/main/routes/index.js) (Public routes), [`controllers/adminController.js`](https://github.com/techatanus/eazy/blob/main/controllers/adminController.js) (Procurement handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_server["Express application<br/>[app.js]"]
  node_public_routes["Public routes<br/>[index.js]"]
  node_admin_routes["Admin routes<br/>[admin.js]"]
  node_views["EJS screens"]
end

subgraph group_procurement["Procurement workflow"]
  node_controller["Procurement handlers<br/>[adminController.js]"]
  node_procurement_records["Procurement records<br/>[adminController.js]"]
  node_review["Review and approvals<br/>[admin.js]"]
  node_responses["Supplier responses<br/>[admin.js]"]
  node_questionnaires["Bid templates"]
end

subgraph group_persistence["Persistence and files"]
  node_database_config["MySQL pool<br/>[db.js]"]
  node_database[("MySQL database")]
  node_uploads[("Uploaded documents")]
end

subgraph group_integrations["External services"]
  node_email["Email delivery"]
  node_mpesa["Safaricom M-PESA"]
end

node_user(("Client or supplier"))

node_user -->|"uses"| node_server
node_server -->|"mounts"| node_public_routes
node_server -->|"mounts"| node_admin_routes
node_public_routes -->|"dispatches"| node_controller
node_admin_routes -->|"dispatches"| node_controller
node_admin_routes -->|"queries"| node_database_config
node_controller -->|"queries"| node_database_config
node_database_config -->|"connects"| node_database
node_controller -->|"sends mail"| node_email
node_server -->|"requests payment"| node_mpesa
node_mpesa -->|"posts callback"| node_server
node_server -->|"records payment"| node_database_config
node_public_routes -->|"stores files"| node_uploads
node_server -->|"serves files"| node_uploads
node_admin_routes -->|"renders"| node_views
node_public_routes -->|"renders"| node_views
node_admin_routes -->|"loads templates"| node_questionnaires
node_user -.->|"creates opportunities"| node_procurement_records
node_user -.->|"submits bids"| node_responses
node_user -.->|"reviews bids"| node_review

click node_server "https://github.com/techatanus/eazy/blob/main/app.js"
click node_public_routes "https://github.com/techatanus/eazy/blob/main/routes/index.js"
click node_admin_routes "https://github.com/techatanus/eazy/blob/main/routes/admin.js"
click node_views "https://github.com/techatanus/eazy/tree/main/views"
click node_controller "https://github.com/techatanus/eazy/blob/main/controllers/adminController.js"
click node_procurement_records "https://github.com/techatanus/eazy/blob/main/controllers/adminController.js"
click node_review "https://github.com/techatanus/eazy/blob/main/routes/admin.js"
click node_responses "https://github.com/techatanus/eazy/blob/main/routes/admin.js"
click node_questionnaires "https://github.com/techatanus/eazy/tree/main/templates"
click node_database_config "https://github.com/techatanus/eazy/blob/main/config/db.js"
click node_uploads "https://github.com/techatanus/eazy/tree/main/uploads"

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_public_routes,node_admin_routes,node_views,node_user toneBlue
class node_controller,node_procurement_records,node_review,node_responses,node_questionnaires toneAmber
class node_database_config,node_database,node_uploads toneMint
class node_email,node_mpesa toneRose
```

## Components

### Web application

- [Express application](https://github.com/techatanus/eazy/blob/main/app.js): `app.js`
- [Public routes](https://github.com/techatanus/eazy/blob/main/routes/index.js): `routes/index.js`
- [Admin routes](https://github.com/techatanus/eazy/blob/main/routes/admin.js): `routes/admin.js`
- [EJS screens](https://github.com/techatanus/eazy/tree/main/views): `views`

### Procurement workflow

- [Procurement handlers](https://github.com/techatanus/eazy/blob/main/controllers/adminController.js): `controllers/adminController.js`
- [Procurement records](https://github.com/techatanus/eazy/blob/main/controllers/adminController.js): `controllers/adminController.js`
- [Review and approvals](https://github.com/techatanus/eazy/blob/main/routes/admin.js): `routes/admin.js`
- [Supplier responses](https://github.com/techatanus/eazy/blob/main/routes/admin.js): `routes/admin.js`
- [Bid templates](https://github.com/techatanus/eazy/tree/main/templates): `templates`

### Persistence and files

- [MySQL pool](https://github.com/techatanus/eazy/blob/main/config/db.js): `config/db.js`
- **MySQL database**
- [Uploaded documents](https://github.com/techatanus/eazy/tree/main/uploads): `uploads`

### External services

- **Email delivery**
- **Safaricom M-PESA**

### Other components

- **Client or supplier**

## Connections

- Client or supplier → Express application: uses (evidence: `app.js`)
- Express application → Public routes: mounts (evidence: `app.js`)
- Express application → Admin routes: mounts (evidence: `app.js`)
- Public routes → Procurement handlers: dispatches (evidence: `routes/index.js`)
- Admin routes → Procurement handlers: dispatches (evidence: `routes/admin.js`)
- Admin routes → MySQL pool: queries (evidence: `routes/admin.js`)
- Procurement handlers → MySQL pool: queries (evidence: `controllers/adminController.js`)
- MySQL pool → MySQL database: connects (evidence: `config/db.js`)
- Procurement handlers → Email delivery: sends mail (evidence: `controllers/adminController.js`)
- Express application → Safaricom M-PESA: requests payment (evidence: `app.js`)
- Safaricom M-PESA → Express application: posts callback (evidence: `app.js`)
- Express application → MySQL pool: records payment (evidence: `app.js`)
- Public routes → Uploaded documents: stores files (evidence: `routes/index.js`)
- Express application → Uploaded documents: serves files (evidence: `app.js`)
- Admin routes → EJS screens: renders (evidence: `routes/admin.js`)
- Public routes → EJS screens: renders (evidence: `routes/index.js`)
- Admin routes → Bid templates: loads templates (evidence: `routes/admin.js`)
- Client or supplier → Procurement records: creates opportunities
- Client or supplier → Supplier responses: submits bids
- Client or supplier → Review and approvals: reviews bids
