summaryrefslogtreecommitdiff
path: root/README.md
blob: b94597e938328376ce93ec8f55f5dd3177321249 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# Olympia 2024 Events
> View updated Events with its Competitors and Rankings of all Disciplines 

*Olympia 2024 Events* always displays up to date information of the 2024
Olympics in Paris. It achieves this by fetching the `olympics.com` API. 

We use the Model-View-Delegate pattern to synchronize the API data in C++ with
the UI-Widgets defined in QML. For this we implement the API data as a Model
which can be seen and interacted with by QML Components.

All code, qml definitions and images, etc are compiled into a single binary that
is not dependent on any resources on relative paths anymore. 

On startup the default discipline *Archery* will be fetched and shown on the
EventsPage. From here the user has three options. You can change the discipline
from the Dropdown-Menu (Combobox) in the top left (also note the changing
pictograms of the discipline); Filter the EventNames with the Search field in
the top right; or click on an Event. 

When clicking on an Event, the user is redirected to the EventInfoPage. Here you
can see Information about all Competitors that took part in the Event. When you
are done, you can go back to the EventsPage with the button in the top left. 

## Galery

<table>
<tr>
<td><img src="doc/events_page_combobox.png"/></td>
<td><img src="doc/events_page_textfield.png"/></td>
<td><img src="doc/event_info.png"/></td>
</tr>
<tr>
<td>Select discipline</td>
<td>Filter by Event</td>
<td>View Competitor</td>
</tr>
</table>

## Getting Started

### Dependencies

- Qt6

### Installation

```sh
git clone git@gitlab.kit.edu:ugmgt/itat_challenge_2024.git
# or download release
cd itat_challenge_2024
cmake -B build
cmake --build build
./build/itat_challenge_olympics
```

## Code Structure

### UML Diagram

```plantuml
@startuml
allowmixing
set namespaceSeparator none
skinparam ranksep 10 

package C++ <<Frame>> {
    class Application {
        QGuiApplication app
            QmlComponent component
            SportModel model
            FilterModel<SportModel> filter
    }

    class SportModel {
        String discipline
            <EventInfo> model
            request(String discipline)
            parseData()
    }

    class FilterModel {
        void setFilterFixedString(String)
    }

    class EventInfo {
        String eventName
            List<Competitor> competitors
    }

    class Competitor {
        String name
            String code
            String noc
    }
}

package QML <<Frame>> {

    component EventInfoPage {
        component [Page] as EIPage {
            component [ToolBar] as EIToolBar
            component [ListView] as EILisView
        }
    }

    EIToolBar -[hidden]- EILisView

    component EventsPage {
        component [Page] as EPage {
            component [ToolBar] as EToolBar
            component [Column] as EColumn {
                component [Row] as ERow {
                    component [ComboBox] as EComboBox
                    component [TextField] as ETextField
                }
                component [ListView] as EListView
            }
        }
    }

    EToolBar -[hidden]- EColumn
    ERow -[hidden]- EListView

    component application.qml {
        component ApplicationWindow {
            component StackView
        }
    }
}

'application.qml -u- a
'Application -r- a

Application *-- "1" SportModel
Application *-- "1" FilterModel

FilterModel "1" o-- "1" SportModel

SportModel *-- "0..*" EventInfo
EventInfo *-- "0..*" Competitor

Application <.l. application.qml
StackView <.. EventInfoPage
StackView <.. EventsPage

EComboBox "request()" .> SportModel

EComboBox -[hidden]u- ETextField

SportModel "View" .> EListView 
FilterModel "View" .> EListView 
ETextField "Control" .r.> FilterModel

EILisView <. "View" Competitor

cloud api.olympics.com
() REST
REST - api.olympics.com

SportModel -( REST

application.qml -[hidden]u- Application
@enduml
```

## Authors

- **Silas Stulz** - *Initial Work*
- **Gero Beckmann** - *Initial Work*