# mianayaan0316/research-opportunity-portal architecture

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

- Interactive diagram: https://gitdiagram.com/mianayaan0316/research-opportunity-portal
- Repository: https://github.com/mianayaan0316/research-opportunity-portal

## Overview

Research Opportunity Portal is a web application for creating, browsing, viewing, editing, closing, and deleting research opportunities. The principal workflow runs from the browser interface through the Express API to MySQL-backed opportunity records, with API-side validation and error handling. The frontend performs client-side form checks and displays returned data; the API validates requests and issues SQL queries. The excerpts show the browser/API and server/database wiring, but provide no schema or README capability details beyond the product name.

Main entry points: [`backend/server.js`](https://github.com/mianayaan0316/research-opportunity-portal/blob/main/backend/server.js) (Express server), [`backend/db.js`](https://github.com/mianayaan0316/research-opportunity-portal/blob/main/backend/db.js) (MySQL connection pool), [`frontend/app.js`](https://github.com/mianayaan0316/research-opportunity-portal/blob/main/frontend/app.js) (Opportunity interface), [`backend/routes/opportunities.js`](https://github.com/mianayaan0316/research-opportunity-portal/blob/main/backend/routes/opportunities.js) (Opportunity API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser interface"]
  node_frontend["Opportunity interface<br/>[app.js]"]
end

subgraph group_api["API service"]
  node_server["Express server<br/>[server.js]"]
  node_opportunity_api["Opportunity API<br/>[opportunities.js]"]
end

subgraph group_persistence["Data persistence"]
  node_pool["MySQL connection pool<br/>[db.js]"]
  node_opportunity_store[("Opportunity records<br/>[schema.sql]")]
end

node_user(("Portal user"))

node_user -->|"uses"| node_frontend
node_frontend -->|"sends API requests"| node_server
node_server -->|"mounts routes"| node_opportunity_api
node_server -->|"checks connection"| node_pool
node_opportunity_api -->|"queries records"| node_pool
node_pool -.->|"connects to"| node_opportunity_store

click node_frontend "https://github.com/mianayaan0316/research-opportunity-portal/blob/main/frontend/app.js"
click node_server "https://github.com/mianayaan0316/research-opportunity-portal/blob/main/backend/server.js"
click node_opportunity_api "https://github.com/mianayaan0316/research-opportunity-portal/blob/main/backend/routes/opportunities.js"
click node_pool "https://github.com/mianayaan0316/research-opportunity-portal/blob/main/backend/db.js"
click node_opportunity_store "https://github.com/mianayaan0316/research-opportunity-portal/blob/main/database/schema.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_frontend,node_user toneBlue
class node_server,node_opportunity_api toneAmber
class node_pool,node_opportunity_store toneMint
```

## Components

### Browser interface

- [Opportunity interface](https://github.com/mianayaan0316/research-opportunity-portal/blob/main/frontend/app.js): `frontend/app.js`

### API service

- [Express server](https://github.com/mianayaan0316/research-opportunity-portal/blob/main/backend/server.js): `backend/server.js`
- [Opportunity API](https://github.com/mianayaan0316/research-opportunity-portal/blob/main/backend/routes/opportunities.js): `backend/routes/opportunities.js`

### Data persistence

- [MySQL connection pool](https://github.com/mianayaan0316/research-opportunity-portal/blob/main/backend/db.js): `backend/db.js`
- [Opportunity records](https://github.com/mianayaan0316/research-opportunity-portal/blob/main/database/schema.sql): `database/schema.sql`

### Other components

- **Portal user**

## Connections

- Portal user → Opportunity interface: uses
- Opportunity interface → Express server: sends API requests (evidence: `frontend/app.js`)
- Express server → Opportunity API: mounts routes (evidence: `backend/server.js`)
- Express server → MySQL connection pool: checks connection (evidence: `backend/server.js`)
- Opportunity API → MySQL connection pool: queries records (evidence: `backend/routes/opportunities.js`)
- MySQL connection pool → Opportunity records: connects to (evidence: `backend/db.js`)
