This Spring Boot application provides a comprehensive set of APIs for managing quizzes. Users can create quizzes, take quizzes, and evaluate their performance. Additionally, the application offers functionality to add new questions and categories. It also integrates AI capabilities, allowing users to generate entire quizzes by simply providing a prompt, making quiz creation more efficient and intelligent. This solution is designed to handle dynamic user inputs and offers a seamless experience for both quiz makers and participants.
The architecture of this application is designed for scalability, security, and efficient processing. Nginx is employed to terminate TLS/HTTPS, ensuring secure communication between clients and the server. The core of the application is built on a Spring Boot app server, handling business logic and API requests, while PostgreSQL is used for reliable data storage. Additionally, the system integrates with GROQ AI to enhance AI-driven capabilities, making it a powerful solution for dynamic and interactive experiences.
Before running the Quiz App, ensure that the following are installed:
- Java-17
- Docker
- Maven
- IntelliJ
#TODO : write about .env file
Following command to run postgres and import required data into it
docker-compose up db -d
Run the below command to build maven project
mvn clean install -DskipTests
To run the application locally with the dev
profile, follow these steps:
- Ensure the following program argument is passed:
--spring.profiles.active=dev
- Add the environment variable
GROQ_API_KEY
to integrate with AI services.- You can generate the API key by visiting GROQ API Key Console.
- To start the application:
- Open
QuizappApplication.java
. - Right-click on the file and select Run.
- Open
Once the QuizApp backend server is up and running, you can access the Swagger API documentation at the following URL:
http://localhost:8080/swagger-ui/index.html
make sure dev profile is configured while running on local, below program argument is passed --spring.profiles.active=dev make sure to add "GROQ_API_KEY" with value to integrate with AI groq url to create API key - https://console.groq.com/keys To run the application, open QuizappApplication, right-click, and select "Run."
Once quizapp backend server is up and running, API documentation will be accessible using below url
http://localhost:8080/swagger-ui/index.html
Verify the setup by executing the following command:
% curl localhost:8080/questions/all
You should receive a proper response with questions (sample response)
[
{
"id": 1,
"questionTitle": "What is a class in Java?",
"option1": "A function",
"option2": "An object",
"option3": "A data structure",
"option4": "A loop",
"rightAnswer": null
}
]