Skip to content

Commit

Permalink
Merge pull request #302 from Arquisoft/develop
Browse files Browse the repository at this point in the history
fixed query
  • Loading branch information
Toto-hitori committed Apr 27, 2024
2 parents 52351e9 + 3b5bdd7 commit 6c0060b
Show file tree
Hide file tree
Showing 22 changed files with 454 additions and 247 deletions.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
# 🧠🤔 KiWiq 🥝❓📚
Visit our page [here!!!](http://kiwiq.run.place/).

WIQ is a quiz game project inspired by the engaging and thought-provoking show "Saber y Ganar."
KiWiq is a quiz game project inspired by the engaging and thought-provoking show "Saber y Ganar."
We aim to create a platform that not only challenges your knowledge but also sparks curiosity and the thrill of discovery.


## What Sets WIQ Apart
🤔 Thoughtful Questions: Dive into a world of intriguing and diverse questions, all generated procedurally using WikiData.
🌐 Encourage to improve: WIQ lets you keep track of your score to see in which areas you need to improve.
🤔 Thoughtful Questions: Dive into a world of intriguing and diverse questions, all generated procedurally using WikiData.

😭 It works! after the final version final re-final (FINAL) true (final) (hotfix)
🌐 Encourage to improve: KiWiq lets you keep track of your score to motivate you into learning more.

## Features
🏆 Adaptable difficulty: You can adjust the difficulty to push your limits.
🔣 Question diversity: KiWiq offers you a variety of questions so you can test your knowledge in a variety of fields.

🌐 Multiplayer: Compete with friends and strangers to prove you are the best.
## Features
🏆 Adaptable difficulty: You can adjust the difficulty to push your limits.

🌐 Localized: Available in Spanish and English.
🌍 Localized: Available in Spanish and English.

## Contributors
Contributor | Contact
Expand All @@ -43,7 +42,7 @@ This repo is a basic application composed of several components.
Component | Route | Description
-- | -- | --
Backend/API | `api/` | The main backend service, implemented in Java SpringBoot. It serves all requests from the frontend, and it doubles as main API. It also has a JWT-based authentication system.
Question generator | `questiongenerator/` | A SpringBoot-based service, ran alongside the main backend service, that generates questions and inserts them into the database
Question generator | `questiongenerator/` | A Java program that generates questions and inserts them into the database, from where they are fetched by the API.
Webapp | `webapp/` | Our own frontend to the backend. It is implemented in React 18.

***
Expand Down
23 changes: 0 additions & 23 deletions docs/diagrams/BusinessContextDiagram.puml

This file was deleted.

27 changes: 0 additions & 27 deletions docs/diagrams/TechnicalContextDiagram.puml

This file was deleted.

20 changes: 20 additions & 0 deletions docs/diagrams/c4/C4-Level1.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@startuml
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
!include <c4/C4_Context.puml>

title Context Diagram for the Kiwiq System (C4 Level 1)
AddElementTag("Person", $bgColor="#darkgreen", $fontColor="#white")
AddElementTag("Internal system", $bgColor="#darkseagreen", $fontColor="#003300")
AddElementTag("External system", $bgColor="#gray", $fontColor="#white")
'Containers
Person(player, Player,"An authenticated player that wants to play Kiwiq games", $tags="Person")

Container(kiwiq, "Kiwiq System","", "System that allows the users to play Kiwiq games", $tags="Internal system")


System_Ext(wikidata,"WikiData API","Contains the information used for the question generation", $tags="External system")

'RELATIONS
Rel(player,kiwiq,"Plays games")
Rel(kiwiq,wikidata,"Asks for data for question generation")
@enduml
31 changes: 31 additions & 0 deletions docs/diagrams/c4/C4-Level2.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@startuml
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
!include <c4/C4_Context.puml>

title Container Diagram for the Kiwiq System (C4 Level 2)
AddElementTag("Person", $bgColor="#darkgreen", $fontColor="#white")
AddElementTag("Internal system", $bgColor="#darkseagreen", $fontColor="#003300")
AddElementTag("External system", $bgColor="#gray", $fontColor="#white")
AddElementTag("Database", $bgColor="#darkgreen", $fontColor="#white")
'Containers
Person(player, Player's Browser,"Preferred browser (Firefox, Chrome, Opera...)")

System_Boundary(wiq,"Kiwiq Server"){
Container(proxy,"Proxy","Nginx","Nginx web server", $tags="Internal system")
Container(web_app, "Kiwiq Client", "React, Typescript", "nginx web server", $tags="Internal system")
Container(backend_api, "Kiwiq REST API","Java SpringBoot 3",".jar file", $tags="Internal system")
Container(question_generator,"Question generator","Java, JPA",".jar file",$tags="Internal system")
ContainerDb(database,"Kiwiq Database","PostgreSQL","PostgreSQL docker container", $tags="Database")
}
System_Ext(wikidata,"WikiData API","REST API", $tags="External system")

'RELATIONS
Rel(player,proxy,"Uses","HTTPS")
Rel(proxy,web_app,"Serves","HTTPS")
Rel(question_generator,wikidata,"Asks for data","SPARQL,HTTPS")
Rel(web_app,backend_api,"Asks for user/game information","JSON,HTTPS")
Rel(question_generator, database,"Stores questions ","JPA")
Rel(backend_api,database,"Stores game/user information","JPA")


@enduml
48 changes: 48 additions & 0 deletions docs/diagrams/c4/C4-Level3.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
@startuml
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
!include <c4/C4_Container.puml>
!include <c4/C4_Component.puml>
title Container Diagram for the Kiwiq System (C4 Level 3)
AddElementTag("Person", $bgColor="#darkgreen", $fontColor="#white")
AddElementTag("Internal system", $bgColor="#darkseagreen", $fontColor="#003300")
AddElementTag("External system", $bgColor="#gray", $fontColor="#white")
AddElementTag("Database", $bgColor="#darkgreen", $fontColor="#white")
AddElementTag("Component", $bgColor="#darkolivegreen", $fontColor="#white")
'Containers
Person(player, Player's Browser,"Preferred browser (Firefox, Chrome, Opera...)")

System_Boundary(wiq,"Kiwiq Server"){
Container(proxy,"Proxy","Nginx","Nginx web server", $tags="Internal system")
Container(web_app, "Kiwiq Client", "React, Typescript", "nginx web server", $tags="Internal system")
System_Boundary(backend_api,"Kiwiq REST API"){
Component(auth,"Authentication module")
Component(games,"Game module")
Component(questions,"Question module")
Component(statistics,"Statistics module")
}

Container(question_generator,"Question generator","Java, JPA",".jar file",$tags="Internal system")
ContainerDb(database,"Kiwiq Database","PostgreSQL","PostgreSQL docker container", $tags="Database")
}

System_Ext(wikidata,"WikiData API","REST API", $tags="External system")

'RELATIONS
Rel(player,proxy,"Uses","HTTPS")
Rel(proxy,web_app,"Serves","HTTPS")
Rel(question_generator,wikidata,"Asks for data","SPARQL,HTTPS")
Rel(question_generator, database,"Stores questions ","JPA")

Rel(web_app,questions,"Asks for question information","JSON,HTTPS")
Rel(web_app,games,"Plays a game","JSON,HTTPS")
Rel(web_app,auth,"Ask for login and register","JSON,HTTPS")
Rel(web_app,statistics,"Asks for statistics","JSON,HTTPS")


Rel(games,database,"Stores game/user information","JPA")

Rel(games,questions,"Gets questions")
Rel(questions,database,"Stores game/user information","JPA")
Rel(statistics,database,"Stores game/user information","JPA")
Rel(auth,database,"Stores game/user information","JPA")
@enduml
36 changes: 0 additions & 36 deletions docs/diagrams/deployment/DeploymentDiagram.puml

This file was deleted.

43 changes: 43 additions & 0 deletions docs/diagrams/deployment/DeploymentDiagramLevel1.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@startuml

title WIQ Deployment View

legend right
|Color| Type |
|<#darkseagreen>| Container |
|<#darkolivegreen>| WIQ Server |
|<#OliveDrab>| External Service |
end legend

node "Server Hosting WIQ" #darkolivegreen {
node "KIWIQ Proxy" #darkseagreen
node "KIWIQ WebApp Server" #darkseagreen {
component "KIWIQ React Application"
}
node "KIWIQ API" #darkseagreen{
component "KIWIQ_API.jar"
}
node "PostgreSQL Docker" #darkseagreen{
database "KIWIQ Database"
}
node "Question generator" #darkseagreen{
component "Question_Generator.jar"
}
node "Grafana" #darkseagreen
node "Prometheus" #darkseagreen
}
node "User Computer" #OliveDrab {
frame "Web Client"
}
node "WikiData Server" #OliveDrab {
frame "WikiData REST API"
}
"Web Client" ..> "KIWIQ Proxy" : "HTTPS"
"KIWIQ Proxy" ..> "KIWIQ React Application"
"KIWIQ React Application" ..> "KIWIQ_API.jar" : "HTTPS"
"KIWIQ_API.jar" ..> "KIWIQ Database" : "JPA"
"Question_Generator.jar" ..> "WikiData REST API" : "HTTPS, SPARQL"
"Question_Generator.jar" ..> "KIWIQ Database" : "JPA"
"Prometheus" ..> "KIWIQ_API.jar" : "Actuator"
"Grafana" ..> "Prometheus"
@enduml
25 changes: 25 additions & 0 deletions docs/diagrams/deployment/DeploymentDiagramLevel2.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@startuml

title KIWIQ API Deployment View

legend right
|Color| Type |
|<#darkseagreen>| WIQ artifact |
|<#OliveDrab>| Package |
end legend

node "KIWIQ_API.jar" #darkseagreen {
component "auth" #OliveDrab
component "commons"#OliveDrab
component "game" #OliveDrab
component "questions" #OliveDrab
component "statistics" #OliveDrab

}
"auth" ..> "commons"
"game" ..> "commons"
"questions" ..> "commons"
"statistics" ..> "commons"
"game" ..> "questions"
"game" ..> "statistics"
@enduml
22 changes: 11 additions & 11 deletions docs/diagrams/sequence/SequenceDiagramGame.puml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
@startuml Game's life cycle
title Game Sequence Diagram
actor Client #darksalmon
participant API #darksalmon
database DB #salmon
actor Client #darkolivegreen
participant API #darkolivegreen
database DB #darkolivegreen

skinparam Style strictuml
skinparam SequenceMessageAlignment center

Client -> API : start game
activate API #darksalmon
activate API #darkolivegreen
API -> DB : store game info
activate DB #salmon
activate DB #darkolivegreen
DB --> API : game info stored
deactivate DB
API --> Client : return game info
deactivate API
loop #PeachPuff Round
loop #darkseagreen Round
Client -> API : start round
activate API #darksalmon
activate API #darkolivegreen
API -> DB : ask for question
activate DB #salmon
activate DB #darkolivegreen
DB --> API : return question
deactivate DB
API --> Client : return question with all answers
deactivate API
Client -> API : send chosen answer
activate API #darksalmon
activate API #darkolivegreen
API -> API : check answer is correct
API -> DB : update game info
activate DB #salmon
activate DB #darkolivegreen
DB --> API : game info updated
deactivate DB
API --> Client : inform user if guessed right
Expand All @@ -37,7 +37,7 @@ loop #PeachPuff Round
end loop One question

API -> DB : [if last round] update ranking
activate DB #salmon
activate DB #darkolivegreen
DB --> API : ranking updated
deactivate DB
API --> Client : inform user if guessed right
Expand Down
Loading

0 comments on commit 6c0060b

Please sign in to comment.