This project is a comprehensive full-stack interactive quiz application designed to enhance your development skills using React for the front-end, Spring Boot for the back-end, and MySQL for the database. The application allows users to take quizzes, view scores, and review answers. It also includes an admin panel for adding and managing quiz questions.
- User registration and authentication
- Quiz creation and management by admin
- Taking quizzes and viewing scores
- Reviewing correct and incorrect answers
- Secure handling of user data and authentication
- Frontend: React
- Backend: Spring Boot
- Database: MySQL
- Others: Spring Security, JWT
- Node.js and npm
- Java JDK (version 11 or higher)
- MySQL Server
-
Clone the repository:
git clone https://github.com/Soumyaatanna/Quiz.git cd Quiz -
Navigate to the frontend directory and install dependencies:
cd frontend npm install -
Start the React development server:
npm start
-
Navigate to the backend directory and open it in your IDE (e.g., IntelliJ IDEA):
cd backend -
Configure the
application.propertiesfile with your MySQL database details:spring.datasource.url=jdbc:mysql://localhost:3306/quizdb spring.datasource.username=root spring.datasource.password=your_password spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
-
Build and run the Spring Boot application:
mvn clean install mvn spring-boot:run
- Create the
quizdbdatabase in MySQL:The database schema will be automatically created by the Spring Boot application based on JPA entities.CREATE DATABASE quizdb;
POST /api/auth/signup- Register a new userPOST /api/auth/signin- Authenticate a user
POST /api/quizzes- Create a new quiz (admin only)GET /api/quizzes- Retrieve all quizzesGET /api/quizzes/{id}- Retrieve a specific quiz by IDPUT /api/quizzes/{id}- Update a quiz (admin only)DELETE /api/quizzes/{id}- Delete a quiz (admin only)
POST /api/quizzes/{id}/take- Submit quiz answers and calculate scoreGET /api/quizzes/{id}/results- Retrieve quiz results for a user
- User authentication and authorization are implemented using Spring Security.
- Passwords are securely hashed and stored in the database.
- Thoroughly tested both frontend and backend functionalities.
- Used browser developer tools and backend logs for debugging.
- Feel free to open issues or submit pull requests for improvements and new features.
This project is licensed under the MIT License.
For any questions or support, please contact Soumya Tanna.