# maharshi007/onexcode architecture

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

- Interactive diagram: https://gitdiagram.com/maharshi007/onexcode
- Repository: https://github.com/maharshi007/onexcode

## Overview

OneXCode is a company-specific DSA placement-preparation platform. Students browse companies and their questions, explore and filter the shared problem catalog, generate preparation sprints, inspect problem details, and track readiness and solved work. The frontend routes these experiences through a shared API client to a FastAPI service; company/problem data is modeled relationally, while authenticated progress has its own API and persistence path. The README documents capabilities whose page or route implementation was not sampled; those branches are included without asserting unverified internal calls.

Main entry points: [`frontend/src/App.tsx`](https://github.com/maharshi007/onexcode/blob/main/frontend/src/App.tsx) (Router and shell), [`frontend/src/services/api.ts`](https://github.com/maharshi007/onexcode/blob/main/frontend/src/services/api.ts) (API client), [`backend/app/api/companies.py`](https://github.com/maharshi007/onexcode/blob/main/backend/app/api/companies.py) (Company endpoints), [`backend/app/api/progress.py`](https://github.com/maharshi007/onexcode/blob/main/backend/app/api/progress.py) (Progress endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Student application"]
  node_app["Router and shell<br/>[App.tsx]"]
  node_company_pages["Company directory<br/>[CompaniesPage.tsx]"]
  node_company_detail["Company preparation"]
  node_problem_list["Problem explorer<br/>[ProblemsPage.tsx]"]
  node_problem_detail["Problem details"]
  node_search["Global search"]
  node_dashboard["Readiness dashboard<br/>[DashboardPage.tsx]"]
  node_navbar["Navigation and sign-in<br/>[Navbar.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_prep_modal["Sprint generator"]
end

subgraph group_catalog["Problem catalog"]
  node_companies_api["Company endpoints<br/>[companies.py]"]
  node_problems_api["Problem endpoints<br/>[problems.py]"]
  node_catalog_service["Catalog service<br/>[dsa_service.py]"]
  node_company_problem_data[("Company problem data<br/>[problem.py]")]
end

subgraph group_progress["Preparation progress"]
  node_progress_context["Progress state"]
  node_progress_api["Progress endpoints<br/>[progress.py]"]
end

subgraph group_platform["API and persistence"]
  node_auth["JWT validation<br/>[auth.py]"]
  node_backend_app["FastAPI application<br/>[main.py]"]
  node_database[("SQL database<br/>[session.py]")]
end

node_student(("Student"))
node_supabase["Supabase auth"]

node_student -->|"uses"| node_app
node_app -->|"routes to"| node_company_pages
node_app -->|"routes to"| node_company_detail
node_app -->|"routes to"| node_problem_list
node_app -->|"routes to"| node_problem_detail
node_app -->|"routes to"| node_dashboard
node_app -->|"renders"| node_search
node_navbar -->|"signs in with"| node_supabase
node_prep_modal -->|"requests sprint"| node_api_client
node_problem_list -->|"fetches catalog"| node_api_client
node_search -->|"searches"| node_api_client
node_api_client -->|"requests companies"| node_companies_api
node_api_client -->|"requests problems"| node_problems_api
node_companies_api -->|"delegates to"| node_catalog_service
node_companies_api -.->|"queries"| node_company_problem_data
node_problems_api -.->|"delegates to"| node_catalog_service
node_catalog_service -.->|"reads catalog"| node_company_problem_data
node_dashboard -.->|"shows progress"| node_progress_context
node_navbar -->|"reads solved count"| node_progress_context
node_progress_context -.->|"syncs progress"| node_api_client
node_api_client -->|"requests progress"| node_progress_api
node_progress_api -->|"validates identity"| node_auth
node_progress_api -->|"reads and writes"| node_database
node_backend_app -->|"mounts routes"| node_companies_api
node_backend_app -.->|"mounts routes"| node_problems_api
node_backend_app -.->|"mounts routes"| node_progress_api
node_company_problem_data -->|"uses ORM base"| node_database

click node_app "https://github.com/maharshi007/onexcode/blob/main/frontend/src/App.tsx"
click node_company_pages "https://github.com/maharshi007/onexcode/blob/main/frontend/src/pages/CompaniesPage.tsx"
click node_company_detail "https://github.com/maharshi007/onexcode/blob/main/frontend/src/pages/CompanyDetailPage.tsx"
click node_problem_list "https://github.com/maharshi007/onexcode/blob/main/frontend/src/pages/ProblemsPage.tsx"
click node_problem_detail "https://github.com/maharshi007/onexcode/blob/main/frontend/src/pages/ProblemDetailPage.tsx"
click node_search "https://github.com/maharshi007/onexcode/blob/main/frontend/src/components/common/GlobalSearchModal.tsx"
click node_dashboard "https://github.com/maharshi007/onexcode/blob/main/frontend/src/pages/DashboardPage.tsx"
click node_navbar "https://github.com/maharshi007/onexcode/blob/main/frontend/src/components/layout/Navbar.tsx"
click node_api_client "https://github.com/maharshi007/onexcode/blob/main/frontend/src/services/api.ts"
click node_prep_modal "https://github.com/maharshi007/onexcode/blob/main/frontend/src/components/problems/PreparationModeModal.tsx"
click node_companies_api "https://github.com/maharshi007/onexcode/blob/main/backend/app/api/companies.py"
click node_problems_api "https://github.com/maharshi007/onexcode/blob/main/backend/app/api/problems.py"
click node_catalog_service "https://github.com/maharshi007/onexcode/blob/main/backend/app/services/dsa_service.py"
click node_company_problem_data "https://github.com/maharshi007/onexcode/blob/main/backend/app/models/problem.py"
click node_progress_context "https://github.com/maharshi007/onexcode/blob/main/frontend/src/context/ProgressContext.tsx"
click node_progress_api "https://github.com/maharshi007/onexcode/blob/main/backend/app/api/progress.py"
click node_auth "https://github.com/maharshi007/onexcode/blob/main/backend/app/core/auth.py"
click node_backend_app "https://github.com/maharshi007/onexcode/blob/main/backend/app/main.py"
click node_database "https://github.com/maharshi007/onexcode/blob/main/backend/app/db/session.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_company_pages,node_company_detail,node_problem_list,node_problem_detail,node_search,node_dashboard,node_navbar,node_api_client,node_prep_modal toneBlue
class node_companies_api,node_problems_api,node_catalog_service,node_company_problem_data toneAmber
class node_progress_context,node_progress_api toneMint
class node_auth,node_backend_app,node_database toneRose
class node_student,node_supabase toneIndigo
```

## Components

### Student application

- [Router and shell](https://github.com/maharshi007/onexcode/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Company directory](https://github.com/maharshi007/onexcode/blob/main/frontend/src/pages/CompaniesPage.tsx): `frontend/src/pages/CompaniesPage.tsx`
- [Company preparation](https://github.com/maharshi007/onexcode/blob/main/frontend/src/pages/CompanyDetailPage.tsx): `frontend/src/pages/CompanyDetailPage.tsx`
- [Problem explorer](https://github.com/maharshi007/onexcode/blob/main/frontend/src/pages/ProblemsPage.tsx): `frontend/src/pages/ProblemsPage.tsx`
- [Problem details](https://github.com/maharshi007/onexcode/blob/main/frontend/src/pages/ProblemDetailPage.tsx): `frontend/src/pages/ProblemDetailPage.tsx`
- [Global search](https://github.com/maharshi007/onexcode/blob/main/frontend/src/components/common/GlobalSearchModal.tsx): `frontend/src/components/common/GlobalSearchModal.tsx`
- [Readiness dashboard](https://github.com/maharshi007/onexcode/blob/main/frontend/src/pages/DashboardPage.tsx): `frontend/src/pages/DashboardPage.tsx`
- [Navigation and sign-in](https://github.com/maharshi007/onexcode/blob/main/frontend/src/components/layout/Navbar.tsx): `frontend/src/components/layout/Navbar.tsx`
- [API client](https://github.com/maharshi007/onexcode/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`
- [Sprint generator](https://github.com/maharshi007/onexcode/blob/main/frontend/src/components/problems/PreparationModeModal.tsx): `frontend/src/components/problems/PreparationModeModal.tsx`

### Problem catalog

- [Company endpoints](https://github.com/maharshi007/onexcode/blob/main/backend/app/api/companies.py): `backend/app/api/companies.py`
- [Problem endpoints](https://github.com/maharshi007/onexcode/blob/main/backend/app/api/problems.py): `backend/app/api/problems.py`
- [Catalog service](https://github.com/maharshi007/onexcode/blob/main/backend/app/services/dsa_service.py): `backend/app/services/dsa_service.py`
- [Company problem data](https://github.com/maharshi007/onexcode/blob/main/backend/app/models/problem.py): `backend/app/models/problem.py`

### Preparation progress

- [Progress state](https://github.com/maharshi007/onexcode/blob/main/frontend/src/context/ProgressContext.tsx): `frontend/src/context/ProgressContext.tsx`
- [Progress endpoints](https://github.com/maharshi007/onexcode/blob/main/backend/app/api/progress.py): `backend/app/api/progress.py`

### API and persistence

- [JWT validation](https://github.com/maharshi007/onexcode/blob/main/backend/app/core/auth.py): `backend/app/core/auth.py`
- [FastAPI application](https://github.com/maharshi007/onexcode/blob/main/backend/app/main.py): `backend/app/main.py`
- [SQL database](https://github.com/maharshi007/onexcode/blob/main/backend/app/db/session.py): `backend/app/db/session.py`

### Other components

- **Student**
- **Supabase auth**

## Connections

- Student → Router and shell: uses
- Router and shell → Company directory: routes to (evidence: `frontend/src/App.tsx`)
- Router and shell → Company preparation: routes to (evidence: `frontend/src/App.tsx`)
- Router and shell → Problem explorer: routes to (evidence: `frontend/src/App.tsx`)
- Router and shell → Problem details: routes to (evidence: `frontend/src/App.tsx`)
- Router and shell → Readiness dashboard: routes to (evidence: `frontend/src/App.tsx`)
- Router and shell → Global search: renders (evidence: `frontend/src/App.tsx`)
- Navigation and sign-in → Supabase auth: signs in with (evidence: `frontend/src/components/layout/Navbar.tsx`)
- Sprint generator → API client: requests sprint (evidence: `frontend/src/components/problems/PreparationModeModal.tsx`)
- Problem explorer → API client: fetches catalog (evidence: `frontend/src/pages/ProblemsPage.tsx`)
- Global search → API client: searches (evidence: `frontend/src/components/common/GlobalSearchModal.tsx`)
- API client → Company endpoints: requests companies
- API client → Problem endpoints: requests problems
- Company endpoints → Catalog service: delegates to (evidence: `backend/app/api/companies.py`)
- Company endpoints → Company problem data: queries
- Problem endpoints → Catalog service: delegates to
- Catalog service → Company problem data: reads catalog
- Readiness dashboard → Progress state: shows progress
- Navigation and sign-in → Progress state: reads solved count (evidence: `frontend/src/components/layout/Navbar.tsx`)
- Progress state → API client: syncs progress
- API client → Progress endpoints: requests progress
- Progress endpoints → JWT validation: validates identity (evidence: `backend/app/api/progress.py`)
- Progress endpoints → SQL database: reads and writes (evidence: `backend/app/api/progress.py`)
- FastAPI application → Company endpoints: mounts routes (evidence: `backend/app/main.py`)
- FastAPI application → Problem endpoints: mounts routes
- FastAPI application → Progress endpoints: mounts routes
- Company problem data → SQL database: uses ORM base (evidence: `backend/app/models/problem.py`)
