# lakshagrawal28/biascraft architecture

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

- Interactive diagram: https://gitdiagram.com/lakshagrawal28/biascraft
- Repository: https://github.com/lakshagrawal28/biascraft

## Overview

BiasCraft lets users tune education, experience, and location weights, run a hiring simulation, and inspect accuracy, fairness, selection rates, bias alerts, charts, and sampled candidates. The React app owns the request and result presentation; FastAPI scores the dataset, selects candidates, computes metrics, and returns a sample. Dataset generation and the principal frontend/API path are supported by excerpts and README; the candidate JSON is a runtime data store. Other documented UI details are represented at the frontend node, since the excerpt does not expose their internal implementation.

Main entry points: [`frontend/src/App.tsx`](https://github.com/lakshagrawal28/biascraft/blob/main/frontend/src/App.tsx) (Model and results UI), [`backend/main.py`](https://github.com/lakshagrawal28/biascraft/blob/main/backend/main.py) (Scoring and selection), [`backend/data/candidates.json`](https://github.com/lakshagrawal28/biascraft/blob/main/backend/data/candidates.json) (Candidate dataset), [`frontend/src/main.tsx`](https://github.com/lakshagrawal28/biascraft/blob/main/frontend/src/main.tsx) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Simulation interface"]
  node_app_entry["React entry<br/>[main.tsx]"]
  node_simulation_ui["Model and results UI<br/>[App.tsx]"]
end

subgraph group_backend["Simulation API"]
  node_api["FastAPI endpoint<br/>[main.py]"]
  node_scoring["Scoring and selection<br/>[main.py]"]
  node_fairness["Metrics and alerts<br/>[main.py]"]
  node_candidate_sample["Candidate sample<br/>[main.py]"]
end

subgraph group_data["Candidate data"]
  node_candidate_store[("Candidate dataset<br/>[candidates.json]")]
  node_data_generator["Dataset generator<br/>[generate_data.py]"]
end

node_user(("User"))

node_user -->|"sets weights"| node_simulation_ui
node_app_entry -->|"renders"| node_simulation_ui
node_simulation_ui -->|"POST weights"| node_api
node_simulation_ui -->|"checks status"| node_api
node_api -->|"runs model"| node_scoring
node_scoring -->|"loads candidates"| node_candidate_store
node_scoring -->|"computes metrics"| node_fairness
node_scoring -->|"samples candidates"| node_candidate_sample
node_data_generator -->|"writes dataset"| node_candidate_store
node_api -->|"returns results"| node_simulation_ui

click node_app_entry "https://github.com/lakshagrawal28/biascraft/blob/main/frontend/src/main.tsx"
click node_simulation_ui "https://github.com/lakshagrawal28/biascraft/blob/main/frontend/src/App.tsx"
click node_api "https://github.com/lakshagrawal28/biascraft/blob/main/backend/main.py"
click node_scoring "https://github.com/lakshagrawal28/biascraft/blob/main/backend/main.py"
click node_fairness "https://github.com/lakshagrawal28/biascraft/blob/main/backend/main.py"
click node_candidate_sample "https://github.com/lakshagrawal28/biascraft/blob/main/backend/main.py"
click node_candidate_store "https://github.com/lakshagrawal28/biascraft/blob/main/backend/data/candidates.json"
click node_data_generator "https://github.com/lakshagrawal28/biascraft/blob/main/backend/generate_data.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_entry,node_simulation_ui,node_user toneBlue
class node_api,node_scoring,node_fairness,node_candidate_sample toneAmber
class node_candidate_store,node_data_generator toneMint
```

## Components

### Simulation interface

- [React entry](https://github.com/lakshagrawal28/biascraft/blob/main/frontend/src/main.tsx): `frontend/src/main.tsx`
- [Model and results UI](https://github.com/lakshagrawal28/biascraft/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`

### Simulation API

- [FastAPI endpoint](https://github.com/lakshagrawal28/biascraft/blob/main/backend/main.py): `backend/main.py`
- [Scoring and selection](https://github.com/lakshagrawal28/biascraft/blob/main/backend/main.py): `backend/main.py`
- [Metrics and alerts](https://github.com/lakshagrawal28/biascraft/blob/main/backend/main.py): `backend/main.py`
- [Candidate sample](https://github.com/lakshagrawal28/biascraft/blob/main/backend/main.py): `backend/main.py`

### Candidate data

- [Candidate dataset](https://github.com/lakshagrawal28/biascraft/blob/main/backend/data/candidates.json): `backend/data/candidates.json`
- [Dataset generator](https://github.com/lakshagrawal28/biascraft/blob/main/backend/generate_data.py): `backend/generate_data.py`

### Other components

- **User**

## Connections

- User → Model and results UI: sets weights (evidence: `README.md`)
- React entry → Model and results UI: renders (evidence: `frontend/src/main.tsx`)
- Model and results UI → FastAPI endpoint: POST weights (evidence: `frontend/src/App.tsx`)
- Model and results UI → FastAPI endpoint: checks status (evidence: `frontend/src/App.tsx`)
- FastAPI endpoint → Scoring and selection: runs model (evidence: `backend/main.py`)
- Scoring and selection → Candidate dataset: loads candidates (evidence: `backend/main.py`)
- Scoring and selection → Metrics and alerts: computes metrics (evidence: `backend/main.py`)
- Scoring and selection → Candidate sample: samples candidates (evidence: `backend/main.py`)
- Dataset generator → Candidate dataset: writes dataset (evidence: `backend/generate_data.py`)
- FastAPI endpoint → Model and results UI: returns results (evidence: `README.md`)
