# rituuu001/samarthya architecture

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

- Interactive diagram: https://gitdiagram.com/rituuu001/samarthya
- Repository: https://github.com/rituuu001/samarthya

## Overview

Samarthya is a proof-of-work hiring platform: employers publish practical sprints, candidates discover and apply, complete tasks and submit work, and employers evaluate it before proof and later connection. The React app presents role-based portals and calls a FastAPI REST backend; backend routers expose domain operations and services enforce workflow rules over SQLAlchemy models and PostgreSQL. Assessment, anonymized application review, file evidence, payment progress, proof records, and identity-aware connection are distinct capabilities. Several backend routes and frontend screens were not sampled; their inclusion and workflow links rely on README descriptions, so unsampled implementation details are not inferred.

Main entry points: [`backend/app/main.py`](https://github.com/rituuu001/samarthya/blob/main/backend/app/main.py) (FastAPI entry), [`backend/app/routers/applications.py`](https://github.com/rituuu001/samarthya/blob/main/backend/app/routers/applications.py) (Applications), [`frontend/src/App.tsx`](https://github.com/rituuu001/samarthya/blob/main/frontend/src/App.tsx) (App shell), [`backend/app/services/assessment_service.py`](https://github.com/rituuu001/samarthya/blob/main/backend/app/services/assessment_service.py) (Assessment grading)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Role-based experience"]
  node_app["App shell<br/>[App.tsx]"]
  node_candidate_portal["Candidate portal"]
  node_employer_portal["Employer portal<br/>[EmployerPortal.tsx]"]
  node_sprint_create["Create sprint"]
  node_submission_ui["Submit work<br/>[Submission.tsx]"]
  node_review_ui["Review work"]
  node_api_client["API client<br/>[client.ts]"]
end

subgraph group_opportunities["Sprint workflow"]
  node_sprint_api["Sprint management<br/>[sprints.py]"]
  node_sprint_service["Sprint rules<br/>[sprint_service.py]"]
  node_application_api["Applications<br/>[applications.py]"]
  node_application_service["Application rules"]
end

subgraph group_evaluation["Evaluation and proof"]
  node_submission_api["Submission handling<br/>[submissions.py]"]
  node_submission_service["Submission rules"]
  node_assessment_api["Assessment API<br/>[assessments.py]"]
  node_assessment_service["Assessment grading"]
  node_proof["Skill proof<br/>[proof_records.py]"]
end

subgraph group_platform["Platform services"]
  node_auth["Authentication<br/>[auth.py]"]
  node_identity["Identity and connection"]
  node_files["File storage<br/>[storage.py]"]
  node_payments["Payment progress<br/>[payments.py]"]
  node_api["FastAPI entry<br/>[main.py]"]
end

subgraph group_persistence["Persistence"]
  node_db_session["Database sessions<br/>[session.py]"]
  node_records[("Domain records<br/>[sprint.py]")]
end

node_candidate(("Candidate"))
node_employer(("Employer"))
node_postgres[("PostgreSQL")]

node_candidate -->|"uses"| node_app
node_employer -->|"uses"| node_app
node_app -->|"renders"| node_candidate_portal
node_app -->|"renders"| node_employer_portal
node_employer_portal -.->|"creates"| node_sprint_create
node_candidate_portal -.->|"submits through"| node_submission_ui
node_employer_portal -.->|"reviews through"| node_review_ui
node_app -->|"calls"| node_api_client
node_api_client -.->|"sends REST requests"| node_api
node_api -->|"registers"| node_auth
node_api -->|"registers"| node_sprint_api
node_api -->|"registers"| node_application_api
node_api -->|"registers"| node_submission_api
node_api -->|"registers"| node_assessment_api
node_api -->|"registers"| node_proof
node_api -->|"registers"| node_identity
node_api -->|"registers"| node_files
node_api -->|"registers"| node_payments
node_sprint_api -.->|"delegates to"| node_sprint_service
node_application_api -->|"calls"| node_application_service
node_submission_api -.->|"delegates to"| node_submission_service
node_assessment_api -.->|"delegates to"| node_assessment_service
node_application_service -->|"uses assessment rules"| node_assessment_service
node_candidate -.->|"discovers sprints"| node_sprint_api
node_candidate -->|"applies"| node_application_api
node_employer -.->|"publishes sprint"| node_sprint_api
node_employer -->|"reviews applicants"| node_application_api
node_candidate -.->|"submits task"| node_submission_api
node_employer -.->|"evaluates work"| node_assessment_api
node_assessment_service -.->|"creates verified proof"| node_proof
node_application_api -.->|"supports later connection"| node_identity
node_submission_service -->|"uses evidence files"| node_files
node_application_service -->|"reads and writes"| node_records
node_assessment_service -->|"reads and writes"| node_records
node_sprint_service -->|"reads and writes"| node_records
node_db_session -->|"opens sessions"| node_postgres
node_api -->|"provides database dependency"| node_db_session
node_application_api -->|"requests session"| node_db_session
node_sprint_service -.->|"tracks payment progress"| node_payments

click node_app "https://github.com/rituuu001/samarthya/blob/main/frontend/src/App.tsx"
click node_candidate_portal "https://github.com/rituuu001/samarthya/blob/main/frontend/src/screens/candidate/CandidatePortal.tsx"
click node_employer_portal "https://github.com/rituuu001/samarthya/blob/main/frontend/src/screens/employer/EmployerPortal.tsx"
click node_sprint_create "https://github.com/rituuu001/samarthya/blob/main/frontend/src/screens/employer/CreateProofSprint.tsx"
click node_submission_ui "https://github.com/rituuu001/samarthya/blob/main/frontend/src/screens/candidate/Submission.tsx"
click node_review_ui "https://github.com/rituuu001/samarthya/blob/main/frontend/src/components/portal/SubmissionReview.tsx"
click node_api_client "https://github.com/rituuu001/samarthya/blob/main/frontend/src/api/client.ts"
click node_auth "https://github.com/rituuu001/samarthya/blob/main/backend/app/routers/auth.py"
click node_sprint_api "https://github.com/rituuu001/samarthya/blob/main/backend/app/routers/sprints.py"
click node_sprint_service "https://github.com/rituuu001/samarthya/blob/main/backend/app/services/sprint_service.py"
click node_application_api "https://github.com/rituuu001/samarthya/blob/main/backend/app/routers/applications.py"
click node_application_service "https://github.com/rituuu001/samarthya/blob/main/backend/app/services/application_service.py"
click node_submission_api "https://github.com/rituuu001/samarthya/blob/main/backend/app/routers/submissions.py"
click node_submission_service "https://github.com/rituuu001/samarthya/blob/main/backend/app/services/submission_service.py"
click node_assessment_api "https://github.com/rituuu001/samarthya/blob/main/backend/app/routers/assessments.py"
click node_assessment_service "https://github.com/rituuu001/samarthya/blob/main/backend/app/services/assessment_service.py"
click node_proof "https://github.com/rituuu001/samarthya/blob/main/backend/app/routers/proof_records.py"
click node_identity "https://github.com/rituuu001/samarthya/blob/main/backend/app/routers/connection_requests.py"
click node_files "https://github.com/rituuu001/samarthya/blob/main/backend/app/core/storage.py"
click node_payments "https://github.com/rituuu001/samarthya/blob/main/backend/app/routers/payments.py"
click node_api "https://github.com/rituuu001/samarthya/blob/main/backend/app/main.py"
click node_db_session "https://github.com/rituuu001/samarthya/blob/main/backend/app/db/session.py"
click node_records "https://github.com/rituuu001/samarthya/blob/main/backend/app/models/sprint.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_candidate_portal,node_employer_portal,node_sprint_create,node_submission_ui,node_review_ui,node_api_client toneBlue
class node_sprint_api,node_sprint_service,node_application_api,node_application_service,node_postgres toneAmber
class node_submission_api,node_submission_service,node_assessment_api,node_assessment_service,node_proof toneMint
class node_auth,node_identity,node_files,node_payments,node_api toneRose
class node_db_session,node_records,node_candidate,node_employer toneIndigo
```

## Components

### Role-based experience

- [App shell](https://github.com/rituuu001/samarthya/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Candidate portal](https://github.com/rituuu001/samarthya/blob/main/frontend/src/screens/candidate/CandidatePortal.tsx): `frontend/src/screens/candidate/CandidatePortal.tsx`
- [Employer portal](https://github.com/rituuu001/samarthya/blob/main/frontend/src/screens/employer/EmployerPortal.tsx): `frontend/src/screens/employer/EmployerPortal.tsx`
- [Create sprint](https://github.com/rituuu001/samarthya/blob/main/frontend/src/screens/employer/CreateProofSprint.tsx): `frontend/src/screens/employer/CreateProofSprint.tsx`
- [Submit work](https://github.com/rituuu001/samarthya/blob/main/frontend/src/screens/candidate/Submission.tsx): `frontend/src/screens/candidate/Submission.tsx`
- [Review work](https://github.com/rituuu001/samarthya/blob/main/frontend/src/components/portal/SubmissionReview.tsx): `frontend/src/components/portal/SubmissionReview.tsx`
- [API client](https://github.com/rituuu001/samarthya/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### Sprint workflow

- [Sprint management](https://github.com/rituuu001/samarthya/blob/main/backend/app/routers/sprints.py): `backend/app/routers/sprints.py`
- [Sprint rules](https://github.com/rituuu001/samarthya/blob/main/backend/app/services/sprint_service.py): `backend/app/services/sprint_service.py`
- [Applications](https://github.com/rituuu001/samarthya/blob/main/backend/app/routers/applications.py): `backend/app/routers/applications.py`
- [Application rules](https://github.com/rituuu001/samarthya/blob/main/backend/app/services/application_service.py): `backend/app/services/application_service.py`

### Evaluation and proof

- [Submission handling](https://github.com/rituuu001/samarthya/blob/main/backend/app/routers/submissions.py): `backend/app/routers/submissions.py`
- [Submission rules](https://github.com/rituuu001/samarthya/blob/main/backend/app/services/submission_service.py): `backend/app/services/submission_service.py`
- [Assessment API](https://github.com/rituuu001/samarthya/blob/main/backend/app/routers/assessments.py): `backend/app/routers/assessments.py`
- [Assessment grading](https://github.com/rituuu001/samarthya/blob/main/backend/app/services/assessment_service.py): `backend/app/services/assessment_service.py`
- [Skill proof](https://github.com/rituuu001/samarthya/blob/main/backend/app/routers/proof_records.py): `backend/app/routers/proof_records.py`

### Platform services

- [Authentication](https://github.com/rituuu001/samarthya/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [Identity and connection](https://github.com/rituuu001/samarthya/blob/main/backend/app/routers/connection_requests.py): `backend/app/routers/connection_requests.py`
- [File storage](https://github.com/rituuu001/samarthya/blob/main/backend/app/core/storage.py): `backend/app/core/storage.py`
- [Payment progress](https://github.com/rituuu001/samarthya/blob/main/backend/app/routers/payments.py): `backend/app/routers/payments.py`
- [FastAPI entry](https://github.com/rituuu001/samarthya/blob/main/backend/app/main.py): `backend/app/main.py`

### Persistence

- [Database sessions](https://github.com/rituuu001/samarthya/blob/main/backend/app/db/session.py): `backend/app/db/session.py`
- [Domain records](https://github.com/rituuu001/samarthya/blob/main/backend/app/models/sprint.py): `backend/app/models/sprint.py`

### Other components

- **Candidate**
- **Employer**
- **PostgreSQL**

## Connections

- Candidate → App shell: uses (evidence: `README.md`)
- Employer → App shell: uses (evidence: `README.md`)
- App shell → Candidate portal: renders (evidence: `frontend/src/App.tsx`)
- App shell → Employer portal: renders (evidence: `frontend/src/App.tsx`)
- Employer portal → Create sprint: creates (evidence: `README.md`)
- Candidate portal → Submit work: submits through (evidence: `README.md`)
- Employer portal → Review work: reviews through (evidence: `README.md`)
- App shell → API client: calls (evidence: `frontend/src/App.tsx`)
- API client → FastAPI entry: sends REST requests (evidence: `README.md`)
- FastAPI entry → Authentication: registers (evidence: `backend/app/main.py`)
- FastAPI entry → Sprint management: registers (evidence: `backend/app/main.py`)
- FastAPI entry → Applications: registers (evidence: `backend/app/main.py`)
- FastAPI entry → Submission handling: registers (evidence: `backend/app/main.py`)
- FastAPI entry → Assessment API: registers (evidence: `backend/app/main.py`)
- FastAPI entry → Skill proof: registers (evidence: `backend/app/main.py`)
- FastAPI entry → Identity and connection: registers (evidence: `backend/app/main.py`)
- FastAPI entry → File storage: registers (evidence: `backend/app/main.py`)
- FastAPI entry → Payment progress: registers (evidence: `backend/app/main.py`)
- Sprint management → Sprint rules: delegates to
- Applications → Application rules: calls (evidence: `backend/app/routers/applications.py`)
- Submission handling → Submission rules: delegates to
- Assessment API → Assessment grading: delegates to
- Application rules → Assessment grading: uses assessment rules (evidence: `backend/app/services/application_service.py`)
- Candidate → Sprint management: discovers sprints (evidence: `README.md`)
- Candidate → Applications: applies (evidence: `backend/app/routers/applications.py`)
- Employer → Sprint management: publishes sprint (evidence: `README.md`)
- Employer → Applications: reviews applicants (evidence: `backend/app/routers/applications.py`)
- Candidate → Submission handling: submits task (evidence: `README.md`)
- Employer → Assessment API: evaluates work (evidence: `README.md`)
- Assessment grading → Skill proof: creates verified proof (evidence: `README.md`)
- Applications → Identity and connection: supports later connection (evidence: `README.md`)
- Submission rules → File storage: uses evidence files (evidence: `backend/app/services/submission_service.py`)
- Application rules → Domain records: reads and writes (evidence: `backend/app/services/application_service.py`)
- Assessment grading → Domain records: reads and writes (evidence: `backend/app/services/assessment_service.py`)
- Sprint rules → Domain records: reads and writes (evidence: `backend/app/services/sprint_service.py`)
- Database sessions → PostgreSQL: opens sessions (evidence: `backend/app/db/session.py`)
- FastAPI entry → Database sessions: provides database dependency (evidence: `backend/app/main.py`)
- Applications → Database sessions: requests session (evidence: `backend/app/routers/applications.py`)
- Sprint rules → Payment progress: tracks payment progress (evidence: `README.md`)
