# wyf09140/salary-advisor architecture

> Architecture diagram of the GitHub repository wyf09140/salary-advisor, 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/wyf09140/salary-advisor
- Repository: https://github.com/wyf09140/salary-advisor

## Overview

This is an evidence-based salary advisor: a candidate supplies a job title, location, salary context, and resume, and receives a market wage range, a comparison point, and skill-pay associations. Its product workflow spans source-data preparation, occupation and geography matching, model fitting and evaluation, then app-side resume parsing and prediction. The graph also preserves baseline estimation and employer-grouped validation. Some model and app wiring is supported by the README and SOURCE INDEX; unsampled implementation details are not expanded into unverified links.

Main entry points: [`src/models/predict.py`](https://github.com/wyf09140/salary-advisor/blob/main/src/models/predict.py) (Prediction and advice), [`src/models/train.py`](https://github.com/wyf09140/salary-advisor/blob/main/src/models/train.py) (Quantile training), [`src/data/clean.py`](https://github.com/wyf09140/salary-advisor/blob/main/src/data/clean.py) (Data cleaning), [`src/models/features.py`](https://github.com/wyf09140/salary-advisor/blob/main/src/models/features.py) (Model features)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_config["Project configuration<br/>[config.py]"]
  node_download["Source downloads<br/>[download.py]"]
  node_clean["Data cleaning<br/>[clean.py]"]
  node_geo["Geography mapping<br/>[geo.py]"]
  node_titles["Title matching<br/>[titles.py]"]
  node_schema["Training schema<br/>[schema.py]"]
  node_dataset[("Processed data")]
end

subgraph group_models["Wage modeling"]
  node_baseline["BLS baseline<br/>[baseline.py]"]
  node_split["Employer splits<br/>[split.py]"]
  node_features["Model features<br/>[features.py]"]
  node_train["Quantile training<br/>[train.py]"]
  node_xgb["Model experiments<br/>[xgb.py]"]
  node_evaluate["Model evaluation<br/>[evaluate.py]"]
  node_skills["Skill associations<br/>[skills.py]"]
  node_artifact[("Trained model artifact<br/>[train.py]")]
end

subgraph group_app["Candidate advisor"]
  node_resume["Resume parser<br/>[resume_parser.py]"]
  node_ui["Advisor interface<br/>[app.py]"]
  node_predict["Prediction and advice<br/>[predict.py]"]
end

node_candidate(("Candidate"))
node_sources["Data sources"]
node_result["Salary and skill advice"]

node_sources -->|"provides files"| node_download
node_download -->|"reads settings"| node_config
node_clean -->|"reads settings"| node_config
node_clean -->|"uses mapping"| node_geo
node_clean -->|"matches titles"| node_titles
node_clean -->|"uses schema"| node_schema
node_clean -->|"writes dataset"| node_dataset
node_candidate -->|"submits profile"| node_ui
node_ui -->|"parses resume"| node_resume
node_ui -->|"requests advice"| node_predict
node_dataset -->|"training input"| node_train
node_train -->|"assigns folds"| node_split
node_train -->|"builds features"| node_features
node_features -->|"gets BLS quantiles"| node_baseline
node_train -->|"saves model"| node_artifact
node_evaluate -->|"fits models"| node_train
node_predict -->|"loads model"| node_artifact
node_predict -->|"maps title"| node_titles
node_predict -->|"maps location"| node_geo
node_predict -->|"gets BLS fallback"| node_baseline
node_predict -->|"builds features"| node_features
node_predict -->|"predicts quantiles"| node_train
node_predict -->|"ranks skills"| node_skills
node_ui -->|"presents advice"| node_result
node_xgb -->|"uses features"| node_features
node_xgb -->|"uses evaluation"| node_evaluate
node_skills -->|"uses controls"| node_features

click node_config "https://github.com/wyf09140/salary-advisor/blob/main/src/config.py"
click node_download "https://github.com/wyf09140/salary-advisor/blob/main/src/data/download.py"
click node_clean "https://github.com/wyf09140/salary-advisor/blob/main/src/data/clean.py"
click node_geo "https://github.com/wyf09140/salary-advisor/blob/main/src/data/geo.py"
click node_titles "https://github.com/wyf09140/salary-advisor/blob/main/src/data/titles.py"
click node_schema "https://github.com/wyf09140/salary-advisor/blob/main/src/data/schema.py"
click node_dataset "https://github.com/wyf09140/salary-advisor/tree/main/data/processed"
click node_baseline "https://github.com/wyf09140/salary-advisor/blob/main/src/data/baseline.py"
click node_split "https://github.com/wyf09140/salary-advisor/blob/main/src/models/split.py"
click node_features "https://github.com/wyf09140/salary-advisor/blob/main/src/models/features.py"
click node_train "https://github.com/wyf09140/salary-advisor/blob/main/src/models/train.py"
click node_xgb "https://github.com/wyf09140/salary-advisor/blob/main/src/models/xgb.py"
click node_evaluate "https://github.com/wyf09140/salary-advisor/blob/main/src/models/evaluate.py"
click node_skills "https://github.com/wyf09140/salary-advisor/blob/main/src/models/skills.py"
click node_resume "https://github.com/wyf09140/salary-advisor/blob/main/src/app/resume_parser.py"
click node_ui "https://github.com/wyf09140/salary-advisor/blob/main/src/app/app.py"
click node_predict "https://github.com/wyf09140/salary-advisor/blob/main/src/models/predict.py"
click node_artifact "https://github.com/wyf09140/salary-advisor/blob/main/src/models/train.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_config,node_download,node_clean,node_geo,node_titles,node_schema,node_dataset toneBlue
class node_baseline,node_split,node_features,node_train,node_xgb,node_evaluate,node_skills,node_artifact toneAmber
class node_resume,node_ui,node_predict toneMint
class node_candidate,node_sources,node_result toneIndigo
```

## Components

### Data preparation

- [Project configuration](https://github.com/wyf09140/salary-advisor/blob/main/src/config.py): `src/config.py`
- [Source downloads](https://github.com/wyf09140/salary-advisor/blob/main/src/data/download.py): `src/data/download.py`
- [Data cleaning](https://github.com/wyf09140/salary-advisor/blob/main/src/data/clean.py): `src/data/clean.py`
- [Geography mapping](https://github.com/wyf09140/salary-advisor/blob/main/src/data/geo.py): `src/data/geo.py`
- [Title matching](https://github.com/wyf09140/salary-advisor/blob/main/src/data/titles.py): `src/data/titles.py`
- [Training schema](https://github.com/wyf09140/salary-advisor/blob/main/src/data/schema.py): `src/data/schema.py`
- [Processed data](https://github.com/wyf09140/salary-advisor/tree/main/data/processed): `data/processed`

### Wage modeling

- [BLS baseline](https://github.com/wyf09140/salary-advisor/blob/main/src/data/baseline.py): `src/data/baseline.py`
- [Employer splits](https://github.com/wyf09140/salary-advisor/blob/main/src/models/split.py): `src/models/split.py`
- [Model features](https://github.com/wyf09140/salary-advisor/blob/main/src/models/features.py): `src/models/features.py`
- [Quantile training](https://github.com/wyf09140/salary-advisor/blob/main/src/models/train.py): `src/models/train.py`
- [Model experiments](https://github.com/wyf09140/salary-advisor/blob/main/src/models/xgb.py): `src/models/xgb.py`
- [Model evaluation](https://github.com/wyf09140/salary-advisor/blob/main/src/models/evaluate.py): `src/models/evaluate.py`
- [Skill associations](https://github.com/wyf09140/salary-advisor/blob/main/src/models/skills.py): `src/models/skills.py`
- [Trained model artifact](https://github.com/wyf09140/salary-advisor/blob/main/src/models/train.py): `src/models/train.py`

### Candidate advisor

- [Resume parser](https://github.com/wyf09140/salary-advisor/blob/main/src/app/resume_parser.py): `src/app/resume_parser.py`
- [Advisor interface](https://github.com/wyf09140/salary-advisor/blob/main/src/app/app.py): `src/app/app.py`
- [Prediction and advice](https://github.com/wyf09140/salary-advisor/blob/main/src/models/predict.py): `src/models/predict.py`

### Other components

- **Candidate**
- **Data sources**
- **Salary and skill advice**

## Connections

- Data sources → Source downloads: provides files (evidence: `README.md`)
- Source downloads → Project configuration: reads settings (evidence: `src/data/download.py`)
- Data cleaning → Project configuration: reads settings (evidence: `src/data/clean.py`)
- Data cleaning → Geography mapping: uses mapping (evidence: `src/data/clean.py`)
- Data cleaning → Title matching: matches titles (evidence: `src/data/clean.py`)
- Data cleaning → Training schema: uses schema (evidence: `src/data/clean.py`)
- Data cleaning → Processed data: writes dataset (evidence: `src/data/clean.py`)
- Candidate → Advisor interface: submits profile (evidence: `README.md`)
- Advisor interface → Resume parser: parses resume (evidence: `src/app/app.py`)
- Advisor interface → Prediction and advice: requests advice (evidence: `src/app/app.py`)
- Processed data → Quantile training: training input (evidence: `README.md`)
- Quantile training → Employer splits: assigns folds (evidence: `src/models/train.py`)
- Quantile training → Model features: builds features (evidence: `src/models/train.py`)
- Model features → BLS baseline: gets BLS quantiles (evidence: `src/models/features.py`)
- Quantile training → Trained model artifact: saves model (evidence: `src/models/train.py`)
- Model evaluation → Quantile training: fits models (evidence: `src/models/evaluate.py`)
- Prediction and advice → Trained model artifact: loads model (evidence: `src/models/predict.py`)
- Prediction and advice → Title matching: maps title (evidence: `src/models/predict.py`)
- Prediction and advice → Geography mapping: maps location (evidence: `src/models/predict.py`)
- Prediction and advice → BLS baseline: gets BLS fallback (evidence: `src/models/predict.py`)
- Prediction and advice → Model features: builds features (evidence: `src/models/predict.py`)
- Prediction and advice → Quantile training: predicts quantiles (evidence: `src/models/predict.py`)
- Prediction and advice → Skill associations: ranks skills (evidence: `src/models/predict.py`)
- Advisor interface → Salary and skill advice: presents advice (evidence: `README.md`)
- Model experiments → Model features: uses features (evidence: `src/models/xgb.py`)
- Model experiments → Model evaluation: uses evaluation (evidence: `src/models/xgb.py`)
- Skill associations → Model features: uses controls (evidence: `src/models/skills.py`)
