How mithilesh-24/pet-application works
PET Prep is a local-first mock-exam platform. Students import encrypted or draft papers, start a timed forward-only exam, answer MCQs and code questions in a native OS sandbox, then review scores, analytics, and attempt history. The graph follows the documented workflow and preserves the paper, exam, execution, results, and settings capabilities. Evidence is limited to the supplied excerpts, SOURCE INDEX references, and README; unsampled subsystem links are omitted where their callers are not shown.
Main entry points: App.jsx Page routing · server.js HTTP server · apiClient.js API client · paperImportService.js Paper import
Components 29
Student experience
- Page routing
frontend/src/App.jsx - Home and prompts
frontend/src/pages/Home.jsx - Paper upload
frontend/src/pages/Upload.jsx - Exam workspace
frontend/src/pages/Exam.jsx - Coding workspace
frontend/src/components/CodingWorkspace.jsx - Attempt history
frontend/src/pages/History.jsx - Results review
frontend/src/pages/Results.jsx - Settings and syllabus
frontend/src/pages/Settings.jsx - API client
frontend/src/services/apiClient.js
Paper management
- Paper routes
backend/routes/paperRoutes.js - Paper import
backend/services/paperImportService.js - Question validation
backend/services/questionValidator.js - Paper encryption
backend/services/encryptionService.js - Key store
backend/services/keyStore.js
Exam and scoring
- Exam routes
backend/routes/examRoutes.js - Exam engine
backend/services/examEngine.js - Code judging
backend/services/judgeService.js - Evaluation
backend/services/evaluationService.js - Results service
backend/services/resultService.js - History service
backend/services/historyService.js
Code execution
- Execution engine
backend/compiler/executionEngine.js - Language runners
backend/compiler/languageRunner.js - Sandbox driver
backend/compiler/sandbox/sandboxDriver.js - Compiler detection
backend/compiler/compilerDetector.js
Local platform
- HTTP server
backend/server.js - SQLite database
backend/database/database.js - Data repositories
backend/database/repositories.js - Runtime config
backend/config.js
Other components
- Student
Connections 37
- Student → Page routing: uses
- Page routing → Home and prompts: routes to
frontend/src/App.jsx - Page routing → Paper upload: routes to
frontend/src/App.jsx - Page routing → Exam workspace: routes to
frontend/src/App.jsx - Page routing → Attempt history: routes to
frontend/src/App.jsx - Page routing → Results review: routes to
frontend/src/App.jsx - Page routing → Settings and syllabus: routes to
frontend/src/App.jsx - Home and prompts → Student: generates prompts
- Paper upload → API client: sends upload
- API client → Paper routes: requests API
- Paper routes → Paper import: imports paper
backend/routes/paperRoutes.js - Paper import → Question validation: validates questions
backend/services/paperImportService.js - Paper import → Paper encryption: encrypts paper
backend/services/paperImportService.js - Paper import → Key store: uses keys
backend/services/paperImportService.js - Exam workspace → API client: calls exam API
frontend/src/pages/Exam.jsx - Exam workspace → Coding workspace: renders
frontend/src/pages/Exam.jsx - API client → Exam routes: requests API
- Exam routes → Exam engine: dispatches exam actions
backend/routes/examRoutes.js - Exam routes → Code judging: dispatches code actions
backend/routes/examRoutes.js - Code judging → Execution engine: runs submissions
backend/services/judgeService.js - Exam engine → Paper encryption: decrypts paper
backend/services/examEngine.js - Coding workspace → Student: submits code
- Execution engine → Language runners: selects runner
backend/compiler/executionEngine.js - Execution engine → Sandbox driver: dispatches execution
backend/compiler/executionEngine.js - Sandbox driver → Student: isolates code
- Compiler detection → Sandbox driver: checks sandbox
backend/compiler/compilerDetector.js - Attempt history → API client: loads attempts
frontend/src/pages/History.jsx - Results review → API client: loads results
frontend/src/pages/Results.jsx - HTTP server → Exam engine: creates engine
backend/server.js - HTTP server → Evaluation: creates service
backend/server.js - HTTP server → Results service: creates service
backend/server.js - HTTP server → SQLite database: opens database
backend/server.js - HTTP server → Data repositories: loads repositories
backend/server.js - HTTP server → Execution engine: configures execution
backend/server.js - SQLite database → Runtime config: reads storage config
backend/database/database.js - Evaluation → Results service: evaluates for
- Results service → History service: supports attempt review