How aarushchaudhary/nm-quiz-app works
Project Type and Purpose
• This is a full-stack, web-based quiz application (“NM Quiz App”) built with PHP (7.4+), MySQL, and standard front-end technologies.
• It serves four distinct user roles (Admin, Faculty, Placement Committee, Student) with real-time monitoring, automated grading, and proctoring.
File Structure Analysis
• Top level:
• api/ – AJAX-style endpoints organized by role (admin, faculty, placecom, shared, student) plus auth.php
• views/ – PHP templates for each role’s UI
• assets/ – CSS, JS, images, Excel templates
• config/ – Database and application constants
• lib/ – Third-party libraries (Chart.js, PHPSpreadsheet, Composer vendor)
• index.php, login.php, logout.php – entry points and session handlers
• schema.sql – database schema
• Architectural hints:
• Separation of concerns: static assets vs. dynamic views vs. API
• Role-based subfolders indicate logical modules
• REST-style API layer feeding JSON to front-end JS
README Insights
• Technology stack and security features (session auth, prepared statements, XSS/CSRF protection) confirm a classic LAMP monolith.
• Features mapped to API calls and view pages reveal the core components and their interactions.
a. Main Components
• Client Browser (HTML/CSS/JS)
• Web Server + PHP Runtime (Apache/Nginx + PHP 7.4+)
• API Layer (api/*.php)
• View Layer (views/*.php + templates)
• Static Assets (assets/css, assets/js, assets/images)
• Business Logic & Config (config/*.php, index.php controllers)
• Database (MySQL/MariaDB)
• External Services/Libraries (Chart.js, PHPSpreadsheet, SMTP for email)
b. Relationships & Data Flow
1. User → Browser UI → Requests view pages or login/logout
2. Browser → AJAX calls → api/*.php → Business logic → Database
3. Database → SQL engine → Returns data to API
4. API → JSON → Browser JS → Updates UI/Chart.js visualizations
5. Admin uploads Excel → PHPSpreadsheet → Business logic → Database
6. System logs and events flow to shared API endpoints → stored/reported
c. Architectural Patterns & Principles
• Monolithic MVC-like separation (views + API + shared business logic)
• RESTful API endpoints for asynchronous operations
• Role-based modularization (admin, faculty, placecom, student)
• Security layers: authentication (api/auth.php), prepared statements, CSRF tokens
d. Key Technologies
• Frontend: HTML5, CSS3, ES6+ JavaScript, Chart.js
• Backend: PHP 7.4+, Composer packages (PHPSpreadsheet), session-based auth
• Data Store: MySQL 5.7+
• Server: Apache/Nginx with mod_rewrite