The Examination Management System Frontend is a feature-rich React application that provides an intuitive interface for students and instructors to manage educational examinations. Built with React 19, Vite, and Tailwind CSS, this application offers:
| Feature | Description | |βββ|ββββ-| | π Take Exams | Interactive exam interface with timer | | β±οΈ Real-time Timer | Countdown with auto-submit on expiry | | π© Question Flagging | Mark questions for review | | π View Results | Detailed exam results with correct answers | | π Browse Courses | Explore available courses | | πΎ State Persistence | Resume exams after page refresh |
| Feature | Description | |βββ|ββββ-| | π Manage Courses | Create and edit courses | | π¨βπ Manage Students | View and assign students to tracks | | π Create Exams | Generate exams for courses | | π View Analytics | Monitor student performance |
| Feature | Description | |βββ|ββββ-| | π Authentication | Secure login/register with role detection | | π‘οΈ Protected Routes | Role-based access control | | π Toast Notifications | Real-time feedback on actions | | π¨ Responsive Design | Mobile-first approach | | β‘ Fast Performance | Optimized with Vite |
| Technology | Version | Purpose |
|---|---|---|
| React | 19.2.0 | UI Library |
| Vite | 7.2.5 | Build Tool & Dev Server |
| React Router | 7.12.0 | Client-side Routing |
| Tailwind CSS | 4.1.18 | Utility-first CSS Framework |
| Axios | 1.13.2 | HTTP Client |
| React Hot Toast | 2.6.0 | Toast Notifications |
| ESLint | 9.39.1 | Code Linting |
Front_sql_projrct/
β
βββ π index.html # HTML entry point
βββ π package.json # Dependencies & scripts
βββ π vite.config.js # Vite configuration
βββ π eslint.config.js # ESLint configuration
β
βββ π public/ # Static assets
β
βββ π src/
β
βββ π main.jsx # Application entry point
βββ π App.jsx # Root component & routing
βββ π App.css # Global styles & animations
β
βββ π api/
β βββ axios.js # Axios instance & interceptors
β
βββ π§© components/
β βββ auth/
β β βββ ProtectedRoute.jsx # Route protection HOC
β β
β βββ common/
β β βββ Badge.jsx # Badge & StatusBadge
β β βββ Button.jsx # Button with variants
β β βββ Card.jsx # Card component
β β βββ EmptyState.jsx # Empty state display
β β βββ Input.jsx # Input with validation
β β βββ Loader.jsx # Loader & Skeleton
β β βββ Modal.jsx # Modal & ConfirmModal
β β βββ index.js # Barrel export
β β
β βββ layout/
β βββ Footer.jsx # Footer component
β βββ MainLayout.jsx # Layout wrapper with Outlet
β βββ Navbar.jsx # Role-based navigation
β βββ index.js # Barrel export
β
βββ π context/
β βββ AuthContext.jsx # Authentication state
β βββ ExamContext.jsx # Exam state & timer
β βββ StudentContext.jsx # Student data state
β
βββ π data/
β βββ courseData.js # Static course data
β
βββ π Module/
β βββ Exam.jsx # Legacy exam component
β βββ home.jsx # Legacy home component
β
βββ π± pages/
β βββ LandingPage.jsx # Public landing page
β βββ NotFoundPage.jsx # 404 page
β βββ index.js # Barrel export
β β
β βββ auth/
β β βββ LoginPage.jsx # Login with tabs
β β βββ RegisterPage.jsx # Registration form
β β βββ index.js
β β
β βββ exams/
β β βββ ExamListPage.jsx # Exam history
β β βββ TakeExamPage.jsx # Exam interface
β β βββ ExamResultPage.jsx # Result display
β β βββ index.js
β β
β βββ instructor/
β β βββ InstructorDashboard.jsx # Instructor home
β β βββ InstructorCoursesPage.jsx # Course management
β β βββ InstructorStudentsPage.jsx # Student management
β β βββ InstructorExamsPage.jsx # Exam management
β β βββ index.js
β β
β βββ student/
β βββ StudentDashboard.jsx # Student home
β βββ CoursesPage.jsx # Course listing
β βββ CourseDetailPage.jsx # Course details
β βββ index.js
β
βββ π services/
β βββ authService.js # Auth API calls
β βββ courseService.js # Course API calls
β βββ examService.js # Exam API calls
β βββ studentService.js # Student API calls
β
βββ π§ utils/
βββ constants.js # API endpoints & constants
βββ helpers.js # Utility functions
http://localhost:3000git clone https://github.com/your-username/examination-system.git
cd Front_sql_projrct
npm install
Configure environment (optional)
Create a .env file for API configuration:
VITE_API_BASE_URL=http://localhost:3000/api/v1
npm run dev
http://localhost:5173
| Variable | Description | Default |
|---|---|---|
VITE_API_BASE_URL |
Backend API base URL | http://localhost:3000/api/v1 |
| Script | Command | Description |
|---|---|---|
| Dev | npm run dev |
Start development server with HMR |
| Build | npm run build |
Build for production |
| Preview | npm run preview |
Preview production build |
| Lint | npm run lint |
Run ESLint |
| Route | Component | Description |
|---|---|---|
/ |
LandingPage |
Public landing page |
/login |
LoginPage |
User login (Student/Instructor tabs) |
/register |
RegisterPage |
User registration |
| Route | Component | Description |
|---|---|---|
/student/dashboard |
StudentDashboard |
Student home page |
/student/courses |
CoursesPage |
Browse courses |
/student/courses/:id |
CourseDetailPage |
Course details |
/student/exams |
ExamListPage |
Exam history |
/student/exams/take/:courseId |
TakeExamPage |
Take new exam |
/student/exams/:examId/retake |
TakeExamPage |
Resume pending exam |
/student/exams/:examId/result |
ExamResultPage |
View exam results |
| Route | Component | Description |
|---|---|---|
/instructor/dashboard |
InstructorDashboard |
Instructor home |
/instructor/courses |
InstructorCoursesPage |
Manage courses |
/instructor/students |
InstructorStudentsPage |
Manage students |
/instructor/exams |
InstructorExamsPage |
Manage exams |
| Component | Props | Description |
|---|---|---|
Button |
variant, size, fullWidth, disabled |
Customizable button |
Input |
label, error, icon, type |
Form input with validation |
Card |
title, headerAction, padding, hoverable |
Content card |
Modal |
isOpen, onClose, title, size |
Modal dialog |
Badge |
variant, size |
Status badge |
Loader |
size |
Loading spinner |
EmptyState |
title, description, action |
Empty content state |
| Component | Description |
|---|---|
MainLayout |
Layout wrapper with Navbar and Footer |
Navbar |
Role-based navigation menu |
Footer |
Application footer |
ProtectedRoute |
HOC for route protection |
// Available values and methods
const {
user, // Current user object
isAuthenticated, // Auth status
isLoading, // Loading state
login, // Login function
logout, // Logout function
register // Register function
} = useAuth();
// Available values and methods
const {
currentExam, // Current exam data
questions, // Exam questions
answers, // Student answers
timeRemaining, // Timer in seconds
flaggedQuestions, // Flagged question IDs
isSubmitting, // Submission state
generateExam, // Start new exam
resumeExamFromServer, // Resume pending exam
selectAnswer, // Select answer for question
toggleFlag, // Flag/unflag question
submitExam, // Submit exam
resetExam // Clear exam state
} = useExam();
| Service | Methods |
|---|---|
| authService | loginStudent(), registerStudent(), loginInstructor() |
| courseService | getAllCourses(), getCourseById(), createCourse() |
| examService | generateExam(), submitExamAnswers(), getExamReview(), getStudentExams(), checkExamStatus() |
| studentService | getAllStudents(), getStudentById(), assignTrack() |
The axios instance (src/api/axios.js) includes:
This project uses Tailwind CSS 4.x with Vite integration:
// vite.config.js
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [react(), tailwindcss()]
})
Custom animations are defined in App.css:
| Color | Usage | Tailwind Class |
|---|---|---|
| Blue | Primary actions | bg-blue-600 |
| Green | Success states | bg-green-500 |
| Red | Error/Danger | bg-red-500 |
| Amber | Warning states | bg-amber-500 |
| Gray | Neutral/Text | bg-gray-100 |
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Landing βββββ>β Login/ βββββ>β Dashboard β
β Page β β Register β β (by role) β
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β
β Auth Token
βΌ
βββββββββββββββ
β localStorageβ
βββββββββββββββ
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Generate βββββ>β Take Exam βββββ>β Submit β
β Exam β β (15 min) β β Answers β
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β β
Timer Expires β
β βΌ
βββββββββββ>βββββββββββββββ
β Results β
β Page β
βββββββββββββββ
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)This project is licensed under the ISC License.
CrossITI Team