# naveen-arul/code-judgeai architecture

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

- Interactive diagram: https://gitdiagram.com/naveen-arul/code-judgeai
- Repository: https://github.com/naveen-arul/code-judgeai

## Overview

CodeJudge AI is a code-submission evaluation product: its frontend presents student and admin workspaces, while the FastAPI backend accepts submissions and returns structured AI review. The sampled API route invokes the fast evaluator, which integrates with Groq/Ollama and formats assessment results; a separate LangGraph workflow defines a richer multi-agent evaluation path. The frontend excerpt does not show its API calls, so that connection is documented only as an unverified integration. Other UI capabilities are represented by the main application node because the large App excerpt is partial.

Main entry points: [`backend/app/graph/builder.py`](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/graph/builder.py) (Agent graph), [`backend/app/agents/intent_detection_agent.py`](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/agents/intent_detection_agent.py) (Intent detection), [`backend/app/agents/feedback_agent.py`](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/agents/feedback_agent.py) (Feedback synthesis), [`backend/app/services/fast_evaluator.py`](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/services/fast_evaluator.py) (Unified evaluator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Evaluation UI"]
  node_frontend["Workspaces and review<br/>[App.tsx]"]
end

subgraph group_api["Submission API"]
  node_apiapp["HTTP application<br/>[main.py]"]
  node_routes["Evaluation routes<br/>[routes.py]"]
  node_request["Submission schema<br/>[request.py]"]
  node_health["Health endpoint<br/>[health.py]"]
end

subgraph group_eval["Evaluation engines"]
  node_fast["Unified evaluator<br/>[fast_evaluator.py]"]
  node_legacy["Agent evaluator<br/>[evaluator.py]"]
end

subgraph group_agents["Agent workflow"]
  node_workflow["Graph workflow<br/>[workflow.py]"]
  node_builder["Agent graph<br/>[builder.py]"]
  node_state["Evaluation state<br/>[state.py]"]
  node_intent["Intent detection"]
  node_logic["Logic review<br/>[logic_agent.py]"]
  node_tests["Test-case review<br/>[testcase_agent.py]"]
  node_complexity["Complexity review"]
  node_hardcoding["Hardcoding review"]
  node_security["Security review<br/>[security_agent.py]"]
  node_adversarial["Adversarial review"]
  node_feedback["Feedback synthesis<br/>[feedback_agent.py]"]
  node_judge["Final judging<br/>[judge_agent.py]"]
end

subgraph group_shared["Model and output"]
  node_prompts["Agent prompts<br/>[prompts.py]"]
  node_llm["LLM client<br/>[llm.py]"]
  node_config["Model configuration<br/>[config.py]"]
  node_formatter["Result formatting<br/>[formatter.py]"]
  node_json["JSON utilities<br/>[json_utils.py]"]
  node_response["Agent output schema<br/>[agent_output.py]"]
end

node_user(("Student / admin"))
node_models{{"Groq / Ollama"}}

node_user -->|"uses"| node_frontend
node_frontend -.->|"submits code"| node_routes
node_apiapp -->|"mounts routes"| node_routes
node_apiapp -->|"mounts routes"| node_health
node_routes -->|"accepts payload"| node_request
node_routes -->|"runs evaluation"| node_fast
node_fast -->|"requests inference"| node_models
node_fast -->|"formats results"| node_formatter
node_fast -->|"parses output"| node_json
node_fast -->|"reads settings"| node_config
node_workflow -->|"builds graph"| node_builder
node_builder -->|"uses state"| node_state
node_builder -->|"registers node"| node_intent
node_builder -->|"registers node"| node_logic
node_builder -->|"registers node"| node_tests
node_builder -->|"registers node"| node_complexity
node_builder -->|"registers node"| node_hardcoding
node_builder -->|"registers node"| node_security
node_builder -->|"registers node"| node_adversarial
node_builder -->|"registers node"| node_feedback
node_builder -->|"registers node"| node_judge
node_intent -->|"dispatches"| node_logic
node_intent -->|"dispatches"| node_tests
node_intent -->|"dispatches"| node_complexity
node_intent -->|"dispatches"| node_hardcoding
node_intent -->|"dispatches"| node_security
node_intent -->|"dispatches"| node_adversarial
node_logic -->|"feeds review"| node_feedback
node_tests -->|"feeds review"| node_feedback
node_complexity -->|"feeds review"| node_feedback
node_hardcoding -->|"feeds review"| node_feedback
node_security -->|"feeds review"| node_feedback
node_adversarial -->|"feeds review"| node_feedback
node_feedback -->|"sends synthesis"| node_judge
node_intent -->|"invokes agent"| node_legacy
node_intent -->|"uses prompt"| node_prompts
node_fast -.->|"uses client"| node_llm
node_llm -->|"reads keys"| node_config
node_formatter -->|"normalizes schema"| node_response
node_formatter -->|"uses helpers"| node_json

click node_frontend "https://github.com/naveen-arul/code-judgeai/blob/main/replit-frontend/artifacts/codejudge-ai/src/App.tsx"
click node_apiapp "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/main.py"
click node_routes "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/api/routes.py"
click node_request "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/schemas/request.py"
click node_health "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/api/health.py"
click node_fast "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/services/fast_evaluator.py"
click node_legacy "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/services/evaluator.py"
click node_workflow "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/graph/workflow.py"
click node_builder "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/graph/builder.py"
click node_state "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/graph/state.py"
click node_intent "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/agents/intent_detection_agent.py"
click node_logic "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/agents/logic_agent.py"
click node_tests "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/agents/testcase_agent.py"
click node_complexity "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/agents/complexity_agent.py"
click node_hardcoding "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/agents/hardcoding_agent.py"
click node_security "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/agents/security_agent.py"
click node_adversarial "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/agents/adversarial_agent.py"
click node_feedback "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/agents/feedback_agent.py"
click node_judge "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/agents/judge_agent.py"
click node_prompts "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/core/prompts.py"
click node_llm "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/core/llm.py"
click node_config "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/core/config.py"
click node_formatter "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/services/formatter.py"
click node_json "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/utils/json_utils.py"
click node_response "https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/schemas/agent_output.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_frontend toneBlue
class node_apiapp,node_routes,node_request,node_health toneAmber
class node_fast,node_legacy toneMint
class node_workflow,node_builder,node_state,node_intent,node_logic,node_tests,node_complexity,node_hardcoding,node_security,node_adversarial,node_feedback,node_judge toneRose
class node_prompts,node_llm,node_config,node_formatter,node_json,node_response,node_user,node_models toneIndigo
```

## Components

### Evaluation UI

- [Workspaces and review](https://github.com/naveen-arul/code-judgeai/blob/main/replit-frontend/artifacts/codejudge-ai/src/App.tsx): `replit-frontend/artifacts/codejudge-ai/src/App.tsx`

### Submission API

- [HTTP application](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/main.py): `backend/app/main.py`
- [Evaluation routes](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/api/routes.py): `backend/app/api/routes.py`
- [Submission schema](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/schemas/request.py): `backend/app/schemas/request.py`
- [Health endpoint](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/api/health.py): `backend/app/api/health.py`

### Evaluation engines

- [Unified evaluator](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/services/fast_evaluator.py): `backend/app/services/fast_evaluator.py`
- [Agent evaluator](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/services/evaluator.py): `backend/app/services/evaluator.py`

### Agent workflow

- [Graph workflow](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/graph/workflow.py): `backend/app/graph/workflow.py`
- [Agent graph](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/graph/builder.py): `backend/app/graph/builder.py`
- [Evaluation state](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/graph/state.py): `backend/app/graph/state.py`
- [Intent detection](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/agents/intent_detection_agent.py): `backend/app/agents/intent_detection_agent.py`
- [Logic review](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/agents/logic_agent.py): `backend/app/agents/logic_agent.py`
- [Test-case review](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/agents/testcase_agent.py): `backend/app/agents/testcase_agent.py`
- [Complexity review](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/agents/complexity_agent.py): `backend/app/agents/complexity_agent.py`
- [Hardcoding review](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/agents/hardcoding_agent.py): `backend/app/agents/hardcoding_agent.py`
- [Security review](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/agents/security_agent.py): `backend/app/agents/security_agent.py`
- [Adversarial review](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/agents/adversarial_agent.py): `backend/app/agents/adversarial_agent.py`
- [Feedback synthesis](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/agents/feedback_agent.py): `backend/app/agents/feedback_agent.py`
- [Final judging](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/agents/judge_agent.py): `backend/app/agents/judge_agent.py`

### Model and output

- [Agent prompts](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/core/prompts.py): `backend/app/core/prompts.py`
- [LLM client](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/core/llm.py): `backend/app/core/llm.py`
- [Model configuration](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/core/config.py): `backend/app/core/config.py`
- [Result formatting](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/services/formatter.py): `backend/app/services/formatter.py`
- [JSON utilities](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/utils/json_utils.py): `backend/app/utils/json_utils.py`
- [Agent output schema](https://github.com/naveen-arul/code-judgeai/blob/main/backend/app/schemas/agent_output.py): `backend/app/schemas/agent_output.py`

### Other components

- **Student / admin**
- **Groq / Ollama**

## Connections

- Student / admin → Workspaces and review: uses
- Workspaces and review → Evaluation routes: submits code
- HTTP application → Evaluation routes: mounts routes (evidence: `backend/app/main.py`)
- HTTP application → Health endpoint: mounts routes (evidence: `backend/app/main.py`)
- Evaluation routes → Submission schema: accepts payload (evidence: `backend/app/api/routes.py`)
- Evaluation routes → Unified evaluator: runs evaluation (evidence: `backend/app/api/routes.py`)
- Unified evaluator → Groq / Ollama: requests inference (evidence: `backend/app/services/fast_evaluator.py`)
- Unified evaluator → Result formatting: formats results (evidence: `backend/app/services/fast_evaluator.py`)
- Unified evaluator → JSON utilities: parses output (evidence: `backend/app/services/fast_evaluator.py`)
- Unified evaluator → Model configuration: reads settings (evidence: `backend/app/services/fast_evaluator.py`)
- Graph workflow → Agent graph: builds graph (evidence: `backend/app/graph/workflow.py`)
- Agent graph → Evaluation state: uses state (evidence: `backend/app/graph/builder.py`)
- Agent graph → Intent detection: registers node (evidence: `backend/app/graph/builder.py`)
- Agent graph → Logic review: registers node (evidence: `backend/app/graph/builder.py`)
- Agent graph → Test-case review: registers node (evidence: `backend/app/graph/builder.py`)
- Agent graph → Complexity review: registers node (evidence: `backend/app/graph/builder.py`)
- Agent graph → Hardcoding review: registers node (evidence: `backend/app/graph/builder.py`)
- Agent graph → Security review: registers node (evidence: `backend/app/graph/builder.py`)
- Agent graph → Adversarial review: registers node (evidence: `backend/app/graph/builder.py`)
- Agent graph → Feedback synthesis: registers node (evidence: `backend/app/graph/builder.py`)
- Agent graph → Final judging: registers node (evidence: `backend/app/graph/builder.py`)
- Intent detection → Logic review: dispatches (evidence: `backend/app/graph/builder.py`)
- Intent detection → Test-case review: dispatches (evidence: `backend/app/graph/builder.py`)
- Intent detection → Complexity review: dispatches (evidence: `backend/app/graph/builder.py`)
- Intent detection → Hardcoding review: dispatches (evidence: `backend/app/graph/builder.py`)
- Intent detection → Security review: dispatches (evidence: `backend/app/graph/builder.py`)
- Intent detection → Adversarial review: dispatches (evidence: `backend/app/graph/builder.py`)
- Logic review → Feedback synthesis: feeds review (evidence: `backend/app/graph/builder.py`)
- Test-case review → Feedback synthesis: feeds review (evidence: `backend/app/graph/builder.py`)
- Complexity review → Feedback synthesis: feeds review (evidence: `backend/app/graph/builder.py`)
- Hardcoding review → Feedback synthesis: feeds review (evidence: `backend/app/graph/builder.py`)
- Security review → Feedback synthesis: feeds review (evidence: `backend/app/graph/builder.py`)
- Adversarial review → Feedback synthesis: feeds review (evidence: `backend/app/graph/builder.py`)
- Feedback synthesis → Final judging: sends synthesis (evidence: `backend/app/graph/builder.py`)
- Intent detection → Agent evaluator: invokes agent (evidence: `backend/app/agents/intent_detection_agent.py`)
- Intent detection → Agent prompts: uses prompt (evidence: `backend/app/agents/intent_detection_agent.py`)
- Unified evaluator → LLM client: uses client (evidence: `backend/app/services/fast_evaluator.py`)
- LLM client → Model configuration: reads keys (evidence: `backend/app/core/llm.py`)
- Result formatting → Agent output schema: normalizes schema (evidence: `backend/app/services/formatter.py`)
- Result formatting → JSON utilities: uses helpers (evidence: `backend/app/services/formatter.py`)
