# skyuvaraj2007-web/nila-test-lab architecture

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

- Interactive diagram: https://gitdiagram.com/skyuvaraj2007-web/nila-test-lab
- Repository: https://github.com/skyuvaraj2007-web/nila-test-lab

## Overview

Nila TestLab AI is an educational programming lab for analyzing questions, generating and validating test cases, running reference and student code, and reviewing results. Its main workflow moves from a problem statement through analysis, test generation and input validation, then reference execution and student evaluation. The frontend also provides playground, history and export capabilities. Backend route wiring and several engine relationships are supported by excerpts or the source index; unsampled frontend service connections are left unasserted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/App.jsx) (Workbench shell), [`backend/main.py`](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/main.py) (FastAPI application), [`frontend/src/pages/TestExecution.jsx`](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/pages/TestExecution.jsx) (Test execution), [`backend/routes/generate.py`](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/routes/generate.py) (Generation endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend workflow"]
  node_app["Workbench shell<br/>[App.jsx]"]
  node_analysis_page["Question analysis"]
  node_generator_page["Test case generator"]
  node_viewer_page["Test case viewer<br/>[TestCaseViewer.jsx]"]
  node_execution_page["Test execution<br/>[TestExecution.jsx]"]
  node_playground["Code playground<br/>[CodePlayground.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_lab_exercise["Lab exercises<br/>[LabExercise.jsx]"]
  node_history["Run history<br/>[History.jsx]"]
  node_app_state["Shared app state<br/>[AppContext.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_export["Result export<br/>[exportService.js]"]
  node_history_store[("Local data store<br/>[db.js]")]
end

subgraph group_analysis["Problem analysis"]
  node_analyzer["Question understanding"]
  node_format_parser["Input format parser"]
  node_constraints["Constraint extraction"]
end

subgraph group_generation["Test design"]
  node_generator["Universal test generator"]
  node_validator["Input validator<br/>[input_validator.py]"]
  node_serializer["Input serializer"]
end

subgraph group_execution["Execution and evaluation"]
  node_browser_runner["Browser execution"]
  node_reference_engine["Reference runner"]
  node_output_capture["Output normalization"]
  node_evaluation["Student evaluation"]
  node_execution_service["Host execution service"]
  node_language_registry["Language registry"]
end

subgraph group_backend["Backend API"]
  node_api["FastAPI application<br/>[main.py]"]
  node_schemas["API schemas<br/>[schemas.py]"]
  node_analyze_route["Analysis endpoint<br/>[analyze.py]"]
  node_generate_route["Generation endpoint<br/>[generate.py]"]
  node_upload_route["Upload endpoint<br/>[upload.py]"]
  node_execution_route["Execution endpoint<br/>[execute.py]"]
  node_languages_route["Languages endpoint<br/>[languages.py]"]
  node_health_route["Health endpoint<br/>[health.py]"]
end

node_student(("Lab user"))

node_student -->|"uses"| node_app
node_app -->|"routes to"| node_analysis_page
node_app -->|"routes to"| node_generator_page
node_app -->|"routes to"| node_viewer_page
node_app -->|"routes to"| node_execution_page
node_app -->|"routes to"| node_playground
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_lab_exercise
node_app -->|"routes to"| node_history
node_app -->|"uses"| node_app_state
node_api -->|"registers"| node_analyze_route
node_api -->|"registers"| node_generate_route
node_api -->|"registers"| node_upload_route
node_api -->|"registers"| node_execution_route
node_api -->|"registers"| node_languages_route
node_api -->|"registers"| node_health_route
node_analyze_route -.->|"delegates to"| node_analyzer
node_analyzer -->|"parses with"| node_format_parser
node_analyzer -->|"extracts with"| node_constraints
node_generate_route -->|"validates with"| node_validator
node_generate_route -->|"parses contract"| node_format_parser
node_generate_route -->|"extracts constraints"| node_constraints
node_generate_route -.->|"generates with"| node_generator
node_generator -->|"parses with"| node_format_parser
node_generator -->|"extracts with"| node_constraints
node_generator -->|"serializes via"| node_serializer
node_execution_route -.->|"delegates to"| node_execution_service
node_execution_service -->|"checks language"| node_language_registry
node_reference_engine -->|"classifies output"| node_output_capture
node_evaluation -->|"normalizes output"| node_output_capture
node_app_state -.->|"persists state"| node_history_store
node_execution_page -.->|"evaluates results"| node_evaluation
node_execution_page -.->|"runs code"| node_browser_runner
node_generator_page -.->|"requests generation"| node_api_client
node_analysis_page -.->|"requests analysis"| node_api_client
node_api_client -.->|"sends API requests"| node_api
node_execution_page -.->|"runs reference suite"| node_reference_engine
node_execution_page -.->|"exports results"| node_export

click node_app "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/App.jsx"
click node_analysis_page "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/pages/QuestionAnalysis.jsx"
click node_generator_page "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/pages/TestCaseGenerator.jsx"
click node_viewer_page "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/pages/TestCaseViewer.jsx"
click node_execution_page "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/pages/TestExecution.jsx"
click node_playground "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/pages/CodePlayground.jsx"
click node_dashboard "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/pages/Dashboard.jsx"
click node_lab_exercise "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/pages/LabExercise.jsx"
click node_history "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/pages/History.jsx"
click node_app_state "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/context/AppContext.jsx"
click node_api_client "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/services/api.js"
click node_browser_runner "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/services/browserExecutionService.js"
click node_reference_engine "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/services/referenceExecutionEngine.js"
click node_output_capture "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/services/outputCaptureEngine.js"
click node_evaluation "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/services/studentEvaluationEngine.js"
click node_export "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/services/exportService.js"
click node_history_store "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/services/db.js"
click node_api "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/main.py"
click node_schemas "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/models/schemas.py"
click node_analyze_route "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/routes/analyze.py"
click node_analyzer "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/services/analyzer_service.py"
click node_format_parser "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/services/input_format_parser.py"
click node_constraints "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/services/constraint_extractor.py"
click node_generate_route "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/routes/generate.py"
click node_generator "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/generators/universal_generator.py"
click node_validator "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/services/input_validator.py"
click node_serializer "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/services/input_serializer.py"
click node_upload_route "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/routes/upload.py"
click node_execution_route "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/routes/execute.py"
click node_execution_service "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/services/execution_service.py"
click node_language_registry "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/services/language_registry.py"
click node_languages_route "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/routes/languages.py"
click node_health_route "https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/routes/health.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_analysis_page,node_generator_page,node_viewer_page,node_execution_page,node_playground,node_dashboard,node_lab_exercise,node_history,node_app_state,node_api_client,node_export,node_history_store,node_student toneBlue
class node_analyzer,node_format_parser,node_constraints toneAmber
class node_generator,node_validator,node_serializer toneMint
class node_browser_runner,node_reference_engine,node_output_capture,node_evaluation,node_execution_service,node_language_registry toneRose
class node_api,node_schemas,node_analyze_route,node_generate_route,node_upload_route,node_execution_route,node_languages_route,node_health_route toneIndigo
```

## Components

### Frontend workflow

- [Workbench shell](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Question analysis](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/pages/QuestionAnalysis.jsx): `frontend/src/pages/QuestionAnalysis.jsx`
- [Test case generator](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/pages/TestCaseGenerator.jsx): `frontend/src/pages/TestCaseGenerator.jsx`
- [Test case viewer](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/pages/TestCaseViewer.jsx): `frontend/src/pages/TestCaseViewer.jsx`
- [Test execution](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/pages/TestExecution.jsx): `frontend/src/pages/TestExecution.jsx`
- [Code playground](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/pages/CodePlayground.jsx): `frontend/src/pages/CodePlayground.jsx`
- [Dashboard](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Lab exercises](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/pages/LabExercise.jsx): `frontend/src/pages/LabExercise.jsx`
- [Run history](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/pages/History.jsx): `frontend/src/pages/History.jsx`
- [Shared app state](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/context/AppContext.jsx): `frontend/src/context/AppContext.jsx`
- [API client](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Result export](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/services/exportService.js): `frontend/src/services/exportService.js`
- [Local data store](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/services/db.js): `frontend/src/services/db.js`

### Problem analysis

- [Question understanding](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/services/analyzer_service.py): `backend/services/analyzer_service.py`
- [Input format parser](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/services/input_format_parser.py): `backend/services/input_format_parser.py`
- [Constraint extraction](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/services/constraint_extractor.py): `backend/services/constraint_extractor.py`

### Test design

- [Universal test generator](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/generators/universal_generator.py): `backend/generators/universal_generator.py`
- [Input validator](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/services/input_validator.py): `backend/services/input_validator.py`
- [Input serializer](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/services/input_serializer.py): `backend/services/input_serializer.py`

### Execution and evaluation

- [Browser execution](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/services/browserExecutionService.js): `frontend/src/services/browserExecutionService.js`
- [Reference runner](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/services/referenceExecutionEngine.js): `frontend/src/services/referenceExecutionEngine.js`
- [Output normalization](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/services/outputCaptureEngine.js): `frontend/src/services/outputCaptureEngine.js`
- [Student evaluation](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/frontend/src/services/studentEvaluationEngine.js): `frontend/src/services/studentEvaluationEngine.js`
- [Host execution service](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/services/execution_service.py): `backend/services/execution_service.py`
- [Language registry](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/services/language_registry.py): `backend/services/language_registry.py`

### Backend API

- [FastAPI application](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/main.py): `backend/main.py`
- [API schemas](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/models/schemas.py): `backend/models/schemas.py`
- [Analysis endpoint](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/routes/analyze.py): `backend/routes/analyze.py`
- [Generation endpoint](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/routes/generate.py): `backend/routes/generate.py`
- [Upload endpoint](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/routes/upload.py): `backend/routes/upload.py`
- [Execution endpoint](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/routes/execute.py): `backend/routes/execute.py`
- [Languages endpoint](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/routes/languages.py): `backend/routes/languages.py`
- [Health endpoint](https://github.com/skyuvaraj2007-web/nila-test-lab/blob/main/backend/routes/health.py): `backend/routes/health.py`

### Other components

- **Lab user**

## Connections

- Lab user → Workbench shell: uses
- Workbench shell → Question analysis: routes to (evidence: `frontend/src/App.jsx`)
- Workbench shell → Test case generator: routes to (evidence: `frontend/src/App.jsx`)
- Workbench shell → Test case viewer: routes to (evidence: `frontend/src/App.jsx`)
- Workbench shell → Test execution: routes to (evidence: `frontend/src/App.jsx`)
- Workbench shell → Code playground: routes to (evidence: `frontend/src/App.jsx`)
- Workbench shell → Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Workbench shell → Lab exercises: routes to (evidence: `frontend/src/App.jsx`)
- Workbench shell → Run history: routes to (evidence: `frontend/src/App.jsx`)
- Workbench shell → Shared app state: uses (evidence: `frontend/src/App.jsx`)
- FastAPI application → Analysis endpoint: registers (evidence: `backend/main.py`)
- FastAPI application → Generation endpoint: registers (evidence: `backend/main.py`)
- FastAPI application → Upload endpoint: registers (evidence: `backend/main.py`)
- FastAPI application → Execution endpoint: registers (evidence: `backend/main.py`)
- FastAPI application → Languages endpoint: registers (evidence: `backend/main.py`)
- FastAPI application → Health endpoint: registers (evidence: `backend/main.py`)
- Analysis endpoint → Question understanding: delegates to
- Question understanding → Input format parser: parses with (evidence: `backend/services/analyzer_service.py`)
- Question understanding → Constraint extraction: extracts with (evidence: `backend/services/analyzer_service.py`)
- Generation endpoint → Input validator: validates with (evidence: `backend/routes/generate.py`)
- Generation endpoint → Input format parser: parses contract (evidence: `backend/routes/generate.py`)
- Generation endpoint → Constraint extraction: extracts constraints (evidence: `backend/routes/generate.py`)
- Generation endpoint → Universal test generator: generates with
- Universal test generator → Input format parser: parses with (evidence: `backend/generators/universal_generator.py`)
- Universal test generator → Constraint extraction: extracts with (evidence: `backend/generators/universal_generator.py`)
- Universal test generator → Input serializer: serializes via (evidence: `backend/generators/universal_generator.py`)
- Execution endpoint → Host execution service: delegates to
- Host execution service → Language registry: checks language (evidence: `backend/services/execution_service.py`)
- Reference runner → Output normalization: classifies output (evidence: `frontend/src/services/referenceExecutionEngine.js`)
- Student evaluation → Output normalization: normalizes output (evidence: `frontend/src/services/studentEvaluationEngine.js`)
- Shared app state → Local data store: persists state
- Test execution → Student evaluation: evaluates results
- Test execution → Browser execution: runs code
- Test case generator → API client: requests generation
- Question analysis → API client: requests analysis
- API client → FastAPI application: sends API requests
- Test execution → Reference runner: runs reference suite
- Test execution → Result export: exports results
