# anas348/research-opportunity-portal architecture

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

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

## Overview

The Research Opportunity Portal is a Flask/MySQL CRUD application with a static JavaScript frontend. Faculty use the browser UI to browse, search, and filter opportunities, inspect details, and create, edit, change status, or delete records; the frontend sends requests to the Flask API, which validates and persists them. The graph groups UI behavior, API handling, and persistence. Source excerpts show the frontend request flow and backend database calls; HTML/CSS presentation details and schema contents were not sampled.

Main entry points: [`frontend/app.js`](https://github.com/anas348/research-opportunity-portal/blob/main/frontend/app.js) (Opportunity portal UI), [`backend/app.py`](https://github.com/anas348/research-opportunity-portal/blob/main/backend/app.py) (Opportunity CRUD API), [`backend/db.py`](https://github.com/anas348/research-opportunity-portal/blob/main/backend/db.py) (MySQL connection helper), [`db/schema.sql`](https://github.com/anas348/research-opportunity-portal/blob/main/db/schema.sql) (Opportunity schema)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Browser interface"]
  node_portal_ui["Opportunity portal UI<br/>[app.js]"]
  node_browse_search["Browse and filter<br/>[app.js]"]
  node_opportunity_details["Opportunity details<br/>[app.js]"]
  node_opportunity_form["Create and edit form<br/>[app.js]"]
  node_status_delete["Status and deletion<br/>[app.js]"]
  node_api_request["API request client<br/>[app.js]"]
end

subgraph group_api["API and rules"]
  node_flask_api["Opportunity CRUD API<br/>[app.py]"]
  node_payload_validation["Payload validation<br/>[app.py]"]
end

subgraph group_persistence["Persistence"]
  node_connection_helper["MySQL connection helper<br/>[db.py]"]
  node_mysql[("MySQL opportunity store")]
  node_schema["Opportunity schema<br/>[schema.sql]"]
end

node_faculty(("Faculty user"))
node_browser(("Browser"))

node_faculty -->|"uses"| node_browser
node_browser -->|"opens"| node_portal_ui
node_portal_ui -->|"provides"| node_browse_search
node_portal_ui -->|"opens"| node_opportunity_details
node_portal_ui -->|"submits"| node_opportunity_form
node_portal_ui -->|"manages"| node_status_delete
node_browse_search -->|"loads data"| node_api_request
node_opportunity_form -->|"sends changes"| node_api_request
node_status_delete -->|"sends changes"| node_api_request
node_api_request -->|"HTTP requests"| node_flask_api
node_flask_api -->|"validates"| node_payload_validation
node_flask_api -->|"gets connection"| node_connection_helper
node_connection_helper -->|"connects"| node_mysql
node_flask_api -->|"reads and writes"| node_mysql
node_schema -->|"defines setup"| node_mysql

click node_portal_ui "https://github.com/anas348/research-opportunity-portal/blob/main/frontend/app.js"
click node_browse_search "https://github.com/anas348/research-opportunity-portal/blob/main/frontend/app.js"
click node_opportunity_details "https://github.com/anas348/research-opportunity-portal/blob/main/frontend/app.js"
click node_opportunity_form "https://github.com/anas348/research-opportunity-portal/blob/main/frontend/app.js"
click node_status_delete "https://github.com/anas348/research-opportunity-portal/blob/main/frontend/app.js"
click node_api_request "https://github.com/anas348/research-opportunity-portal/blob/main/frontend/app.js"
click node_flask_api "https://github.com/anas348/research-opportunity-portal/blob/main/backend/app.py"
click node_payload_validation "https://github.com/anas348/research-opportunity-portal/blob/main/backend/app.py"
click node_connection_helper "https://github.com/anas348/research-opportunity-portal/blob/main/backend/db.py"
click node_schema "https://github.com/anas348/research-opportunity-portal/blob/main/db/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_portal_ui,node_browse_search,node_opportunity_details,node_opportunity_form,node_status_delete,node_api_request,node_faculty,node_browser toneBlue
class node_flask_api,node_payload_validation toneAmber
class node_connection_helper,node_mysql,node_schema toneMint
```

## Components

### Browser interface

- [Opportunity portal UI](https://github.com/anas348/research-opportunity-portal/blob/main/frontend/app.js): `frontend/app.js`
- [Browse and filter](https://github.com/anas348/research-opportunity-portal/blob/main/frontend/app.js): `frontend/app.js`
- [Opportunity details](https://github.com/anas348/research-opportunity-portal/blob/main/frontend/app.js): `frontend/app.js`
- [Create and edit form](https://github.com/anas348/research-opportunity-portal/blob/main/frontend/app.js): `frontend/app.js`
- [Status and deletion](https://github.com/anas348/research-opportunity-portal/blob/main/frontend/app.js): `frontend/app.js`
- [API request client](https://github.com/anas348/research-opportunity-portal/blob/main/frontend/app.js): `frontend/app.js`

### API and rules

- [Opportunity CRUD API](https://github.com/anas348/research-opportunity-portal/blob/main/backend/app.py): `backend/app.py`
- [Payload validation](https://github.com/anas348/research-opportunity-portal/blob/main/backend/app.py): `backend/app.py`

### Persistence

- [MySQL connection helper](https://github.com/anas348/research-opportunity-portal/blob/main/backend/db.py): `backend/db.py`
- **MySQL opportunity store**
- [Opportunity schema](https://github.com/anas348/research-opportunity-portal/blob/main/db/schema.sql): `db/schema.sql`

### Other components

- **Faculty user**
- **Browser**

## Connections

- Faculty user → Browser: uses (evidence: `README.md`)
- Browser → Opportunity portal UI: opens (evidence: `README.md`)
- Opportunity portal UI → Browse and filter: provides (evidence: `frontend/app.js`)
- Opportunity portal UI → Opportunity details: opens (evidence: `frontend/app.js`)
- Opportunity portal UI → Create and edit form: submits (evidence: `frontend/app.js`)
- Opportunity portal UI → Status and deletion: manages (evidence: `frontend/app.js`)
- Browse and filter → API request client: loads data (evidence: `frontend/app.js`)
- Create and edit form → API request client: sends changes (evidence: `frontend/app.js`)
- Status and deletion → API request client: sends changes (evidence: `frontend/app.js`)
- API request client → Opportunity CRUD API: HTTP requests (evidence: `README.md`)
- Opportunity CRUD API → Payload validation: validates (evidence: `backend/app.py`)
- Opportunity CRUD API → MySQL connection helper: gets connection (evidence: `backend/app.py`)
- MySQL connection helper → MySQL opportunity store: connects (evidence: `backend/db.py`)
- Opportunity CRUD API → MySQL opportunity store: reads and writes (evidence: `backend/app.py`)
- Opportunity schema → MySQL opportunity store: defines setup (evidence: `README.md`)
