# malik-sani/research-opportunity-portal architecture

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

## Overview

The University Research Opportunity Portal lets users browse and manage research opportunities through a browser UI, an HTTP/JSON API, and MySQL. The main workflow covers listing and viewing opportunities, creating or editing them, closing them, and deleting them; the API validates requests and persists changes. The sampled frontend and server code show these interactions and database queries. The README documents the MySQL schema and API capabilities; implementation details beyond the sampled files are not assumed.

Main entry points: [`backend/server.js`](https://github.com/malik-sani/research-opportunity-portal/blob/main/backend/server.js) (REST API), [`database/schema.sql`](https://github.com/malik-sani/research-opportunity-portal/blob/main/database/schema.sql) (Opportunity database), [`frontend/script.js`](https://github.com/malik-sani/research-opportunity-portal/blob/main/frontend/script.js) (Opportunity UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

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

subgraph group_service["API service"]
  node_api["REST API<br/>[server.js]"]
  node_validation["Request validation<br/>[server.js]"]
  node_create["Create opportunity<br/>[server.js]"]
  node_browse["List opportunities<br/>[server.js]"]
  node_view["View opportunity<br/>[server.js]"]
  node_edit["Update or close<br/>[server.js]"]
  node_delete["Delete opportunity<br/>[server.js]"]
end

subgraph group_storage["Data storage"]
  node_mysql[("Opportunity database<br/>[schema.sql]")]
end

node_user(("Portal user"))

node_user -->|"uses"| node_frontend
node_frontend -->|"requests JSON"| node_api
node_api -->|"routes POST"| node_create
node_api -->|"routes GET"| node_browse
node_api -->|"routes GET by ID"| node_view
node_api -->|"routes PUT"| node_edit
node_api -->|"routes DELETE"| node_delete
node_create -->|"validates input"| node_validation
node_edit -->|"validates merged data"| node_validation
node_create -->|"inserts and reads"| node_mysql
node_browse -->|"reads list"| node_mysql
node_view -->|"reads record"| node_mysql
node_edit -->|"reads and updates"| node_mysql
node_delete -->|"deletes record"| node_mysql

click node_frontend "https://github.com/malik-sani/research-opportunity-portal/blob/main/frontend/script.js"
click node_api "https://github.com/malik-sani/research-opportunity-portal/blob/main/backend/server.js"
click node_validation "https://github.com/malik-sani/research-opportunity-portal/blob/main/backend/server.js"
click node_create "https://github.com/malik-sani/research-opportunity-portal/blob/main/backend/server.js"
click node_browse "https://github.com/malik-sani/research-opportunity-portal/blob/main/backend/server.js"
click node_view "https://github.com/malik-sani/research-opportunity-portal/blob/main/backend/server.js"
click node_edit "https://github.com/malik-sani/research-opportunity-portal/blob/main/backend/server.js"
click node_delete "https://github.com/malik-sani/research-opportunity-portal/blob/main/backend/server.js"
click node_mysql "https://github.com/malik-sani/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_api,node_validation,node_create,node_browse,node_view,node_edit,node_delete toneAmber
class node_mysql toneMint
```

## Components

### Browser interface

- [Opportunity UI](https://github.com/malik-sani/research-opportunity-portal/blob/main/frontend/script.js): `frontend/script.js`

### API service

- [REST API](https://github.com/malik-sani/research-opportunity-portal/blob/main/backend/server.js): `backend/server.js`
- [Request validation](https://github.com/malik-sani/research-opportunity-portal/blob/main/backend/server.js): `backend/server.js`
- [Create opportunity](https://github.com/malik-sani/research-opportunity-portal/blob/main/backend/server.js): `backend/server.js`
- [List opportunities](https://github.com/malik-sani/research-opportunity-portal/blob/main/backend/server.js): `backend/server.js`
- [View opportunity](https://github.com/malik-sani/research-opportunity-portal/blob/main/backend/server.js): `backend/server.js`
- [Update or close](https://github.com/malik-sani/research-opportunity-portal/blob/main/backend/server.js): `backend/server.js`
- [Delete opportunity](https://github.com/malik-sani/research-opportunity-portal/blob/main/backend/server.js): `backend/server.js`

### Data storage

- [Opportunity database](https://github.com/malik-sani/research-opportunity-portal/blob/main/database/schema.sql): `database/schema.sql`

### Other components

- **Portal user**

## Connections

- Portal user → Opportunity UI: uses (evidence: `README.md`)
- Opportunity UI → REST API: requests JSON (evidence: `frontend/script.js`)
- REST API → Create opportunity: routes POST (evidence: `backend/server.js`)
- REST API → List opportunities: routes GET (evidence: `backend/server.js`)
- REST API → View opportunity: routes GET by ID (evidence: `backend/server.js`)
- REST API → Update or close: routes PUT (evidence: `backend/server.js`)
- REST API → Delete opportunity: routes DELETE (evidence: `backend/server.js`)
- Create opportunity → Request validation: validates input (evidence: `backend/server.js`)
- Update or close → Request validation: validates merged data (evidence: `backend/server.js`)
- Create opportunity → Opportunity database: inserts and reads (evidence: `backend/server.js`)
- List opportunities → Opportunity database: reads list (evidence: `backend/server.js`)
- View opportunity → Opportunity database: reads record (evidence: `backend/server.js`)
- Update or close → Opportunity database: reads and updates (evidence: `backend/server.js`)
- Delete opportunity → Opportunity database: deletes record (evidence: `backend/server.js`)
