# rishijawale/mansik_santulan_score architecture

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

- Interactive diagram: https://gitdiagram.com/rishijawale/mansik_santulan_score
- Repository: https://github.com/rishijawale/mansik_santulan_score

## Overview

Mansik Santulan Score is a browser-based student wellness scoring app backed by a FastAPI inference API and a serialized scikit-learn model. The workflow runs from form entry and client-side validation through API request validation, country feature grouping, model inference, and score display in an animated gauge. The README also documents responsive UI and error/retry behavior. Main backend and JavaScript excerpts support the shown calls; HTML structure and model internals were not sampled, so their implementation details are not expanded.

Main entry points: [`main.py`](https://github.com/rishijawale/mansik_santulan_score/blob/main/main.py) (FastAPI endpoints), [`script.js`](https://github.com/rishijawale/mansik_santulan_score/blob/main/script.js) (Form interaction), [`index.html`](https://github.com/rishijawale/mansik_santulan_score/blob/main/index.html) (Wellness form), [`Mental_health_model.pkl`](https://github.com/rishijawale/mansik_santulan_score/blob/main/Mental_health_model.pkl) (Serialized model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_form["Wellness form<br/>[index.html]"]
  node_client["Form interaction<br/>[script.js]"]
  node_validation["Input validation<br/>[script.js]"]
  node_result["Score gauge<br/>[script.js]"]
end

subgraph group_inference["Prediction service"]
  node_api["FastAPI endpoints<br/>[main.py]"]
  node_request["Request validation<br/>[main.py]"]
  node_features["Feature preparation<br/>[main.py]"]
end

subgraph group_model["Scoring model"]
  node_model["Serialized model"]
end

node_student(("Student"))
node_dataset["Student dataset"]

node_student -->|"enters details"| node_form
node_form -->|"provides fields"| node_client
node_client -->|"validates locally"| node_validation
node_client -->|"POST /predict"| node_api
node_api -->|"validates request"| node_request
node_api -->|"prepares features"| node_features
node_api -->|"predicts with"| node_model
node_api -->|"returns score"| node_client
node_client -->|"renders score"| node_result

click node_form "https://github.com/rishijawale/mansik_santulan_score/blob/main/index.html"
click node_client "https://github.com/rishijawale/mansik_santulan_score/blob/main/script.js"
click node_validation "https://github.com/rishijawale/mansik_santulan_score/blob/main/script.js"
click node_result "https://github.com/rishijawale/mansik_santulan_score/blob/main/script.js"
click node_api "https://github.com/rishijawale/mansik_santulan_score/blob/main/main.py"
click node_request "https://github.com/rishijawale/mansik_santulan_score/blob/main/main.py"
click node_features "https://github.com/rishijawale/mansik_santulan_score/blob/main/main.py"
click node_model "https://github.com/rishijawale/mansik_santulan_score/blob/main/Mental_health_model.pkl"
click node_dataset "https://github.com/rishijawale/mansik_santulan_score/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_client,node_validation,node_result toneBlue
class node_api,node_request,node_features toneAmber
class node_model toneMint
class node_student toneIndigo
class node_dataset toneTeal
```

## Components

### Web experience

- [Wellness form](https://github.com/rishijawale/mansik_santulan_score/blob/main/index.html): `index.html`
- [Form interaction](https://github.com/rishijawale/mansik_santulan_score/blob/main/script.js): `script.js`
- [Input validation](https://github.com/rishijawale/mansik_santulan_score/blob/main/script.js): `script.js`
- [Score gauge](https://github.com/rishijawale/mansik_santulan_score/blob/main/script.js): `script.js`

### Prediction service

- [FastAPI endpoints](https://github.com/rishijawale/mansik_santulan_score/blob/main/main.py): `main.py`
- [Request validation](https://github.com/rishijawale/mansik_santulan_score/blob/main/main.py): `main.py`
- [Feature preparation](https://github.com/rishijawale/mansik_santulan_score/blob/main/main.py): `main.py`

### Scoring model

- [Serialized model](https://github.com/rishijawale/mansik_santulan_score/blob/main/Mental_health_model.pkl): `Mental_health_model.pkl`

### Other components

- **Student**
- [Student dataset](https://github.com/rishijawale/mansik_santulan_score/blob/main/Student%20Social%20Media%20And%20Mental%20Health%20Impact.csv): `Student Social Media And Mental Health Impact.csv`

## Connections

- Student → Wellness form: enters details (evidence: `README.md`)
- Wellness form → Form interaction: provides fields (evidence: `README.md`)
- Form interaction → Input validation: validates locally (evidence: `script.js`)
- Form interaction → FastAPI endpoints: POST /predict (evidence: `script.js`)
- FastAPI endpoints → Request validation: validates request (evidence: `main.py`)
- FastAPI endpoints → Feature preparation: prepares features (evidence: `main.py`)
- FastAPI endpoints → Serialized model: predicts with (evidence: `main.py`)
- FastAPI endpoints → Form interaction: returns score (evidence: `README.md`)
- Form interaction → Score gauge: renders score (evidence: `script.js`)
