Tech-Quiz-Test is a MERN stack-based application designed to provide a technical quiz experience. The application allows users to take a quiz of random technical questions, track their score, and restart quizzes. This project emphasizes the integration of Cypress testing to ensure the application is reliable and functional.
- Randomized Tech Quiz: Questions are dynamically fetched.
- Score Tracking: Tracks the user’s progress and final score.
- Quiz Restart: Allows users to retake the quiz.
- Comprehensive Testing: Includes Cypress tests for components and end-to-end flows.
- Frontend: React, Vite
- Backend: Node.js, Express.js, MongoDB
- Testing: Cypress
Follow these steps to set up and run the Tech-Quiz-Test project locally:
Start by cloning the repository to your local machine:
git clone https://github.com/your-username/tech-quiz-test.git
Navigate to the project folder:
cd tech-quiz-test
Install all necessary dependencies for the root, client, and server:
npm install
npm run install
This will install dependencies in the client
and server
directories automatically.
Populate the database with quiz questions. Run the following command:
npm run seed
This will:
- Connect to the database.
- Clear any existing data.
- Insert new question data from
pythonQuestions.json
.
Run the application in development mode:
npm run start:dev
This will:
- Start the server on http://localhost:3001.
- Launch the client at the same URL.
After starting the development server, open your browser and go to:
http://127.0.0.1:3001
- Open your browser and navigate to http://127.0.0.1:3001.
- Click "Start Quiz" to begin.
- Answer the displayed questions and track your score at the end.
- Click "Take New Quiz" to restart the quiz.
Cypress is used for both component testing and end-to-end testing.
-
Open Cypress in component testing mode:
npx cypress open --component
-
Select and run the
Quiz.cy.tsx
file.
-
Open Cypress in end-to-end testing mode:
npx cypress open
-
Select and run the
quiz.cy.js
file.
cypresstest.mp4
This project is licensed under Apache2.0. For license details, visit (https://www.apache.org/licenses/LICENSE-2.0).