# machavarapu1977/codenew architecture

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

- Interactive diagram: https://gitdiagram.com/machavarapu1977/codenew
- Repository: https://github.com/machavarapu1977/codenew

## Overview

This is a web-based coding assessment platform for students and instructors. Students select or take assessments, submit code for execution and test-case evaluation, and review feedback; instructors manage questions and assessments, with question generation and vector search as supporting capabilities. The frontend calls a FastAPI backend, which coordinates persistence, execution, and assessment services. Edges reflect the shown excerpts and SOURCE INDEX references; several documented or substantial subsystems have limited sampled implementation evidence.

Main entry points: [`compiler-project/backend/app.py`](https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/app.py) (FastAPI application), [`compiler-project/frontend/src/App.jsx`](https://github.com/machavarapu1977/codenew/blob/master/compiler-project/frontend/src/App.jsx) (Student workspace), [`compiler-project/frontend/src/components/InstructorDashboard.jsx`](https://github.com/machavarapu1977/codenew/blob/master/compiler-project/frontend/src/components/InstructorDashboard.jsx) (Instructor dashboard), [`compiler-project/backend/auth.py`](https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/auth.py) (Authentication and roles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_web_app["Student workspace<br/>[App.jsx]"]
  node_dashboard["Instructor dashboard"]
  node_report["Evaluation report"]
  node_login["Login screen<br/>[LoginPage.jsx]"]
  node_question_agent["Question generator<br/>[questionAgent.js]"]
end

subgraph group_backend["API and domain"]
  node_api["FastAPI application<br/>[app.py]"]
  node_auth["Authentication and roles<br/>[auth.py]"]
  node_schemas["API schemas<br/>[schemas.py]"]
  node_models["Assessment data models<br/>[models.py]"]
  node_database[("Relational database<br/>[database.py]")]
end

subgraph group_execution["Code evaluation"]
  node_evaluator["Submission evaluation<br/>[evaluator.py]"]
  node_feedback["Diagnostic feedback"]
  node_piston["Code execution<br/>[piston_service.py]"]
  node_execution_service["Evaluation service"]
end

subgraph group_question_support["Question support"]
  node_rag["RAG question generation<br/>[rag_service.py]"]
  node_vector_search["Vector indexing and search"]
end

node_student(("Student"))
node_instructor(("Instructor"))
node_piston_service["Piston runtime service"]
node_groq["Groq API"]

node_student -->|"uses"| node_web_app
node_instructor -->|"uses"| node_dashboard
node_web_app -->|"calls HTTP API"| node_api
node_web_app -->|"renders"| node_dashboard
node_web_app -->|"renders"| node_report
node_web_app -.->|"renders"| node_login
node_dashboard -->|"requests generation"| node_question_agent
node_dashboard -->|"saves questions"| node_api
node_api -->|"uses authentication"| node_auth
node_api -->|"uses schemas"| node_schemas
node_api -->|"queries models"| node_models
node_api -->|"uses sessions"| node_database
node_auth -->|"opens sessions"| node_database
node_auth -->|"queries users"| node_models
node_models -->|"declares tables"| node_database
node_api -->|"executes code"| node_piston
node_api -->|"evaluates submissions"| node_evaluator
node_api -->|"generates feedback"| node_feedback
node_api -->|"uses question search"| node_vector_search
node_api -->|"requests generation"| node_rag
node_rag -->|"retrieves references"| node_vector_search
node_rag -->|"generates questions"| node_groq
node_piston -.->|"runs remotely"| node_piston_service
node_api -.->|"coordinates evaluation"| node_execution_service

click node_web_app "https://github.com/machavarapu1977/codenew/blob/master/compiler-project/frontend/src/App.jsx"
click node_dashboard "https://github.com/machavarapu1977/codenew/blob/master/compiler-project/frontend/src/components/InstructorDashboard.jsx"
click node_report "https://github.com/machavarapu1977/codenew/blob/master/compiler-project/frontend/src/components/EvaluationReportModal.jsx"
click node_login "https://github.com/machavarapu1977/codenew/blob/master/compiler-project/frontend/src/components/LoginPage.jsx"
click node_question_agent "https://github.com/machavarapu1977/codenew/blob/master/compiler-project/frontend/src/services/questionAgent.js"
click node_api "https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/app.py"
click node_auth "https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/auth.py"
click node_schemas "https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/schemas.py"
click node_models "https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/models.py"
click node_database "https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/database.py"
click node_evaluator "https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/services/evaluator.py"
click node_feedback "https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/services/feedback_service.py"
click node_piston "https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/services/piston_service.py"
click node_execution_service "https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/services/evaluation_service.py"
click node_rag "https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/services/rag_service.py"
click node_vector_search "https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/services/pinecone_service.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_web_app,node_dashboard,node_report,node_login,node_question_agent toneBlue
class node_api,node_auth,node_schemas,node_models,node_database toneAmber
class node_evaluator,node_feedback,node_piston,node_execution_service,node_groq toneMint
class node_rag,node_vector_search toneRose
class node_student,node_instructor,node_piston_service toneIndigo
```

## Components

### Web application

- [Student workspace](https://github.com/machavarapu1977/codenew/blob/master/compiler-project/frontend/src/App.jsx): `compiler-project/frontend/src/App.jsx`
- [Instructor dashboard](https://github.com/machavarapu1977/codenew/blob/master/compiler-project/frontend/src/components/InstructorDashboard.jsx): `compiler-project/frontend/src/components/InstructorDashboard.jsx`
- [Evaluation report](https://github.com/machavarapu1977/codenew/blob/master/compiler-project/frontend/src/components/EvaluationReportModal.jsx): `compiler-project/frontend/src/components/EvaluationReportModal.jsx`
- [Login screen](https://github.com/machavarapu1977/codenew/blob/master/compiler-project/frontend/src/components/LoginPage.jsx): `compiler-project/frontend/src/components/LoginPage.jsx`
- [Question generator](https://github.com/machavarapu1977/codenew/blob/master/compiler-project/frontend/src/services/questionAgent.js): `compiler-project/frontend/src/services/questionAgent.js`

### API and domain

- [FastAPI application](https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/app.py): `compiler-project/backend/app.py`
- [Authentication and roles](https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/auth.py): `compiler-project/backend/auth.py`
- [API schemas](https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/schemas.py): `compiler-project/backend/schemas.py`
- [Assessment data models](https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/models.py): `compiler-project/backend/models.py`
- [Relational database](https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/database.py): `compiler-project/backend/database.py`

### Code evaluation

- [Submission evaluation](https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/services/evaluator.py): `compiler-project/backend/services/evaluator.py`
- [Diagnostic feedback](https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/services/feedback_service.py): `compiler-project/backend/services/feedback_service.py`
- [Code execution](https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/services/piston_service.py): `compiler-project/backend/services/piston_service.py`
- [Evaluation service](https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/services/evaluation_service.py): `compiler-project/backend/services/evaluation_service.py`

### Question support

- [RAG question generation](https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/services/rag_service.py): `compiler-project/backend/services/rag_service.py`
- [Vector indexing and search](https://github.com/machavarapu1977/codenew/blob/master/compiler-project/backend/services/pinecone_service.py): `compiler-project/backend/services/pinecone_service.py`

### Other components

- **Student**
- **Instructor**
- **Piston runtime service**
- **Groq API**

## Connections

- Student → Student workspace: uses (evidence: `compiler-project/frontend/src/App.jsx`)
- Instructor → Instructor dashboard: uses
- Student workspace → FastAPI application: calls HTTP API (evidence: `compiler-project/frontend/src/App.jsx`)
- Student workspace → Instructor dashboard: renders (evidence: `compiler-project/frontend/src/App.jsx`)
- Student workspace → Evaluation report: renders (evidence: `compiler-project/frontend/src/App.jsx`)
- Student workspace → Login screen: renders
- Instructor dashboard → Question generator: requests generation (evidence: `compiler-project/frontend/src/components/InstructorDashboard.jsx`)
- Instructor dashboard → FastAPI application: saves questions (evidence: `compiler-project/frontend/src/components/InstructorDashboard.jsx`)
- FastAPI application → Authentication and roles: uses authentication (evidence: `compiler-project/backend/app.py`)
- FastAPI application → API schemas: uses schemas (evidence: `compiler-project/backend/app.py`)
- FastAPI application → Assessment data models: queries models (evidence: `compiler-project/backend/app.py`)
- FastAPI application → Relational database: uses sessions (evidence: `compiler-project/backend/app.py`)
- Authentication and roles → Relational database: opens sessions (evidence: `compiler-project/backend/auth.py`)
- Authentication and roles → Assessment data models: queries users (evidence: `compiler-project/backend/auth.py`)
- Assessment data models → Relational database: declares tables (evidence: `compiler-project/backend/models.py`)
- FastAPI application → Code execution: executes code (evidence: `compiler-project/backend/app.py`)
- FastAPI application → Submission evaluation: evaluates submissions (evidence: `compiler-project/backend/app.py`)
- FastAPI application → Diagnostic feedback: generates feedback (evidence: `compiler-project/backend/app.py`)
- FastAPI application → Vector indexing and search: uses question search (evidence: `compiler-project/backend/app.py`)
- FastAPI application → RAG question generation: requests generation (evidence: `compiler-project/backend/app.py`)
- RAG question generation → Vector indexing and search: retrieves references (evidence: `compiler-project/backend/services/rag_service.py`)
- RAG question generation → Groq API: generates questions (evidence: `compiler-project/backend/services/rag_service.py`)
- Code execution → Piston runtime service: runs remotely
- FastAPI application → Evaluation service: coordinates evaluation
