# pavitram239/codify architecture

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

- Interactive diagram: https://gitdiagram.com/pavitram239/codify
- Repository: https://github.com/pavitram239/codify

## Overview

The repository is an automatic code-assessment platform: learners browse problems, write and submit solutions, and review evaluation results; faculty and administrators manage problems, contests, and accounts. The React client communicates with the current Django REST API. Submission evaluation runs asynchronously through Celery and Judge0, with results stored for later viewing. The README also documents contests, account approval, drafts, and AI-assisted problem creation; those capabilities are represented, though their detailed wiring is not established by the sampled source.

Main entry points: [`django_backend/config/urls.py`](https://github.com/pavitram239/codify/blob/master/django_backend/config/urls.py) (API routing), [`client/src/utils/axiosInstance.js`](https://github.com/pavitram239/codify/blob/master/client/src/utils/axiosInstance.js) (API client), [`django_backend/config/settings/base.py`](https://github.com/pavitram239/codify/blob/master/django_backend/config/settings/base.py) (Application database), [`django_backend/apps/execution/tasks.py`](https://github.com/pavitram239/codify/blob/master/django_backend/apps/execution/tasks.py) (Async evaluator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_react["React application<br/>[App.jsx]"]
  node_problem_ui["Problem workspace<br/>[Problem.jsx]"]
  node_editor["Code editor<br/>[CodeEditor.jsx]"]
  node_contest_ui["Contest views<br/>[Contest.jsx]"]
  node_admin_ui["Admin and faculty views<br/>[AdminPage.jsx]"]
  node_client_state["Client state<br/>[store.js]"]
  node_api_client["API client<br/>[axiosInstance.js]"]
end

subgraph group_identity["Accounts and administration"]
  node_user_api["Account API<br/>[views.py]"]
  node_user_models["Account records<br/>[models.py]"]
  node_faculty_api["Faculty management<br/>[views_faculty.py]"]
  node_admin_api["Admin management<br/>[views_admin.py]"]
end

subgraph group_assessment["Problems and contests"]
  node_problem_api["Problem API<br/>[views.py]"]
  node_problem_models["Problem records<br/>[models.py]"]
  node_ai_service["AI problem generation<br/>[ai_service.py]"]
  node_contest_api["Contest API<br/>[views.py]"]
  node_contest_models["Contest records<br/>[models.py]"]
  node_draft_api["Code drafts API<br/>[views.py]"]
end

subgraph group_evaluation["Submission evaluation"]
  node_submission_api["Submission API<br/>[views.py]"]
  node_submission_records["Submission records<br/>[models.py]"]
  node_worker["Async evaluator<br/>[tasks.py]"]
  node_judge_client["Judge0 client<br/>[services.py]"]
end

subgraph group_platform["API and persistence"]
  node_api_routes["API routing<br/>[urls.py]"]
  node_database[("Application database<br/>[base.py]")]
  node_task_queue["Celery task queue<br/>[celery.py]"]
end

node_learner(("Student or faculty"))
node_judge0["Judge0 execution service"]
node_gemini["Gemini generation service"]

node_learner -->|"uses"| node_react
node_react -->|"dispatches"| node_client_state
node_problem_ui -->|"requests data"| node_api_client
node_editor -->|"submits code"| node_api_client
node_contest_ui -->|"requests contests"| node_api_client
node_admin_ui -->|"manages records"| node_api_client
node_api_client -->|"sends API requests"| node_api_routes
node_api_routes -->|"routes accounts"| node_user_api
node_api_routes -->|"routes faculty"| node_faculty_api
node_api_routes -->|"routes administration"| node_admin_api
node_api_routes -->|"routes problems"| node_problem_api
node_api_routes -->|"routes contests"| node_contest_api
node_api_routes -->|"routes drafts"| node_draft_api
node_api_routes -->|"routes submissions"| node_submission_api
node_user_api -->|"reads and writes"| node_user_models
node_faculty_api -->|"manages accounts"| node_user_models
node_admin_api -->|"manages accounts"| node_user_models
node_problem_api -->|"reads and writes"| node_problem_models
node_problem_api -.->|"generates problems"| node_ai_service
node_ai_service -.->|"requests generation"| node_gemini
node_contest_api -->|"reads and writes"| node_contest_models
node_draft_api -->|"persists drafts"| node_database
node_submission_api -->|"creates and reads"| node_submission_records
node_submission_api -->|"queues evaluation"| node_task_queue
node_task_queue -->|"dispatches task"| node_worker
node_worker -->|"reads test cases"| node_problem_models
node_worker -->|"evaluates code"| node_judge_client
node_judge_client -->|"submits and polls"| node_judge0
node_worker -->|"stores results"| node_submission_records
node_user_models -->|"persists records"| node_database
node_problem_models -->|"persists records"| node_database
node_contest_models -->|"persists records"| node_database
node_submission_records -->|"persists records"| node_database

click node_react "https://github.com/pavitram239/codify/blob/master/client/src/App.jsx"
click node_problem_ui "https://github.com/pavitram239/codify/blob/master/client/src/componets/Problem/Problem.jsx"
click node_editor "https://github.com/pavitram239/codify/blob/master/client/src/componets/CodeEditor/CodeEditor.jsx"
click node_contest_ui "https://github.com/pavitram239/codify/blob/master/client/src/componets/Contest/Contest.jsx"
click node_admin_ui "https://github.com/pavitram239/codify/blob/master/client/src/componets/Admin/AdminPage.jsx"
click node_client_state "https://github.com/pavitram239/codify/blob/master/client/src/redux/store.js"
click node_api_client "https://github.com/pavitram239/codify/blob/master/client/src/utils/axiosInstance.js"
click node_user_api "https://github.com/pavitram239/codify/blob/master/django_backend/apps/users/views.py"
click node_user_models "https://github.com/pavitram239/codify/blob/master/django_backend/apps/users/models.py"
click node_faculty_api "https://github.com/pavitram239/codify/blob/master/django_backend/apps/users/views_faculty.py"
click node_admin_api "https://github.com/pavitram239/codify/blob/master/django_backend/apps/users/views_admin.py"
click node_problem_api "https://github.com/pavitram239/codify/blob/master/django_backend/apps/problems/views.py"
click node_problem_models "https://github.com/pavitram239/codify/blob/master/django_backend/apps/problems/models.py"
click node_ai_service "https://github.com/pavitram239/codify/blob/master/django_backend/apps/problems/services/ai_service.py"
click node_contest_api "https://github.com/pavitram239/codify/blob/master/django_backend/apps/contests/views.py"
click node_contest_models "https://github.com/pavitram239/codify/blob/master/django_backend/apps/contests/models.py"
click node_draft_api "https://github.com/pavitram239/codify/blob/master/django_backend/apps/code_drafts/views.py"
click node_submission_api "https://github.com/pavitram239/codify/blob/master/django_backend/apps/submissions/views.py"
click node_submission_records "https://github.com/pavitram239/codify/blob/master/django_backend/apps/submissions/models.py"
click node_worker "https://github.com/pavitram239/codify/blob/master/django_backend/apps/execution/tasks.py"
click node_judge_client "https://github.com/pavitram239/codify/blob/master/django_backend/apps/execution/services.py"
click node_api_routes "https://github.com/pavitram239/codify/blob/master/django_backend/config/urls.py"
click node_database "https://github.com/pavitram239/codify/blob/master/django_backend/config/settings/base.py"
click node_task_queue "https://github.com/pavitram239/codify/blob/master/django_backend/config/celery.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_react,node_problem_ui,node_editor,node_contest_ui,node_admin_ui,node_client_state,node_api_client toneBlue
class node_user_api,node_user_models,node_faculty_api,node_admin_api toneAmber
class node_problem_api,node_problem_models,node_ai_service,node_contest_api,node_contest_models,node_draft_api toneMint
class node_submission_api,node_submission_records,node_worker,node_judge_client toneRose
class node_api_routes,node_database,node_task_queue,node_learner,node_judge0,node_gemini toneIndigo
```

## Components

### React client

- [React application](https://github.com/pavitram239/codify/blob/master/client/src/App.jsx): `client/src/App.jsx`
- [Problem workspace](https://github.com/pavitram239/codify/blob/master/client/src/componets/Problem/Problem.jsx): `client/src/componets/Problem/Problem.jsx`
- [Code editor](https://github.com/pavitram239/codify/blob/master/client/src/componets/CodeEditor/CodeEditor.jsx): `client/src/componets/CodeEditor/CodeEditor.jsx`
- [Contest views](https://github.com/pavitram239/codify/blob/master/client/src/componets/Contest/Contest.jsx): `client/src/componets/Contest/Contest.jsx`
- [Admin and faculty views](https://github.com/pavitram239/codify/blob/master/client/src/componets/Admin/AdminPage.jsx): `client/src/componets/Admin/AdminPage.jsx`
- [Client state](https://github.com/pavitram239/codify/blob/master/client/src/redux/store.js): `client/src/redux/store.js`
- [API client](https://github.com/pavitram239/codify/blob/master/client/src/utils/axiosInstance.js): `client/src/utils/axiosInstance.js`

### Accounts and administration

- [Account API](https://github.com/pavitram239/codify/blob/master/django_backend/apps/users/views.py): `django_backend/apps/users/views.py`
- [Account records](https://github.com/pavitram239/codify/blob/master/django_backend/apps/users/models.py): `django_backend/apps/users/models.py`
- [Faculty management](https://github.com/pavitram239/codify/blob/master/django_backend/apps/users/views_faculty.py): `django_backend/apps/users/views_faculty.py`
- [Admin management](https://github.com/pavitram239/codify/blob/master/django_backend/apps/users/views_admin.py): `django_backend/apps/users/views_admin.py`

### Problems and contests

- [Problem API](https://github.com/pavitram239/codify/blob/master/django_backend/apps/problems/views.py): `django_backend/apps/problems/views.py`
- [Problem records](https://github.com/pavitram239/codify/blob/master/django_backend/apps/problems/models.py): `django_backend/apps/problems/models.py`
- [AI problem generation](https://github.com/pavitram239/codify/blob/master/django_backend/apps/problems/services/ai_service.py): `django_backend/apps/problems/services/ai_service.py`
- [Contest API](https://github.com/pavitram239/codify/blob/master/django_backend/apps/contests/views.py): `django_backend/apps/contests/views.py`
- [Contest records](https://github.com/pavitram239/codify/blob/master/django_backend/apps/contests/models.py): `django_backend/apps/contests/models.py`
- [Code drafts API](https://github.com/pavitram239/codify/blob/master/django_backend/apps/code_drafts/views.py): `django_backend/apps/code_drafts/views.py`

### Submission evaluation

- [Submission API](https://github.com/pavitram239/codify/blob/master/django_backend/apps/submissions/views.py): `django_backend/apps/submissions/views.py`
- [Submission records](https://github.com/pavitram239/codify/blob/master/django_backend/apps/submissions/models.py): `django_backend/apps/submissions/models.py`
- [Async evaluator](https://github.com/pavitram239/codify/blob/master/django_backend/apps/execution/tasks.py): `django_backend/apps/execution/tasks.py`
- [Judge0 client](https://github.com/pavitram239/codify/blob/master/django_backend/apps/execution/services.py): `django_backend/apps/execution/services.py`

### API and persistence

- [API routing](https://github.com/pavitram239/codify/blob/master/django_backend/config/urls.py): `django_backend/config/urls.py`
- [Application database](https://github.com/pavitram239/codify/blob/master/django_backend/config/settings/base.py): `django_backend/config/settings/base.py`
- [Celery task queue](https://github.com/pavitram239/codify/blob/master/django_backend/config/celery.py): `django_backend/config/celery.py`

### Other components

- **Student or faculty**
- **Judge0 execution service**
- **Gemini generation service**

## Connections

- Student or faculty → React application: uses
- React application → Client state: dispatches
- Problem workspace → API client: requests data
- Code editor → API client: submits code
- Contest views → API client: requests contests
- Admin and faculty views → API client: manages records
- API client → API routing: sends API requests
- API routing → Account API: routes accounts
- API routing → Faculty management: routes faculty
- API routing → Admin management: routes administration
- API routing → Problem API: routes problems
- API routing → Contest API: routes contests
- API routing → Code drafts API: routes drafts
- API routing → Submission API: routes submissions
- Account API → Account records: reads and writes
- Faculty management → Account records: manages accounts
- Admin management → Account records: manages accounts
- Problem API → Problem records: reads and writes
- Problem API → AI problem generation: generates problems
- AI problem generation → Gemini generation service: requests generation
- Contest API → Contest records: reads and writes
- Code drafts API → Application database: persists drafts
- Submission API → Submission records: creates and reads
- Submission API → Celery task queue: queues evaluation
- Celery task queue → Async evaluator: dispatches task
- Async evaluator → Problem records: reads test cases
- Async evaluator → Judge0 client: evaluates code
- Judge0 client → Judge0 execution service: submits and polls
- Async evaluator → Submission records: stores results
- Account records → Application database: persists records
- Problem records → Application database: persists records
- Contest records → Application database: persists records
- Submission records → Application database: persists records
