Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akkiepro/microservice-quiz-app
Quiz App using different microservices such as question-service, quiz-service, service-registry and an api-gateway-service.
https://github.com/akkiepro/microservice-quiz-app
api-gateway curl eureka eureka-client eureka-server java microservice microservices-architecture postgresql postman question-service quiz-service rest rest-api restful-api service-registry spring spring-boot sql
Last synced: about 21 hours ago
JSON representation
Quiz App using different microservices such as question-service, quiz-service, service-registry and an api-gateway-service.
- Host: GitHub
- URL: https://github.com/akkiepro/microservice-quiz-app
- Owner: akkiePro
- Created: 2024-02-07T13:35:09.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-02-09T17:59:36.000Z (9 months ago)
- Last Synced: 2024-02-09T19:27:36.424Z (9 months ago)
- Topics: api-gateway, curl, eureka, eureka-client, eureka-server, java, microservice, microservices-architecture, postgresql, postman, question-service, quiz-service, rest, rest-api, restful-api, service-registry, spring, spring-boot, sql
- Language: Java
- Homepage: https://github.com/akkiePro/Monolithic-Quiz-App
- Size: 274 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Microservice-Quiz-App
Quiz App using different microservices such as question-service, quiz-service, service-registry and an api-gateway-service.# Postman cURLs
1. generateQuiz
curl --location 'localhost:8765/quiz-service/quiz/generate' \
--header 'Content-Type: application/json' \
--data '{
"category":"Java",
"limit":10,
"title":"Java Guy"
}'
2. generateQuizQuestions
curl --location 'localhost:8765/quiz-service/quiz/getQuiz/1'
3. getResult
curl --location --request GET 'localhost:8765/quiz-service/quiz/getScore' \
--header 'Content-Type: application/json' \
--data '[
{
"rid":2,
"response": "A programming language"
},
{
"rid":4,
"response": "A value that has a name and a type"
},
{
"rid":7,
"response": "A blueprint for creating objects"
},
{
"rid":11,
"response": "The ability of an object to take on many forms"
},
{
"rid":20,
"response": "A structure that repeats a block of code"
}
]'
4. getAllQuestions
curl --location 'localhost:8765/question-service/question/getAllQuestions'
5. getAllQuestionsByCategory
curl --location 'localhost:8765/question-service/question/category/Java'
6. addQuestion
curl --location 'localhost:8765/question-service/question/addQuestion' \
--header 'Content-Type: application/json' \
--data '{
"questionTitle":"What is the default scope of the Spring Bean?",
"option1":"singleton",
"option2":"prototype",
"option3":"request",
"option4":"session",
"correctAnswer":"singleton",
"category":"Java",
"difficultyLevel":"Medium"
}'
7. updateQuestion
curl --location --request PUT 'localhost:8765/question-service/question/update/1' \
--header 'Content-Type: application/json' \
--data '{
"questionTitle": "What is size of int in java? (in Bytes)",
"option1": 1,
"option2": 2,
"option3": 4,
"option4": 8,
"correctAnswer": 4,
"category": "Java",
"difficultyLevel": "Easy"
}'
8. deleteQuestion
curl --location --request DELETE 'localhost:8765/question-service/question/delete/22' \
--data ''
9. generateQuestionsForQuiz
curl --location --request GET 'localhost:8765/question-service/question/generate?category=Python&limit=10' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'category=Java' \
--data-urlencode 'limit=5'
10. generateQuestionsByIds
curl --location 'localhost:8765/question-service/question/getQuestions' \
--header 'Content-Type: application/json' \
--data '[10,16,3,18,19,21,6,12,8,14]'
11. score
curl --location 'localhost:8765/question-service/question/getScore' \
--header 'Content-Type: application/json' \
--data '[
{
"rid":2,
"response": "A programming language"
},
{
"rid":4,
"response": "A value that has a name and a type"
},
{
"rid":7,
"response": "A blueprint for creating objects"
},
{
"rid":11,
"response": "The ability of an object to take on many forms"
},
{
"rid":20,
"response": "A structure that repeats a block of code"
}
]'# Eureka-Server setup
![image](https://github.com/akkiePro/Microservice-Quiz-App/assets/72514060/21807a0a-5185-4dc7-98a1-3e9047e6efab)# Monolithic-Quiz-App
Monolithic-Quiz-App
learnt from: https://www.youtube.com/watch?v=Jl9OKQ92SJU&ab_channel=Telusko