# ahmad808373/research-opportunity-portal architecture

> Architecture diagram of the GitHub repository ahmad808373/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/ahmad808373/research-opportunity-portal
- Repository: https://github.com/ahmad808373/research-opportunity-portal

## Overview

The University Research Opportunity Portal lets faculty manage research openings through a browser interface backed by a Flask REST API and MySQL. The main workflow is to browse or select an opportunity, submit validated create/edit/close/delete actions, and refresh the displayed records from the API. The graph separates browser interaction, API handling, and persistence. The README documents the database schema and major UI capabilities; source excerpts show the frontend requests and backend database calls. Other UI wiring is not inferred where it was not shown.

Main entry points: [`backend/portal_app.py`](https://github.com/ahmad808373/research-opportunity-portal/blob/main/backend/portal_app.py) (Opportunity endpoints), [`backend/db.py`](https://github.com/ahmad808373/research-opportunity-portal/blob/main/backend/db.py) (Connection lifecycle), [`frontend/index.html`](https://github.com/ahmad808373/research-opportunity-portal/blob/main/frontend/index.html) (Opportunity interface), [`frontend/script.js`](https://github.com/ahmad808373/research-opportunity-portal/blob/main/frontend/script.js) (UI behavior)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser interface"]
  node_ui["Opportunity interface<br/>[index.html]"]
  node_frontend["UI behavior<br/>[script.js]"]
  node_styles["Responsive styling<br/>[style.css]"]
end

subgraph group_api["REST API"]
  node_routes["Opportunity endpoints<br/>[portal_app.py]"]
  node_validation["Request validation<br/>[portal_app.py]"]
end

subgraph group_persistence["Data persistence"]
  node_connections["Connection lifecycle<br/>[db.py]"]
  node_schema["Opportunity schema<br/>[schema.sql]"]
  node_mysql[("MySQL database")]
end

node_faculty(("Faculty user"))

node_faculty -->|"uses"| node_ui
node_frontend -->|"sends requests"| node_routes
node_routes -->|"validates input"| node_validation
node_routes -->|"gets connection"| node_connections
node_connections -->|"opens connection"| node_mysql
node_schema -->|"defines tables"| node_mysql
node_routes -->|"serves page"| node_ui

click node_ui "https://github.com/ahmad808373/research-opportunity-portal/blob/main/frontend/index.html"
click node_frontend "https://github.com/ahmad808373/research-opportunity-portal/blob/main/frontend/script.js"
click node_styles "https://github.com/ahmad808373/research-opportunity-portal/blob/main/frontend/style.css"
click node_routes "https://github.com/ahmad808373/research-opportunity-portal/blob/main/backend/portal_app.py"
click node_validation "https://github.com/ahmad808373/research-opportunity-portal/blob/main/backend/portal_app.py"
click node_connections "https://github.com/ahmad808373/research-opportunity-portal/blob/main/backend/db.py"
click node_schema "https://github.com/ahmad808373/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_ui,node_frontend,node_styles,node_faculty toneBlue
class node_routes,node_validation toneAmber
class node_connections,node_schema,node_mysql toneMint
```

## Components

### Browser interface

- [Opportunity interface](https://github.com/ahmad808373/research-opportunity-portal/blob/main/frontend/index.html): `frontend/index.html`
- [UI behavior](https://github.com/ahmad808373/research-opportunity-portal/blob/main/frontend/script.js): `frontend/script.js`
- [Responsive styling](https://github.com/ahmad808373/research-opportunity-portal/blob/main/frontend/style.css): `frontend/style.css`

### REST API

- [Opportunity endpoints](https://github.com/ahmad808373/research-opportunity-portal/blob/main/backend/portal_app.py): `backend/portal_app.py`
- [Request validation](https://github.com/ahmad808373/research-opportunity-portal/blob/main/backend/portal_app.py): `backend/portal_app.py`

### Data persistence

- [Connection lifecycle](https://github.com/ahmad808373/research-opportunity-portal/blob/main/backend/db.py): `backend/db.py`
- [Opportunity schema](https://github.com/ahmad808373/research-opportunity-portal/blob/main/database/schema.sql): `database/schema.sql`
- **MySQL database**

### Other components

- **Faculty user**

## Connections

- Faculty user → Opportunity interface: uses (evidence: `README.md`)
- UI behavior → Opportunity endpoints: sends requests (evidence: `frontend/script.js`)
- Opportunity endpoints → Request validation: validates input (evidence: `backend/portal_app.py`)
- Opportunity endpoints → Connection lifecycle: gets connection (evidence: `backend/portal_app.py`)
- Connection lifecycle → MySQL database: opens connection (evidence: `backend/db.py`)
- Opportunity schema → MySQL database: defines tables (evidence: `README.md`)
- Opportunity endpoints → Opportunity interface: serves page (evidence: `README.md`)
