# omarizagaren/football-physician architecture

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

- Interactive diagram: https://gitdiagram.com/omarizagaren/football-physician
- Repository: https://github.com/omarizagaren/football-physician

## Overview

The repository is a Django football-player injury management and assessment web app. Users register, maintain player profiles and injury histories, request model-based injury-risk estimates, and can submit ACL scans or download a PDF report. The graph preserves those distinct workflows and the prediction feature-extraction layer. Views and prediction internals are only partially sampled, and README is empty, so uncertain wiring is omitted.

Main entry points: [`fyp/website/views.py`](https://github.com/omarizagaren/football-physician/blob/main/fyp/website/views.py) (Request handlers), [`fyp/website/models.py`](https://github.com/omarizagaren/football-physician/blob/main/fyp/website/models.py) (Player and injury records), [`fyp/website/predictions.py`](https://github.com/omarizagaren/football-physician/blob/main/fyp/website/predictions.py) (Risk prediction workflow), [`fyp/website/generatePDF.py`](https://github.com/omarizagaren/football-physician/blob/main/fyp/website/generatePDF.py) (PDF report generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_routes["URL routing<br/>[urls.py]"]
  node_views["Request handlers<br/>[views.py]"]
  node_templates["Web pages"]
end

subgraph group_records["Player records"]
  node_forms["Input forms<br/>[forms.py]"]
  node_playerinjury["Player and injury records<br/>[models.py]"]
  node_database[("PostgreSQL")]
end

subgraph group_assessment["Injury assessment"]
  node_riskflow["Risk prediction workflow<br/>[predictions.py]"]
  node_features["Feature preparation"]
  node_models[("Trained models")]
  node_riskcontent["Risk guidance<br/>[views.py]"]
  node_scan["ACL scan classification<br/>[views.py]"]
end

subgraph group_outputs["Assessment outputs"]
  node_pdf["PDF report generator<br/>[generatePDF.py]"]
  node_report["Risk report"]
end

node_user(("User"))
node_roboflow{{"Roboflow service"}}

node_user -->|"requests pages"| node_routes
node_routes -->|"dispatches"| node_views
node_views -->|"renders"| node_templates
node_views -->|"validates input"| node_forms
node_views -->|"reads and writes"| node_playerinjury
node_playerinjury -->|"persists records"| node_database
node_views -->|"requests prediction"| node_riskflow
node_riskflow -->|"prepares prediction"| node_features
node_features -->|"loads and predicts"| node_models
node_riskflow -->|"reads player history"| node_playerinjury
node_views -->|"selects guidance"| node_riskcontent
node_views -->|"handles ACL scan"| node_scan
node_scan -.->|"classifies image"| node_roboflow
node_views -->|"requests report"| node_pdf
node_pdf -->|"reads report data"| node_playerinjury
node_pdf -->|"generates"| node_report
node_views -->|"returns download"| node_report

click node_routes "https://github.com/omarizagaren/football-physician/blob/main/fyp/website/urls.py"
click node_views "https://github.com/omarizagaren/football-physician/blob/main/fyp/website/views.py"
click node_templates "https://github.com/omarizagaren/football-physician/tree/main/fyp/website/templates"
click node_forms "https://github.com/omarizagaren/football-physician/blob/main/fyp/website/forms.py"
click node_playerinjury "https://github.com/omarizagaren/football-physician/blob/main/fyp/website/models.py"
click node_riskflow "https://github.com/omarizagaren/football-physician/blob/main/fyp/website/predictions.py"
click node_features "https://github.com/omarizagaren/football-physician/blob/main/fyp/website/PredictiveModels/InjuryPrediction.py"
click node_models "https://github.com/omarizagaren/football-physician/tree/main/fyp/website/PredictiveModels"
click node_riskcontent "https://github.com/omarizagaren/football-physician/blob/main/fyp/website/views.py"
click node_scan "https://github.com/omarizagaren/football-physician/blob/main/fyp/website/views.py"
click node_pdf "https://github.com/omarizagaren/football-physician/blob/main/fyp/website/generatePDF.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_routes,node_views,node_templates,node_user toneBlue
class node_forms,node_playerinjury,node_database toneAmber
class node_riskflow,node_features,node_models,node_riskcontent,node_scan toneMint
class node_pdf,node_report toneRose
class node_roboflow toneIndigo
```

## Components

### Web application

- [URL routing](https://github.com/omarizagaren/football-physician/blob/main/fyp/website/urls.py): `fyp/website/urls.py`
- [Request handlers](https://github.com/omarizagaren/football-physician/blob/main/fyp/website/views.py): `fyp/website/views.py`
- [Web pages](https://github.com/omarizagaren/football-physician/tree/main/fyp/website/templates): `fyp/website/templates`

### Player records

- [Input forms](https://github.com/omarizagaren/football-physician/blob/main/fyp/website/forms.py): `fyp/website/forms.py`
- [Player and injury records](https://github.com/omarizagaren/football-physician/blob/main/fyp/website/models.py): `fyp/website/models.py`
- **PostgreSQL**

### Injury assessment

- [Risk prediction workflow](https://github.com/omarizagaren/football-physician/blob/main/fyp/website/predictions.py): `fyp/website/predictions.py`
- [Feature preparation](https://github.com/omarizagaren/football-physician/blob/main/fyp/website/PredictiveModels/InjuryPrediction.py): `fyp/website/PredictiveModels/InjuryPrediction.py`
- [Trained models](https://github.com/omarizagaren/football-physician/tree/main/fyp/website/PredictiveModels): `fyp/website/PredictiveModels`
- [Risk guidance](https://github.com/omarizagaren/football-physician/blob/main/fyp/website/views.py): `fyp/website/views.py`
- [ACL scan classification](https://github.com/omarizagaren/football-physician/blob/main/fyp/website/views.py): `fyp/website/views.py`

### Assessment outputs

- [PDF report generator](https://github.com/omarizagaren/football-physician/blob/main/fyp/website/generatePDF.py): `fyp/website/generatePDF.py`
- **Risk report**

### Other components

- **User**
- **Roboflow service**

## Connections

- User → URL routing: requests pages
- URL routing → Request handlers: dispatches
- Request handlers → Web pages: renders
- Request handlers → Input forms: validates input
- Request handlers → Player and injury records: reads and writes
- Player and injury records → PostgreSQL: persists records
- Request handlers → Risk prediction workflow: requests prediction
- Risk prediction workflow → Feature preparation: prepares prediction
- Feature preparation → Trained models: loads and predicts
- Risk prediction workflow → Player and injury records: reads player history
- Request handlers → Risk guidance: selects guidance
- Request handlers → ACL scan classification: handles ACL scan
- ACL scan classification → Roboflow service: classifies image
- Request handlers → PDF report generator: requests report
- PDF report generator → Player and injury records: reads report data
- PDF report generator → Risk report: generates
- Request handlers → Risk report: returns download
