# neeraj9814/mental-health-prd architecture

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

- Interactive diagram: https://gitdiagram.com/neeraj9814/mental-health-prd
- Repository: https://github.com/neeraj9814/mental-health-prd

## Overview

Mansik-Santulan-Score is a web app that estimates a mental-health score from student and social-media-use inputs. A user fills the browser form; its JavaScript validates and submits the fields to a prediction API, which prepares model input and returns a score for display. The repository also contains a dataset and notebook, suggesting an offline model-development branch, but their contents and links to the saved model were not sampled. The README documents no further capabilities.

Main entry points: [`main.py`](https://github.com/neeraj9814/mental-health-prd/blob/main/main.py) (Prediction endpoint), [`script.js`](https://github.com/neeraj9814/mental-health-prd/blob/main/script.js) (Form interaction), [`ML_Project.ipynb`](https://github.com/neeraj9814/mental-health-prd/blob/main/ML_Project.ipynb) (Model notebook), [`index.html`](https://github.com/neeraj9814/mental-health-prd/blob/main/index.html) (Input form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_form["Input form<br/>[index.html]"]
  node_browser["Form interaction<br/>[script.js]"]
  node_validation["Input validation<br/>[script.js]"]
  node_score_view["Score display<br/>[script.js]"]
end

subgraph group_api["Prediction API"]
  node_api_endpoint["Prediction endpoint<br/>[main.py]"]
  node_input_schema["Request schema<br/>[main.py]"]
  node_feature_prep["Feature preparation<br/>[main.py]"]
  node_inference["Model inference<br/>[main.py]"]
  node_response["Score response<br/>[main.py]"]
end

subgraph group_modeling["Model assets"]
  node_model["Trained model"]
  node_training_notebook["Model notebook<br/>[ML_Project.ipynb]"]
  node_student_data["Student dataset"]
end

node_user(("User"))

node_user -->|"enters data"| node_form
node_form -->|"interacts with"| node_browser
node_browser -->|"validates"| node_validation
node_browser -->|"posts inputs"| node_api_endpoint
node_api_endpoint -->|"accepts request"| node_input_schema
node_api_endpoint -->|"prepares features"| node_feature_prep
node_api_endpoint -->|"calls prediction"| node_inference
node_inference -->|"loads and predicts"| node_model
node_api_endpoint -->|"returns score"| node_response
node_browser -->|"renders result"| node_score_view
node_training_notebook -.-> node_student_data
node_training_notebook -.-> node_model

click node_form "https://github.com/neeraj9814/mental-health-prd/blob/main/index.html"
click node_browser "https://github.com/neeraj9814/mental-health-prd/blob/main/script.js"
click node_validation "https://github.com/neeraj9814/mental-health-prd/blob/main/script.js"
click node_score_view "https://github.com/neeraj9814/mental-health-prd/blob/main/script.js"
click node_api_endpoint "https://github.com/neeraj9814/mental-health-prd/blob/main/main.py"
click node_input_schema "https://github.com/neeraj9814/mental-health-prd/blob/main/main.py"
click node_feature_prep "https://github.com/neeraj9814/mental-health-prd/blob/main/main.py"
click node_inference "https://github.com/neeraj9814/mental-health-prd/blob/main/main.py"
click node_response "https://github.com/neeraj9814/mental-health-prd/blob/main/main.py"
click node_model "https://github.com/neeraj9814/mental-health-prd/blob/main/Mental_Health_Model.pkl"
click node_training_notebook "https://github.com/neeraj9814/mental-health-prd/blob/main/ML_Project.ipynb"
click node_student_data "https://github.com/neeraj9814/mental-health-prd/blob/main/Student%20Social%20Media%20And%20Mental%20Health%20Impact.csv"

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_form,node_browser,node_validation,node_score_view,node_user toneBlue
class node_api_endpoint,node_input_schema,node_feature_prep,node_inference,node_response toneAmber
class node_model,node_training_notebook,node_student_data toneMint
```

## Components

### Web interface

- [Input form](https://github.com/neeraj9814/mental-health-prd/blob/main/index.html): `index.html`
- [Form interaction](https://github.com/neeraj9814/mental-health-prd/blob/main/script.js): `script.js`
- [Input validation](https://github.com/neeraj9814/mental-health-prd/blob/main/script.js): `script.js`
- [Score display](https://github.com/neeraj9814/mental-health-prd/blob/main/script.js): `script.js`

### Prediction API

- [Prediction endpoint](https://github.com/neeraj9814/mental-health-prd/blob/main/main.py): `main.py`
- [Request schema](https://github.com/neeraj9814/mental-health-prd/blob/main/main.py): `main.py`
- [Feature preparation](https://github.com/neeraj9814/mental-health-prd/blob/main/main.py): `main.py`
- [Model inference](https://github.com/neeraj9814/mental-health-prd/blob/main/main.py): `main.py`
- [Score response](https://github.com/neeraj9814/mental-health-prd/blob/main/main.py): `main.py`

### Model assets

- [Trained model](https://github.com/neeraj9814/mental-health-prd/blob/main/Mental_Health_Model.pkl): `Mental_Health_Model.pkl`
- [Model notebook](https://github.com/neeraj9814/mental-health-prd/blob/main/ML_Project.ipynb): `ML_Project.ipynb`
- [Student dataset](https://github.com/neeraj9814/mental-health-prd/blob/main/Student%20Social%20Media%20And%20Mental%20Health%20Impact.csv): `Student Social Media And Mental Health Impact.csv`

### Other components

- **User**

## Connections

- User → Input form: enters data
- Input form → Form interaction: interacts with (evidence: `script.js`)
- Form interaction → Input validation: validates (evidence: `script.js`)
- Form interaction → Prediction endpoint: posts inputs (evidence: `script.js`)
- Prediction endpoint → Request schema: accepts request (evidence: `main.py`)
- Prediction endpoint → Feature preparation: prepares features (evidence: `main.py`)
- Prediction endpoint → Model inference: calls prediction (evidence: `main.py`)
- Model inference → Trained model: loads and predicts (evidence: `main.py`)
- Prediction endpoint → Score response: returns score (evidence: `main.py`)
- Form interaction → Score display: renders result (evidence: `script.js`)
- Model notebook → Student dataset
- Model notebook → Trained model
