How sanchikb01/securex works
Project type and purpose
• This is a full-stack online exam-proctoring application (“SecureX”).
• Frontend: a React single-page-app under securex-main (teachers’ and students’ UIs).
• Backend: a Python service (Flask or similar) in backend/app.py with OpenCV-based face detection using the Haar cascade XMLs.
• Purpose: deliver exams, stream/process webcam, detect faces in real time, log suspicious activity, manage tests, and show a leaderboard.
File structure
• Top level:
• backend/ – Python API service & face-detection logic.
• haarcascades/ – XML files for OpenCV classifiers.
• securex-main/ – React app (public/, src/, package.json).
• React side: typical create-react-app structure → components (Login, Create, CustomNavbars), containers (Auth, Exam, MPage, StPage, TcPage), index.js.
• No explicit DB folder → likely an external database or in-code ORM.
• Config files: package.json (frontend), potential requirements.txt or implicit in backend.
README
• Real-time webcam monitoring (face detection).
• Teachers manage tests.
• Students take full-screen exams.
• Activity tracking + performance leaderboard.
Main components & relationships
a. Components
• Student Browser (React SPA).
• Teacher Browser (React SPA).
• API Gateway / Backend Server (Flask)
• Face Detection Engine (OpenCV + Haar cascades)
• Data Store (e.g., relational DB for users, exams, logs, scores)
• Leaderboard Service (could be part of backend)
• External Services (e.g., authentication, CDN for static assets).
b. Interactions
1. Student/Teacher load SPA → HTTP(S) GET → CDN/Backend serves bundle.
2. Teacher SPA → REST API calls → create/manage exams → DB.
3. Student SPA → “Start Exam” → full-screen mode → webcam capture → WebRTC or periodic POST of frames → Backend.
4. Backend invokes Face Detection Engine → uses haarcascade XMLs → returns pass/fail or activity logs → store in DB.
5. Backend pushes real-time events (e.g., via WebSocket) → SPA displays alerts or status.
6. After exam → Backend computes results → updates leaderboard → Teacher/Student SPA GETs leaderboard.
c. Architectural patterns & principles
• Separation of concerns: React UI vs. Python API vs. vision-processing engine.
• Modularization: Haar cascades loaded dynamically.
• Real-time streaming or polling for face-detection results.
• Stateless frontend, stateful backend (DB).
d. Key technologies
• Frontend: React, JSX, CSS Modules, create-react-app.
• Backend: Flask (or similar), Python 3.x, OpenCV.
• Face models: haarcascade_*.xml.
• Data Store: MySQL/Postgres/Mongo (not shown but implied).
• Communication: REST + optional WebSockets/WebRTC.