# aayush599314/sih architecture

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

## Overview

AlgoMinds.AI is a React learning app for exploring data structures and algorithms. The main journey is landing page → sign-in/register → protected dashboard → choose a playground → interact with a visualizer; users can also submit linked-list practice solutions and request AI analysis. The graph preserves the documented landing, auth, dashboard, and visualizer capabilities. Source evidence is uneven: routes, auth, dashboard state, AI dispatch, and some visualizer modules are shown or indexed; other page and visualizer internals are represented at their documented subsystem paths.

Main entry points: [`src/routes/AppRoutes.tsx`](https://github.com/aayush599314/sih/blob/main/src/routes/AppRoutes.tsx) (Route table), [`src/hooks/useAuth.ts`](https://github.com/aayush599314/sih/blob/main/src/hooks/useAuth.ts) (Auth hook), [`src/context/DashboardContext.tsx`](https://github.com/aayush599314/sih/blob/main/src/context/DashboardContext.tsx) (Dashboard state), [`src/pages/Login/LoginPage.tsx`](https://github.com/aayush599314/sih/blob/main/src/pages/Login/LoginPage.tsx) (Login page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Pages and navigation"]
  node_route_table["Route table<br/>[AppRoutes.tsx]"]
  node_landing["Landing experience<br/>[LandingPage.tsx]"]
end

subgraph group_identity["Authentication"]
  node_login["Login page<br/>[LoginPage.tsx]"]
  node_register["Registration page<br/>[RegisterPage.tsx]"]
  node_auth_shell["Auth layout<br/>[AuthLayout.tsx]"]
  node_auth_context["Mock auth session<br/>[AuthContext.tsx]"]
  node_auth_hook["Auth hook<br/>[useAuth.ts]"]
  node_protected_gate["Protected route gate<br/>[ProtectedRoute.tsx]"]
  node_public_gate["Public-only gate"]
end

subgraph group_learning["Learning workspace"]
  node_dashboard["Dashboard<br/>[DashboardPage.tsx]"]
  node_dashboard_state["Dashboard state"]
  node_dashboard_panels["Dashboard panels"]
  node_visualizer_catalog["Visualizer catalog<br/>[visualizers.ts]"]
  node_playground_page["Playground page<br/>[VisualizerPage.tsx]"]
end

subgraph group_visualization["Algorithm visualizers"]
  node_visualizer_router["Visualizer dispatch"]
  node_visualizer_suite["Data structure visualizers"]
  node_binary_search["Binary search lab"]
  node_dp_lab["Dynamic programming lab"]
  node_two_pointer_lab["Two-pointer lab"]
  node_linked_list_lab["Linked-list lab"]
end

subgraph group_assistance["Practice and AI"]
  node_practice_engine["Practice evaluator<br/>[engine.ts]"]
  node_trace_generator["Execution trace generator<br/>[traceGenerator.ts]"]
  node_ai_panel["AI assistant panel"]
  node_gemini_service["AI analysis service<br/>[gemini.ts]"]
end

node_learner(("Learner"))

node_learner -->|"opens routes"| node_route_table
node_route_table -->|"routes to"| node_landing
node_route_table -->|"routes to"| node_login
node_route_table -->|"routes to"| node_register
node_route_table -->|"guards access"| node_protected_gate
node_route_table -->|"guards access"| node_public_gate
node_route_table -->|"routes to"| node_dashboard
node_route_table -->|"routes to"| node_playground_page
node_login -->|"renders in"| node_auth_shell
node_register -->|"renders in"| node_auth_shell
node_login -->|"uses"| node_auth_hook
node_register -->|"uses"| node_auth_hook
node_auth_hook -->|"reads session"| node_auth_context
node_protected_gate -->|"checks session"| node_auth_hook
node_public_gate -->|"checks session"| node_auth_hook
node_dashboard -->|"presents workspace"| node_dashboard_panels
node_dashboard -.->|"uses state"| node_dashboard_state
node_dashboard_panels -->|"offers playgrounds"| node_visualizer_catalog
node_dashboard_state -->|"requests analysis"| node_gemini_service
node_dashboard_state -->|"matches AI result"| node_visualizer_catalog
node_playground_page -->|"dispatches selection"| node_visualizer_router
node_visualizer_router -->|"dispatches visualizer"| node_visualizer_suite
node_visualizer_router -->|"dispatches binary search"| node_binary_search
node_learner -.->|"practices algorithms"| node_linked_list_lab
node_linked_list_lab -.->|"evaluates solutions"| node_practice_engine
node_practice_engine -->|"generates trace"| node_trace_generator
node_ai_panel -.->|"submits analysis"| node_dashboard_state
node_learner -.->|"asks for help"| node_ai_panel

click node_route_table "https://github.com/aayush599314/sih/blob/main/src/routes/AppRoutes.tsx"
click node_landing "https://github.com/aayush599314/sih/blob/main/src/pages/Landing/LandingPage.tsx"
click node_login "https://github.com/aayush599314/sih/blob/main/src/pages/Login/LoginPage.tsx"
click node_register "https://github.com/aayush599314/sih/blob/main/src/pages/Register/RegisterPage.tsx"
click node_auth_shell "https://github.com/aayush599314/sih/blob/main/src/layouts/AuthLayout.tsx"
click node_auth_context "https://github.com/aayush599314/sih/blob/main/src/context/AuthContext.tsx"
click node_auth_hook "https://github.com/aayush599314/sih/blob/main/src/hooks/useAuth.ts"
click node_protected_gate "https://github.com/aayush599314/sih/blob/main/src/routes/ProtectedRoute.tsx"
click node_public_gate "https://github.com/aayush599314/sih/blob/main/src/routes/PublicOnlyRoute.tsx"
click node_dashboard "https://github.com/aayush599314/sih/blob/main/src/pages/Dashboard/DashboardPage.tsx"
click node_dashboard_state "https://github.com/aayush599314/sih/blob/main/src/context/DashboardContext.tsx"
click node_dashboard_panels "https://github.com/aayush599314/sih/tree/main/src/components/dashboard"
click node_visualizer_catalog "https://github.com/aayush599314/sih/blob/main/src/data/visualizers.ts"
click node_playground_page "https://github.com/aayush599314/sih/blob/main/src/pages/Dashboard/VisualizerPage.tsx"
click node_visualizer_router "https://github.com/aayush599314/sih/blob/main/src/components/visualizers/VisualizerRouter.tsx"
click node_visualizer_suite "https://github.com/aayush599314/sih/tree/main/src/components/visualizers"
click node_binary_search "https://github.com/aayush599314/sih/blob/main/src/components/visualizers/binary-search/BinarySearchVisualizer.tsx"
click node_dp_lab "https://github.com/aayush599314/sih/tree/main/src/components/visualizers/dynamic-programming"
click node_two_pointer_lab "https://github.com/aayush599314/sih/tree/main/src/components/visualizers/two-pointer"
click node_linked_list_lab "https://github.com/aayush599314/sih/tree/main/src/components/visualizers/linkedlist"
click node_practice_engine "https://github.com/aayush599314/sih/blob/main/src/components/visualizers/linkedlist/practice/engine.ts"
click node_trace_generator "https://github.com/aayush599314/sih/blob/main/src/components/visualizers/linkedlist/practice/traceGenerator.ts"
click node_ai_panel "https://github.com/aayush599314/sih/blob/main/src/components/dashboard/AIAssistantPanel.tsx"
click node_gemini_service "https://github.com/aayush599314/sih/blob/main/src/services/gemini.ts"

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_route_table,node_landing toneBlue
class node_login,node_register,node_auth_shell,node_auth_context,node_auth_hook,node_protected_gate,node_public_gate toneAmber
class node_dashboard,node_dashboard_state,node_dashboard_panels,node_visualizer_catalog,node_playground_page toneMint
class node_visualizer_router,node_visualizer_suite,node_binary_search,node_dp_lab,node_two_pointer_lab,node_linked_list_lab toneRose
class node_practice_engine,node_trace_generator,node_ai_panel,node_gemini_service,node_learner toneIndigo
```

## Components

### Pages and navigation

- [Route table](https://github.com/aayush599314/sih/blob/main/src/routes/AppRoutes.tsx): `src/routes/AppRoutes.tsx`
- [Landing experience](https://github.com/aayush599314/sih/blob/main/src/pages/Landing/LandingPage.tsx): `src/pages/Landing/LandingPage.tsx`

### Authentication

- [Login page](https://github.com/aayush599314/sih/blob/main/src/pages/Login/LoginPage.tsx): `src/pages/Login/LoginPage.tsx`
- [Registration page](https://github.com/aayush599314/sih/blob/main/src/pages/Register/RegisterPage.tsx): `src/pages/Register/RegisterPage.tsx`
- [Auth layout](https://github.com/aayush599314/sih/blob/main/src/layouts/AuthLayout.tsx): `src/layouts/AuthLayout.tsx`
- [Mock auth session](https://github.com/aayush599314/sih/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Auth hook](https://github.com/aayush599314/sih/blob/main/src/hooks/useAuth.ts): `src/hooks/useAuth.ts`
- [Protected route gate](https://github.com/aayush599314/sih/blob/main/src/routes/ProtectedRoute.tsx): `src/routes/ProtectedRoute.tsx`
- [Public-only gate](https://github.com/aayush599314/sih/blob/main/src/routes/PublicOnlyRoute.tsx): `src/routes/PublicOnlyRoute.tsx`

### Learning workspace

- [Dashboard](https://github.com/aayush599314/sih/blob/main/src/pages/Dashboard/DashboardPage.tsx): `src/pages/Dashboard/DashboardPage.tsx`
- [Dashboard state](https://github.com/aayush599314/sih/blob/main/src/context/DashboardContext.tsx): `src/context/DashboardContext.tsx`
- [Dashboard panels](https://github.com/aayush599314/sih/tree/main/src/components/dashboard): `src/components/dashboard`
- [Visualizer catalog](https://github.com/aayush599314/sih/blob/main/src/data/visualizers.ts): `src/data/visualizers.ts`
- [Playground page](https://github.com/aayush599314/sih/blob/main/src/pages/Dashboard/VisualizerPage.tsx): `src/pages/Dashboard/VisualizerPage.tsx`

### Algorithm visualizers

- [Visualizer dispatch](https://github.com/aayush599314/sih/blob/main/src/components/visualizers/VisualizerRouter.tsx): `src/components/visualizers/VisualizerRouter.tsx`
- [Data structure visualizers](https://github.com/aayush599314/sih/tree/main/src/components/visualizers): `src/components/visualizers`
- [Binary search lab](https://github.com/aayush599314/sih/blob/main/src/components/visualizers/binary-search/BinarySearchVisualizer.tsx): `src/components/visualizers/binary-search/BinarySearchVisualizer.tsx`
- [Dynamic programming lab](https://github.com/aayush599314/sih/tree/main/src/components/visualizers/dynamic-programming): `src/components/visualizers/dynamic-programming`
- [Two-pointer lab](https://github.com/aayush599314/sih/tree/main/src/components/visualizers/two-pointer): `src/components/visualizers/two-pointer`
- [Linked-list lab](https://github.com/aayush599314/sih/tree/main/src/components/visualizers/linkedlist): `src/components/visualizers/linkedlist`

### Practice and AI

- [Practice evaluator](https://github.com/aayush599314/sih/blob/main/src/components/visualizers/linkedlist/practice/engine.ts): `src/components/visualizers/linkedlist/practice/engine.ts`
- [Execution trace generator](https://github.com/aayush599314/sih/blob/main/src/components/visualizers/linkedlist/practice/traceGenerator.ts): `src/components/visualizers/linkedlist/practice/traceGenerator.ts`
- [AI assistant panel](https://github.com/aayush599314/sih/blob/main/src/components/dashboard/AIAssistantPanel.tsx): `src/components/dashboard/AIAssistantPanel.tsx`
- [AI analysis service](https://github.com/aayush599314/sih/blob/main/src/services/gemini.ts): `src/services/gemini.ts`

### Other components

- **Learner**

## Connections

- Learner → Route table: opens routes (evidence: `src/routes/AppRoutes.tsx`)
- Route table → Landing experience: routes to (evidence: `src/routes/AppRoutes.tsx`)
- Route table → Login page: routes to (evidence: `src/routes/AppRoutes.tsx`)
- Route table → Registration page: routes to (evidence: `src/routes/AppRoutes.tsx`)
- Route table → Protected route gate: guards access (evidence: `src/routes/AppRoutes.tsx`)
- Route table → Public-only gate: guards access (evidence: `src/routes/AppRoutes.tsx`)
- Route table → Dashboard: routes to (evidence: `src/routes/AppRoutes.tsx`)
- Route table → Playground page: routes to (evidence: `src/routes/AppRoutes.tsx`)
- Login page → Auth layout: renders in (evidence: `src/pages/Login/LoginPage.tsx`)
- Registration page → Auth layout: renders in (evidence: `src/pages/Register/RegisterPage.tsx`)
- Login page → Auth hook: uses (evidence: `src/pages/Login/LoginPage.tsx`)
- Registration page → Auth hook: uses (evidence: `src/pages/Register/RegisterPage.tsx`)
- Auth hook → Mock auth session: reads session (evidence: `src/hooks/useAuth.ts`)
- Protected route gate → Auth hook: checks session (evidence: `src/routes/ProtectedRoute.tsx`)
- Public-only gate → Auth hook: checks session (evidence: `src/routes/PublicOnlyRoute.tsx`)
- Dashboard → Dashboard panels: presents workspace (evidence: `README.md`)
- Dashboard → Dashboard state: uses state
- Dashboard panels → Visualizer catalog: offers playgrounds (evidence: `src/components/dashboard/PlaygroundPreview.tsx`)
- Dashboard state → AI analysis service: requests analysis (evidence: `src/context/DashboardContext.tsx`)
- Dashboard state → Visualizer catalog: matches AI result (evidence: `src/context/DashboardContext.tsx`)
- Playground page → Visualizer dispatch: dispatches selection (evidence: `src/pages/Dashboard/VisualizerPage.tsx`)
- Visualizer dispatch → Data structure visualizers: dispatches visualizer (evidence: `src/components/visualizers/VisualizerRouter.tsx`)
- Visualizer dispatch → Binary search lab: dispatches binary search (evidence: `src/components/visualizers/VisualizerRouter.tsx`)
- Learner → Linked-list lab: practices algorithms (evidence: `README.md`)
- Linked-list lab → Practice evaluator: evaluates solutions (evidence: `src/components/visualizers/linkedlist/practice/engine.ts`)
- Practice evaluator → Execution trace generator: generates trace (evidence: `src/components/visualizers/linkedlist/practice/engine.ts`)
- AI assistant panel → Dashboard state: submits analysis
- Learner → AI assistant panel: asks for help (evidence: `README.md`)
