How preethamak/codelab1 works
Project type and purpose
• This is a full-stack coding evaluation platform (“CodeLab”) consisting of a React/TypeScript frontend and a FastAPI/Python backend.
• Its main goal is to let students write code in the browser, run it safely in Docker containers, have AI-generated test cases, and view real-time feedback and proctoring data.
File structure
• Top-level “src/” folder houses the entire React app, broken into:
• src/pages – page-level routes (Exam, StudentLogin, Dashboard, etc.)
• src/components – reusable UI components and a large “ui” subfolder with Shadcn UI primitives
• src/hooks and src/lib – shared logic (custom hooks, utility functions)
• configuration files (vite.config.ts, tailwind.config.ts, tsconfig*.json) show a Vite/Tailwind setup
• The README references a parallel “backend/” folder (FastAPI) and Docker configurations (Dockerfile, docker-compose.yml), even though that directory isn’t shown here.
README for additional insights
• Tech stack summary: React + TS / Tailwind / Shadcn UI / Monaco editor on the front end. FastAPI / SQLAlchemy / PostgreSQL / Pydantic / JWT on the back end. Docker for sandboxed execution. OpenAI API for AI-driven test case generation.
• Feature list: real-time code execution, multi-language, plagiarism checking, proctoring dashboard, role-based admin tools.
a. Main components
• Frontend (React app served via Vercel or static host)
• Backend API (FastAPI service)
• Database (PostgreSQL via SQLAlchemy)
• Execution Engine (Docker daemon + language containers)
• AI Service (OpenAI API integration)
• (Optionally) Authentication service (JWT issuer) and Proctoring/WebSocket server for real-time monitoring
b. Relationships & interactions
• End user (student/admin) interacts with Frontend
• Frontend ⇄ Backend over HTTPS REST (and/or WebSocket for real-time proctor events)
• Backend → PostgreSQL for persistence (users, submissions, results)
• Backend → Docker Engine to spin isolated containers, run submitted code, capture output
• Backend → OpenAI API to generate/validate test cases
• Backend → Frontend push updates (execution results, proctor feeds)
c. Architectural patterns
• Layered backend: API layer → service/business logic → data/ORM layer
• Component-based UI with centralized state/hooks
• Container-as-a-service pattern for secure code execution
• Externalized AI microservice
d. Key technologies/frameworks
• React + TypeScript + Vite + Tailwind + Shadcn UI + Monaco Editor
• FastAPI + Pydantic + SQLAlchemy + PostgreSQL + JWT
• Docker & Docker Compose
• OpenAI API