The backend of QuizHacker project, built on Spring Boot, powers the quiz creation, management, and user interactions providing RESTful API endpoints.
The client-end side (mobile app) of this project is available here
The production version is under production branch
The deployed back-end side of the application can be found here. The response speed is quite low, as the free instance is used.
- Clone the project
git clone https://github.com/alexonthespot7/QuizHacker_back-end.git
- Run the following command in a terminal window in the complete directory:
./mvnw spring-boot:run
- Navigate to localhost:8080
-
Restful Endpoints: Provides RESTful API endpoints for seamless communication with the front-end application.
-
Authentication with JWT: Implements JSON Web Token (JWT) for secure authentication between the server-side and client-side applications.
-
Leaderboard Display:
- Get the top 10 rankings.
- Authenticated users who have taken at least one quiz are on the leaderboard with their position.
-
Personal Page:
- Get user information: email, username, score, position in the leaderboard, attempts quantity, and average score among attempts.
-
Personal Quizzes:
- Get list of created quizzes.
- Update existing quizzes.
- Details include title, description, question count, rating by other users, time limit, category, and difficulty.
-
Creating/Editing Quizzes:
- Create quizzes with title, description, time limit, category, and difficulty.
- Update questions and answers; each question has four answers, with one correct.
-
List of Unattempted Quizzes:
- Get quizzes created by other users that the current user hasn't taken.
-
Quiz Taking Process:
- Post quiz-taking attempt with list of questions and answers for them and the user's rating for the quiz.
- Get score of attempt (questions answered * quiz difficulty: easy - 1, medium - 2, hard - 3).
- Java Spring Boot
- RESTful APIs
- JWT (JSON Web Token)
- smtp
- spring-boot-starter-web: Starter for building web applications using Spring MVC.
- spring-boot-devtools: Provides development-time tools to enhance developer productivity. Automatically triggers application restarts, among other features.
- spring-boot-starter-data-jpa: Starter for using Spring Data JPA for database access.
- h2: H2 Database Engine, an in-memory relational database for development and testing purposes.
- spring-boot-starter-security: Starter for enabling Spring Security and authentication/authorization features.
- spring-boot-starter-mail: Starter for sending emails using Spring's JavaMailSender.
- jjwt-api: JSON Web Token (JWT) API provided by JJWT library.
- jjwt-impl: Implementation of the JSON Web Token (JWT) provided by JJWT library (runtime dependency).
- jjwt-jackson: Jackson integration for JSON Web Token (JWT) provided by JJWT library (runtime dependency).
- spring-boot-starter-test: Starter for testing Spring Boot applications.
- spring-security-test: Spring Security testing support for integration testing.
- junit-jupiter-api: JUnit 5 API for writing tests.
- junit-jupiter-engine: JUnit 5 test engine implementation.
- spring-boot-starter-validation: Starter for using validation in Spring Boot applications.
The documentation for this project is made with Swagger and can be accessed after launching the project at the following endpoints:
- http://localhost:8080/swagger-ui.html: if you're running the app on your pc.
- https://quiz-hacker-back-end.onrender.com/swagger-ui.html: deployed app.
- Clone the project
git clone https://github.com/alexonthespot7/QuizHacker_back-end.git
- Run the following command in a terminal window (in the complete) directory:
./mvnw test
- Controllers testing.
- Repositories testing: CRUD functionalities + custom queries.
- Rest endpoints methods testing.
This project is under the MIT License.