This repository contains the source code for a Test Environment Platform developed as part of a Full-Stack Developer assignment. The platform enables students to take multiple-choice questions (MCQ) tests, with a focus on user authentication, test administration, and automated score evaluation.
- Frontend: React.js, CSS Modules, Tailwind CSS
- Backend: Node.js, Express.js
- Database: MongoDB
- Authentication: JWT Authentication
- Email Service: Nodemailer
- Cron Jobs: node-cron
- Secure login system using email and password.
- Authentication is required to access the test environment.
- Permissions: Requests access to the camera and microphone.
- Live Preview: Displays a live preview of the camera feed once permissions are granted.
- Error Handling: Displays an error message if permissions are not granted.
- Users can view each question and its options.
- Users can select and change their answers.
- Navigation between questions is allowed.
- A camera window is displayed in the test interface.
- Users can submit their test and are redirected to a "Finish Test" page.
- A cron job runs every hour to evaluate submitted tests and calculate scores.
- Scores are automatically sent to the user’s email using a predefined template.
To set up the project locally, follow these steps:
- Node.js (v14.x or later)
- MongoDB (local or cloud)
- Nodemailer Account (for sending emails)
-
Clone the repository
git clone https://github.com/ShishirShekhar/CipherSchools.git cd CipherSchools
-
Install dependencies for the server
cd server npm install
-
Install dependencies for the client
cd ../client npm install
-
Set up environment variables
Rename the
.env.example
file in bothserver
andclient
directories to.env
and update the values accordingly.mv .env.example .env
-
Start the server
cd server npm run start
-
Start the client
Open a new terminal window and run:
cd client npm run dev
The client application will be available at
http://localhost:3000
, and the server will run on the configured port.
This project is configured for deployment on Vercel. To deploy:
- Push your code to GitHub.
- Connect your GitHub repository to Vercel.
- Set the necessary environment variables in Vercel.
- Deploy the project using Vercel's CLI or web interface.
A sample test has been created with 10 MCQ questions to demonstrate the platform’s functionality.
- Email:
testuser@example.com
- Password:
TestPassword123
- The cron job runs every hour to evaluate the submitted tests and calculate scores.
- After evaluation, the user's score is sent via email using the template provided below.
Subject: Your Test Results
Dear {{user.name}},
Congratulations on completing the test! Here are your results:
Score: {{score}}/10
Thank you for participating!
Best regards,
Test Environment Platform Team
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Shishir Shekhar - LinkedIn - Twitter - Email
Project Link: https://github.com/ShishirShekhar/CipherSchools