# danyaelavungshenmang999-debug/sepak-takraw architecture

> Architecture diagram of the GitHub repository danyaelavungshenmang999-debug/sepak-takraw, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/danyaelavungshenmang999-debug/sepak-takraw
- Repository: https://github.com/danyaelavungshenmang999-debug/sepak-takraw

## Overview

Sepak Takraw Data Mining & Analytics is a React/FastAPI application for exploring verified 2024 ISTAF World Cup records and team analytics. Users enter through tournament pages, which request data through the API client and backend routes; analytics includes clustering, PCA, model evaluation, and match-winner prediction. Backend routes read relational records, while mining modules also use configured CSV data. The source index and excerpts establish key calls and registrations; frontend-to-backend HTTP links are shown as unverified because the wiring is not explicit in the excerpts.

Main entry points: [`backend/app/routes/analytics.py`](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/routes/analytics.py) (Analytics routes), [`backend/app/main.py`](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/main.py) (FastAPI application), [`frontend/src/App.jsx`](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/frontend/src/App.jsx) (Route application), [`backend/app/database.py`](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/database.py) (SQL database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["Route application<br/>[App.jsx]"]
  node_home["Tournament home<br/>[Home.jsx]"]
  node_analytics_page["Analytics page<br/>[Analytics.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_other_pages["Browse pages"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["API and domain"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_match_routes["Match routes<br/>[matches.py]"]
  node_domain_routes["Tournament routes"]
  node_analytics_routes["Analytics routes<br/>[analytics.py]"]
  node_source_routes["Source routes<br/>[sources.py]"]
end

subgraph group_records["Tournament records"]
  node_database[("SQL database<br/>[database.py]")]
  node_orm_models["Tournament records"]
  node_source_service["Source service<br/>[source_service.py]"]
end

subgraph group_mining["Data mining"]
  node_feature_engineering["Feature engineering"]
  node_clustering["Team clustering<br/>[clustering.py]"]
  node_pca["PCA analysis<br/>[pca.py]"]
  node_classification["Model evaluation<br/>[classification.py]"]
  node_prediction["Match prediction<br/>[prediction.py]"]
  node_evaluation["Evaluation metrics<br/>[evaluation.py]"]
end

node_visitor(("Tournament visitor"))

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_analytics_page
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_other_pages
node_home -->|"requests data"| node_api_client
node_dashboard -->|"requests data"| node_api_client
node_analytics_page -.->|"requests analytics"| node_api_client
node_api_client -.->|"calls HTTP API"| node_api_app
node_api_app -->|"registers"| node_match_routes
node_api_app -->|"registers"| node_domain_routes
node_api_app -->|"registers"| node_analytics_routes
node_api_app -->|"registers"| node_source_routes
node_api_app -->|"initializes"| node_database
node_match_routes -->|"queries"| node_database
node_match_routes -->|"reads matches, teams"| node_orm_models
node_domain_routes -.->|"queries"| node_database
node_analytics_routes -->|"loads records"| node_database
node_source_routes -.->|"uses"| node_source_service
node_database -->|"registers tables"| node_orm_models
node_analytics_routes -->|"calls"| node_clustering
node_analytics_routes -->|"calls"| node_pca
node_analytics_routes -->|"calls"| node_classification
node_analytics_routes -->|"calls"| node_prediction
node_analytics_routes -.->|"calls"| node_evaluation
node_feature_engineering -.->|"prepares features"| node_clustering
node_feature_engineering -.->|"builds match features"| node_prediction

click node_app "https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/frontend/src/App.jsx"
click node_home "https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/frontend/src/pages/Home.jsx"
click node_analytics_page "https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/frontend/src/pages/Analytics.jsx"
click node_dashboard "https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/frontend/src/pages/Dashboard.jsx"
click node_other_pages "https://github.com/danyaelavungshenmang999-debug/sepak-takraw/tree/main/frontend/src/pages"
click node_api_client "https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/frontend/src/services/api.js"
click node_api_app "https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/main.py"
click node_match_routes "https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/routes/matches.py"
click node_domain_routes "https://github.com/danyaelavungshenmang999-debug/sepak-takraw/tree/main/backend/app/routes"
click node_analytics_routes "https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/routes/analytics.py"
click node_source_routes "https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/routes/sources.py"
click node_database "https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/database.py"
click node_orm_models "https://github.com/danyaelavungshenmang999-debug/sepak-takraw/tree/main/backend/app/models"
click node_source_service "https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/services/source_service.py"
click node_feature_engineering "https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/services/feature_engineering.py"
click node_clustering "https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/mining/clustering.py"
click node_pca "https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/mining/pca.py"
click node_classification "https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/mining/classification.py"
click node_prediction "https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/mining/prediction.py"
click node_evaluation "https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/mining/evaluation.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_home,node_analytics_page,node_dashboard,node_other_pages,node_api_client toneBlue
class node_api_app,node_match_routes,node_domain_routes,node_analytics_routes,node_source_routes toneAmber
class node_database,node_orm_models,node_source_service toneMint
class node_feature_engineering,node_clustering,node_pca,node_classification,node_prediction,node_evaluation toneRose
class node_visitor toneIndigo
```

## Components

### Web experience

- [Route application](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Tournament home](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Analytics page](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/frontend/src/pages/Analytics.jsx): `frontend/src/pages/Analytics.jsx`
- [Dashboard](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Browse pages](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/tree/main/frontend/src/pages): `frontend/src/pages`
- [API client](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### API and domain

- [FastAPI application](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/main.py): `backend/app/main.py`
- [Match routes](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/routes/matches.py): `backend/app/routes/matches.py`
- [Tournament routes](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/tree/main/backend/app/routes): `backend/app/routes`
- [Analytics routes](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/routes/analytics.py): `backend/app/routes/analytics.py`
- [Source routes](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/routes/sources.py): `backend/app/routes/sources.py`

### Tournament records

- [SQL database](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/database.py): `backend/app/database.py`
- [Tournament records](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/tree/main/backend/app/models): `backend/app/models`
- [Source service](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/services/source_service.py): `backend/app/services/source_service.py`

### Data mining

- [Feature engineering](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/services/feature_engineering.py): `backend/app/services/feature_engineering.py`
- [Team clustering](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/mining/clustering.py): `backend/app/mining/clustering.py`
- [PCA analysis](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/mining/pca.py): `backend/app/mining/pca.py`
- [Model evaluation](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/mining/classification.py): `backend/app/mining/classification.py`
- [Match prediction](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/mining/prediction.py): `backend/app/mining/prediction.py`
- [Evaluation metrics](https://github.com/danyaelavungshenmang999-debug/sepak-takraw/blob/main/backend/app/mining/evaluation.py): `backend/app/mining/evaluation.py`

### Other components

- **Tournament visitor**

## Connections

- Tournament visitor → Route application: opens (evidence: `frontend/src/App.jsx`)
- Route application → Tournament home: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Analytics page: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Browse pages: routes to (evidence: `frontend/src/App.jsx`)
- Tournament home → API client: requests data (evidence: `frontend/src/pages/Home.jsx`)
- Dashboard → API client: requests data (evidence: `frontend/src/pages/Dashboard.jsx`)
- Analytics page → API client: requests analytics
- API client → FastAPI application: calls HTTP API
- FastAPI application → Match routes: registers (evidence: `backend/app/main.py`)
- FastAPI application → Tournament routes: registers (evidence: `backend/app/main.py`)
- FastAPI application → Analytics routes: registers (evidence: `backend/app/main.py`)
- FastAPI application → Source routes: registers (evidence: `backend/app/main.py`)
- FastAPI application → SQL database: initializes (evidence: `backend/app/main.py`)
- Match routes → SQL database: queries (evidence: `backend/app/routes/matches.py`)
- Match routes → Tournament records: reads matches, teams (evidence: `backend/app/routes/matches.py`)
- Tournament routes → SQL database: queries (evidence: `backend/app/routes/matches.py`)
- Analytics routes → SQL database: loads records (evidence: `backend/app/routes/analytics.py`)
- Source routes → Source service: uses
- SQL database → Tournament records: registers tables (evidence: `backend/app/database.py`)
- Analytics routes → Team clustering: calls (evidence: `backend/app/routes/analytics.py`)
- Analytics routes → PCA analysis: calls (evidence: `backend/app/routes/analytics.py`)
- Analytics routes → Model evaluation: calls (evidence: `backend/app/routes/analytics.py`)
- Analytics routes → Match prediction: calls (evidence: `backend/app/routes/analytics.py`)
- Analytics routes → Evaluation metrics: calls
- Feature engineering → Team clustering: prepares features
- Feature engineering → Match prediction: builds match features
