# moh0009/pace-platform architecture

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

- Interactive diagram: https://gitdiagram.com/moh0009/pace-platform
- Repository: https://github.com/moh0009/pace-platform

## Overview

PACE is a student-grade CSV ingestion and registry application. Users select files, upload them in chunks, start background processing, watch upload and processing progress, then browse and edit the resulting student records. The README documents parallel ingestion, Redis-backed jobs and progress, and server-side filtering and keyset pagination. The sampled source confirms frontend upload/state and table behavior plus queue, worker, and student-query logic; upload, processing, and WebSocket handler internals are represented from the documented workflow, with wiring details limited accordingly.

Main entry points: [`backend/handlers/process.go`](https://github.com/moh0009/pace-platform/blob/main/backend/handlers/process.go) (CSV Ingestion), [`backend/handlers/students.go`](https://github.com/moh0009/pace-platform/blob/main/backend/handlers/students.go) (Student Endpoints), [`frontend/pace-front_end/components/UploadSection.jsx`](https://github.com/moh0009/pace-platform/blob/main/frontend/pace-front_end/components/UploadSection.jsx) (Upload Section), [`backend/handlers/upload.go`](https://github.com/moh0009/pace-platform/blob/main/backend/handlers/upload.go) (Upload Endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["CSV Ingestion"]
  node_upload_api["Upload Endpoint<br/>[upload.go]"]
  node_chunk_store[("Chunk Files<br/>[upload.go]")]
  node_process_api["Process Endpoint<br/>[process.go]"]
  node_job_queue["Redis Job Queue<br/>[queue.go]"]
  node_worker_pool["Worker Pool<br/>[worker.go]"]
  node_csv_ingestion["CSV Ingestion<br/>[process.go]"]
end

subgraph group_progress["Job Progress"]
  node_redis[("Redis")]
  node_progress_api["Progress WebSocket<br/>[websocket.go]"]
end

subgraph group_registry["Student Registry"]
  node_students_api["Student Endpoints<br/>[students.go]"]
  node_student_db[("Student Database<br/>[students.go]")]
end

subgraph group_client["Web Client"]
  node_upload_ui["Upload Section<br/>[UploadSection.jsx]"]
  node_upload_hook["Upload Handler"]
  node_file_state["File State<br/>[FileContext.jsx]"]
  node_process_hook["Process Request"]
  node_socket_manager["Socket Manager"]
  node_students_ui["Students Table<br/>[StudentsTable.jsx]"]
  node_student_controls["Student Controls"]
  node_metrics["Upload Metrics"]
end

node_user(("User"))
node_browser(("Browser"))

node_user -->|"selects files"| node_upload_ui
node_upload_ui -->|"starts upload"| node_upload_hook
node_upload_hook -->|"posts chunks"| node_upload_api
node_upload_api -->|"writes chunks"| node_chunk_store
node_upload_api -->|"publishes upload progress"| node_redis
node_upload_hook -->|"posts process request"| node_process_api
node_process_api -->|"enqueues job"| node_job_queue
node_worker_pool -->|"dequeues jobs"| node_job_queue
node_worker_pool -->|"runs processor"| node_csv_ingestion
node_csv_ingestion -->|"reads merged CSV"| node_chunk_store
node_csv_ingestion -->|"upserts student rows"| node_student_db
node_csv_ingestion -->|"publishes process progress"| node_redis
node_progress_api -->|"subscribes progress"| node_redis
node_socket_manager -->|"opens WebSocket"| node_progress_api
node_progress_api -->|"streams progress"| node_browser
node_user -->|"browses records"| node_students_ui
node_students_ui -->|"fetches and paginates"| node_students_api
node_students_api -->|"queries records"| node_student_db
node_student_controls -->|"updates or deletes"| node_students_api
node_file_state -->|"provides file state"| node_upload_ui
node_file_state -->|"persists metadata"| node_browser
node_metrics -->|"calculates durations"| node_upload_ui
node_students_api -->|"returns results"| node_students_ui

click node_upload_ui "https://github.com/moh0009/pace-platform/blob/main/frontend/pace-front_end/components/UploadSection.jsx"
click node_upload_hook "https://github.com/moh0009/pace-platform/blob/main/frontend/pace-front_end/hooks/useUploadHandler.js"
click node_file_state "https://github.com/moh0009/pace-platform/blob/main/frontend/pace-front_end/context/FileContext.jsx"
click node_upload_api "https://github.com/moh0009/pace-platform/blob/main/backend/handlers/upload.go"
click node_chunk_store "https://github.com/moh0009/pace-platform/blob/main/backend/handlers/upload.go"
click node_process_hook "https://github.com/moh0009/pace-platform/blob/main/frontend/pace-front_end/hooks/useUploadHandler.js"
click node_process_api "https://github.com/moh0009/pace-platform/blob/main/backend/handlers/process.go"
click node_job_queue "https://github.com/moh0009/pace-platform/blob/main/backend/queue/queue.go"
click node_worker_pool "https://github.com/moh0009/pace-platform/blob/main/backend/worker/worker.go"
click node_csv_ingestion "https://github.com/moh0009/pace-platform/blob/main/backend/handlers/process.go"
click node_progress_api "https://github.com/moh0009/pace-platform/blob/main/backend/handlers/websocket.go"
click node_socket_manager "https://github.com/moh0009/pace-platform/blob/main/frontend/pace-front_end/hooks/useWebSocketManager.js"
click node_students_ui "https://github.com/moh0009/pace-platform/blob/main/frontend/pace-front_end/components/StudentsTable.jsx"
click node_students_api "https://github.com/moh0009/pace-platform/blob/main/backend/handlers/students.go"
click node_student_db "https://github.com/moh0009/pace-platform/blob/main/backend/handlers/students.go"
click node_student_controls "https://github.com/moh0009/pace-platform/blob/main/frontend/pace-front_end/components/MinimalDropdown.jsx"
click node_metrics "https://github.com/moh0009/pace-platform/blob/main/frontend/pace-front_end/hooks/useMetricsCalculator.js"

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_upload_api,node_chunk_store,node_process_api,node_job_queue,node_worker_pool,node_csv_ingestion,node_user,node_browser toneBlue
class node_redis,node_progress_api toneAmber
class node_students_api,node_student_db toneMint
class node_upload_ui,node_upload_hook,node_file_state,node_process_hook,node_socket_manager,node_students_ui,node_student_controls,node_metrics toneRose
```

## Components

### CSV Ingestion

- [Upload Endpoint](https://github.com/moh0009/pace-platform/blob/main/backend/handlers/upload.go): `backend/handlers/upload.go`
- [Chunk Files](https://github.com/moh0009/pace-platform/blob/main/backend/handlers/upload.go): `backend/handlers/upload.go`
- [Process Endpoint](https://github.com/moh0009/pace-platform/blob/main/backend/handlers/process.go): `backend/handlers/process.go`
- [Redis Job Queue](https://github.com/moh0009/pace-platform/blob/main/backend/queue/queue.go): `backend/queue/queue.go`
- [Worker Pool](https://github.com/moh0009/pace-platform/blob/main/backend/worker/worker.go): `backend/worker/worker.go`
- [CSV Ingestion](https://github.com/moh0009/pace-platform/blob/main/backend/handlers/process.go): `backend/handlers/process.go`

### Job Progress

- **Redis**
- [Progress WebSocket](https://github.com/moh0009/pace-platform/blob/main/backend/handlers/websocket.go): `backend/handlers/websocket.go`

### Student Registry

- [Student Endpoints](https://github.com/moh0009/pace-platform/blob/main/backend/handlers/students.go): `backend/handlers/students.go`
- [Student Database](https://github.com/moh0009/pace-platform/blob/main/backend/handlers/students.go): `backend/handlers/students.go`

### Web Client

- [Upload Section](https://github.com/moh0009/pace-platform/blob/main/frontend/pace-front_end/components/UploadSection.jsx): `frontend/pace-front_end/components/UploadSection.jsx`
- [Upload Handler](https://github.com/moh0009/pace-platform/blob/main/frontend/pace-front_end/hooks/useUploadHandler.js): `frontend/pace-front_end/hooks/useUploadHandler.js`
- [File State](https://github.com/moh0009/pace-platform/blob/main/frontend/pace-front_end/context/FileContext.jsx): `frontend/pace-front_end/context/FileContext.jsx`
- [Process Request](https://github.com/moh0009/pace-platform/blob/main/frontend/pace-front_end/hooks/useUploadHandler.js): `frontend/pace-front_end/hooks/useUploadHandler.js`
- [Socket Manager](https://github.com/moh0009/pace-platform/blob/main/frontend/pace-front_end/hooks/useWebSocketManager.js): `frontend/pace-front_end/hooks/useWebSocketManager.js`
- [Students Table](https://github.com/moh0009/pace-platform/blob/main/frontend/pace-front_end/components/StudentsTable.jsx): `frontend/pace-front_end/components/StudentsTable.jsx`
- [Student Controls](https://github.com/moh0009/pace-platform/blob/main/frontend/pace-front_end/components/MinimalDropdown.jsx): `frontend/pace-front_end/components/MinimalDropdown.jsx`
- [Upload Metrics](https://github.com/moh0009/pace-platform/blob/main/frontend/pace-front_end/hooks/useMetricsCalculator.js): `frontend/pace-front_end/hooks/useMetricsCalculator.js`

### Other components

- **User**
- **Browser**

## Connections

- User → Upload Section: selects files
- Upload Section → Upload Handler: starts upload
- Upload Handler → Upload Endpoint: posts chunks
- Upload Endpoint → Chunk Files: writes chunks
- Upload Endpoint → Redis: publishes upload progress
- Upload Handler → Process Endpoint: posts process request
- Process Endpoint → Redis Job Queue: enqueues job
- Worker Pool → Redis Job Queue: dequeues jobs
- Worker Pool → CSV Ingestion: runs processor
- CSV Ingestion → Chunk Files: reads merged CSV
- CSV Ingestion → Student Database: upserts student rows
- CSV Ingestion → Redis: publishes process progress
- Progress WebSocket → Redis: subscribes progress
- Socket Manager → Progress WebSocket: opens WebSocket
- Progress WebSocket → Browser: streams progress
- User → Students Table: browses records
- Students Table → Student Endpoints: fetches and paginates
- Student Endpoints → Student Database: queries records
- Student Controls → Student Endpoints: updates or deletes
- File State → Upload Section: provides file state
- File State → Browser: persists metadata
- Upload Metrics → Upload Section: calculates durations
- Student Endpoints → Students Table: returns results
