# kgajula2/kgajula2-autism_detection_using_ml architecture

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

- Interactive diagram: https://gitdiagram.com/kgajula2/kgajula2-autism_detection_using_ml
- Repository: https://github.com/kgajula2/kgajula2-autism_detection_using_ml

## Overview

Engagnition is a browser-based autism screening platform: users enter through the React app, complete interactive games, record game-session metrics, and receive ML-based risk analysis and progress views. The main runtime path is routed game play through session handling to persistence and inference, with dashboard reporting afterward. The README also describes a Python model-training workflow and browser-side vision features. Some subsystems are represented from README claims or the source index rather than inspected implementation; uncertain links are omitted.

Main entry points: [`src/hooks/useGameSession.js`](https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/hooks/useGameSession.js) (Game session handler), [`src/App.jsx`](https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/App.jsx) (React app routes), [`src/services/db.js`](https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/services/db.js) (Screening metrics), [`src/games/attention-call/AttentionCallGame.jsx`](https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/games/attention-call/AttentionCallGame.jsx) (Attention Call)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_app["React app routes<br/>[App.jsx]"]
  node_dashboard["Progress dashboard<br/>[Dashboard.jsx]"]
  node_game_picker["Game selection<br/>[GameSelection.jsx]"]
  node_ml_explainer["Analysis explainer<br/>[MLExplainer.jsx]"]
end

subgraph group_assessment["Screening assessment"]
  node_session_hook["Game session handler<br/>[useGameSession.js]"]
  node_game_store["Screening progress state<br/>[gameStore.js]"]
  node_attention_game["Attention Call"]
  node_shape_game["Shape Switch"]
  node_other_games["Other cognitive games"]
  node_game_config["Game feature configuration<br/>[gameConfig.js]"]
  node_vision["Vision services<br/>[vision.js]"]
end

subgraph group_analysis["Analytics and inference"]
  node_ml_service["Risk analysis service<br/>[ml.js]"]
  node_model_weights["Model weights"]
  node_dashboard_data["Screening metrics<br/>[db.js]"]
end

subgraph group_platform["Identity and data"]
  node_auth_hook["Firebase auth state<br/>[useAuth.js]"]
  node_auth_service["Authentication service<br/>[auth.js]"]
  node_firebase["Firebase services<br/>[firebase.js]"]
  node_firestore[("Firebase data store")]
end

subgraph group_training["Model training"]
  node_training_script["Model training pipeline<br/>[train_model.py]"]
  node_clinical_data["Clinical screening datasets"]
end

node_user(("User / caregiver"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_game_picker
node_app -->|"routes to"| node_attention_game
node_app -->|"routes to"| node_shape_game
node_game_picker -->|"reads progress"| node_game_store
node_attention_game -->|"starts / ends"| node_session_hook
node_shape_game -->|"starts / ends"| node_session_hook
node_session_hook -->|"checks identity"| node_auth_hook
node_session_hook -->|"writes session metrics"| node_dashboard_data
node_session_hook -->|"requests analysis"| node_ml_service
node_session_hook -->|"marks completed game"| node_game_store
node_attention_game -->|"initializes face mesh"| node_vision
node_attention_game -->|"reads profile and stats"| node_dashboard_data
node_dashboard -->|"reads history"| node_dashboard_data
node_ml_explainer -->|"reads session data"| node_dashboard_data
node_ml_service -->|"uses feature mapping"| node_game_config
node_ml_service -->|"loads model"| node_model_weights
node_dashboard_data -.->|"persists screening data"| node_firestore
node_auth_service -->|"uses Firebase"| node_firebase
node_firebase -.->|"provides backend"| node_firestore
node_training_script -.->|"trains on"| node_clinical_data
node_training_script -.->|"produces model"| node_model_weights

click node_app "https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/App.jsx"
click node_dashboard "https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/pages/Dashboard.jsx"
click node_game_picker "https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/pages/GameSelection.jsx"
click node_ml_explainer "https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/components/ml/MLExplainer.jsx"
click node_session_hook "https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/hooks/useGameSession.js"
click node_game_store "https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/store/gameStore.js"
click node_attention_game "https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/games/attention-call/AttentionCallGame.jsx"
click node_shape_game "https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/games/shape-switch/ShapeSwitchGame.jsx"
click node_other_games "https://github.com/kgajula2/kgajula2-autism_detection_using_ml/tree/main/src/games"
click node_game_config "https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/config/gameConfig.js"
click node_vision "https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/services/vision.js"
click node_ml_service "https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/services/ml.js"
click node_dashboard_data "https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/services/db.js"
click node_auth_hook "https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/hooks/useAuth.js"
click node_auth_service "https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/services/auth.js"
click node_firebase "https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/services/firebase.js"
click node_training_script "https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/scripts/train_model.py"

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_app,node_dashboard,node_game_picker,node_ml_explainer,node_user toneBlue
class node_session_hook,node_game_store,node_attention_game,node_shape_game,node_other_games,node_game_config,node_vision toneAmber
class node_ml_service,node_model_weights,node_dashboard_data toneMint
class node_auth_hook,node_auth_service,node_firebase,node_firestore toneRose
class node_training_script,node_clinical_data toneIndigo
```

## Components

### User experience

- [React app routes](https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/App.jsx): `src/App.jsx`
- [Progress dashboard](https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Game selection](https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/pages/GameSelection.jsx): `src/pages/GameSelection.jsx`
- [Analysis explainer](https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/components/ml/MLExplainer.jsx): `src/components/ml/MLExplainer.jsx`

### Screening assessment

- [Game session handler](https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/hooks/useGameSession.js): `src/hooks/useGameSession.js`
- [Screening progress state](https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/store/gameStore.js): `src/store/gameStore.js`
- [Attention Call](https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/games/attention-call/AttentionCallGame.jsx): `src/games/attention-call/AttentionCallGame.jsx`
- [Shape Switch](https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/games/shape-switch/ShapeSwitchGame.jsx): `src/games/shape-switch/ShapeSwitchGame.jsx`
- [Other cognitive games](https://github.com/kgajula2/kgajula2-autism_detection_using_ml/tree/main/src/games): `src/games`
- [Game feature configuration](https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/config/gameConfig.js): `src/config/gameConfig.js`
- [Vision services](https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/services/vision.js): `src/services/vision.js`

### Analytics and inference

- [Risk analysis service](https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/services/ml.js): `src/services/ml.js`
- **Model weights**
- [Screening metrics](https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/services/db.js): `src/services/db.js`

### Identity and data

- [Firebase auth state](https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/hooks/useAuth.js): `src/hooks/useAuth.js`
- [Authentication service](https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/services/auth.js): `src/services/auth.js`
- [Firebase services](https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/src/services/firebase.js): `src/services/firebase.js`
- **Firebase data store**

### Model training

- [Model training pipeline](https://github.com/kgajula2/kgajula2-autism_detection_using_ml/blob/main/scripts/train_model.py): `scripts/train_model.py`
- **Clinical screening datasets**

### Other components

- **User / caregiver**

## Connections

- User / caregiver → React app routes: uses
- React app routes → Progress dashboard: routes to (evidence: `src/App.jsx`)
- React app routes → Game selection: routes to (evidence: `src/App.jsx`)
- React app routes → Attention Call: routes to (evidence: `src/App.jsx`)
- React app routes → Shape Switch: routes to (evidence: `src/App.jsx`)
- Game selection → Screening progress state: reads progress (evidence: `src/pages/GameSelection.jsx`)
- Attention Call → Game session handler: starts / ends (evidence: `src/games/attention-call/AttentionCallGame.jsx`)
- Shape Switch → Game session handler: starts / ends (evidence: `src/games/shape-switch/ShapeSwitchGame.jsx`)
- Game session handler → Firebase auth state: checks identity (evidence: `src/hooks/useGameSession.js`)
- Game session handler → Screening metrics: writes session metrics (evidence: `src/hooks/useGameSession.js`)
- Game session handler → Risk analysis service: requests analysis (evidence: `src/hooks/useGameSession.js`)
- Game session handler → Screening progress state: marks completed game (evidence: `src/hooks/useGameSession.js`)
- Attention Call → Vision services: initializes face mesh (evidence: `src/games/attention-call/AttentionCallGame.jsx`)
- Attention Call → Screening metrics: reads profile and stats (evidence: `src/games/attention-call/AttentionCallGame.jsx`)
- Progress dashboard → Screening metrics: reads history (evidence: `src/pages/Dashboard.jsx`)
- Analysis explainer → Screening metrics: reads session data (evidence: `src/components/ml/MLExplainer.jsx`)
- Risk analysis service → Game feature configuration: uses feature mapping (evidence: `src/services/ml.js`)
- Risk analysis service → Model weights: loads model (evidence: `src/services/ml.js`)
- Screening metrics → Firebase data store: persists screening data
- Authentication service → Firebase services: uses Firebase (evidence: `src/services/auth.js`)
- Firebase services → Firebase data store: provides backend
- Model training pipeline → Clinical screening datasets: trains on
- Model training pipeline → Model weights: produces model
