Skip to content

Commit dcde805

Browse files
committed
Removing randomize machine
1 parent fc557b0 commit dcde805

File tree

14 files changed

+93
-166
lines changed

14 files changed

+93
-166
lines changed

backend/src/main/resources/application.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ spring:
2222
servlet:
2323
SecurityAutoConfiguration
2424

25-
2625
server:
2726
port : 8081
2827

28+
telegram:
29+
bot:
30+
token:
31+
12345:mybottesttoken
2932

common/src/commonMain/kotlin/ru/posidata/common/Resources.kt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ enum class Resources(
3939
FEEBAS(22, "A Water-type Pokémon that is often seen as unattractive, but evolves into the beautiful Milotic.", POKEMON),
4040

4141
// BigData
42+
// phase 1
4243
HADOOP(23, "Framework that allows for the distributed processing of large data sets across clusters using programming models.", BIG_DATA),
4344
FLINK(24, "A stream processing framework that processes data in real time and is known for its low-latency performance.", BIG_DATA),
4445
HIVE(25, "A data warehouse infrastructure built on top of Hadoop, enabling users to perform queries on large datasets.", BIG_DATA),
@@ -60,7 +61,18 @@ enum class Resources(
6061
ARVADOS(41, "An open-source platform for managing and analyzing large-scale genomic and biomedical data.", BIG_DATA),
6162
GEODE(42, "An open-source, distributed data management platform designed for high performance real-time data access and analytics.", BIG_DATA),
6263
ADABAS(43, "A high-performance, transactional database management system designed to handle large volumes of data.", BIG_DATA),
63-
ICEBERG(44, "An open table format for large analytic datasets that enables high-performance reads/writes and supports schema evolution.", BIG_DATA) ;
64+
ICEBERG(44, "An open table format for large analytic datasets that enables high-performance reads/writes and supports schema evolution.", BIG_DATA),
65+
// phase 2
66+
KUDU(45, "A distributed, columnar storage engine optimized for fast analytics on large datasets, designed for integration with Hadoop.", BIG_DATA),
67+
DRUID(46, "A real-time analytics database designed for fast slice-and-dice queries on large, high-dimensional data.", BIG_DATA),
68+
LUIGI(47, "A Python-based workflow management system used to build complex pipelines of batch jobs.", BIG_DATA),
69+
MILVUS(48, "An open-source vector database designed to manage, search, and index massive embedding vectors.", BIG_DATA),
70+
WEAVIATE(49, "An open-source vector search engine and graph database designed for machine learning and semantic search.", BIG_DATA),
71+
PAIMON(50, "A high-performance streaming table store for large-scale real-time data processing.", BIG_DATA),
72+
DORIS(51, "An MPP-based interactive SQL data warehouse that provides sub-second query responses on large datasets.", BIG_DATA),
73+
LANCE(52, "A data format and query engine designed for fast machine learning and analytics workflows with efficient version control.", BIG_DATA),
74+
NIMBLE(53, "A lightweight, flexible, and scalable in-memory computing platform designed for real-time analytics.", BIG_DATA);
75+
;
6476

6577
companion object {
6678
fun getById(i: Int): Resources = Resources.entries.find { it.id == i }!!

frontend/src/jsMain/kotlin/ru/posidata/App.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ val App: FC<Props> = FC {
3333
path = "/"
3434
element = mainView.create()
3535
errorElement = errorBoundary.create()
36-
},
37-
jso {
38-
path = "/luckydraw"
39-
element = luckyDrawCard.create()
40-
errorElement = errorBoundary.create()
4136
}
4237
)
4338
)
@@ -46,16 +41,13 @@ val App: FC<Props> = FC {
4641

4742
fun main() {
4843
/* Workaround for issue: https://youtrack.jetbrains.com/issue/KT-31888 */
49-
@Suppress("UnsafeCastFromDynamic")
5044
if (window.asDynamic().__karma__) {
5145
return
5246
}
5347
// this is needed for webpack to include resources
5448
kotlinext.js.require<dynamic>("../scss/app.scss")
5549
// this is needed for webpack to include bootstrap
5650
kotlinext.js.require<dynamic>("bootstrap")
57-
/* ReactModal.setAppElement(document.getElementById("wrapper") as HTMLElement) // required for accessibility in react-modal */
58-
5951
val mainDiv = document.getElementById("wrapper") as HTMLElement
6052
createRoot(mainDiv).render(App.create())
6153
}

frontend/src/jsMain/kotlin/ru/posidata/views/main/MainView.kt

Lines changed: 67 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ package ru.posidata.views.main
22

33
import js.objects.jso
44
import react.*
5-
import react.dom.html.ReactHTML
6-
import react.dom.html.ReactHTML.button
75
import react.dom.html.ReactHTML.div
86
import ru.posidata.common.Answer.NONE
97
import ru.posidata.common.Selection
@@ -16,8 +14,6 @@ import ru.posidata.common.UserForSerializationDTO
1614
import web.cssom.*
1715

1816
val mainView = FC {
19-
val (luckyDraw, setLuckyDraw) = useState(false)
20-
2117
Particles::class.react {
2218
id = "tsparticles"
2319
url = "${kotlinx.browser.window.location.origin}/particles.json"
@@ -31,137 +27,94 @@ val mainView = FC {
3127
val (user, setUser) = useState<UserForSerializationDTO?>(null)
3228
val (tgUser, setTgUser) = useState<UserDataFromTelegram?>(null)
3329

34-
if (!luckyDraw) {
30+
div {
31+
className = ClassName("full-width-container")
3532
div {
36-
className = ClassName("full-width-container")
33+
className = ClassName("row justify-content-center align-items-center")
34+
style = jso {
35+
minHeight = "100vh".unsafeCast<MinHeight>()
36+
}
37+
3738
div {
38-
className = ClassName("row justify-content-center align-items-center")
39+
id = "back"
40+
className = ClassName("card col-xl-4 col-lg-5 col-md-7 col-sm-8 col-12")
3941
style = jso {
40-
minHeight = "100vh".unsafeCast<MinHeight>()
42+
minHeight = "80vh".unsafeCast<MinHeight>()
43+
borderRadius = "40px 40px 40px 40px".unsafeCast<BorderRadius>()
44+
boxShadow = "10px 10px 20px rgba(0, 0, 0, 0.5)".unsafeCast<BoxShadow>()
4145
}
4246

47+
headerRow {}
48+
4349
div {
44-
id = "back"
45-
className = ClassName("card col-xl-4 col-lg-5 col-md-7 col-sm-8 col-12")
50+
className = ClassName("row justify-content-center text-white mt-3 ")
4651
style = jso {
47-
minHeight = "80vh".unsafeCast<MinHeight>()
48-
borderRadius = "40px 40px 40px 40px".unsafeCast<BorderRadius>()
49-
boxShadow = "10px 10px 20px rgba(0, 0, 0, 0.5)".unsafeCast<BoxShadow>()
52+
zIndex = "1000".unsafeCast<ZIndex>()
53+
minHeight = "53vh".unsafeCast<MinHeight>()
54+
display = Display.flex
5055
}
5156

52-
headerRow {}
53-
54-
div {
55-
className = ClassName("row justify-content-center text-white mt-3 ")
56-
style = jso {
57-
zIndex = "1000".unsafeCast<ZIndex>()
58-
minHeight = "53vh".unsafeCast<MinHeight>()
59-
display = Display.flex
60-
}
61-
if (user != null && user.gameNumber() == 4) {
62-
ReactHTML.h6 {
63-
className = ClassName("mb-2 text-white mx-2")
64-
+"Ты отыграл уже три раза, в рейтинге участвовать больше не получится, обнови страницу если хочешь просто пройти тест. Твои результаты:"
65-
57+
when (selection) {
58+
Selection.NONE -> {
59+
welcomeCard {
60+
this.setSelection = setSelection
61+
this.setUser = setUser
62+
this.tgUser = tgUser
63+
this.setTgUser = setTgUser
6664
}
67-
ReactHTML.h6 {
68-
className = ClassName("mb-2 text-center")
69-
style = jso {
70-
color = "yellow".unsafeCast<Color>()
71-
}
72-
+"${user.firstGameScore}/12"
73-
}
74-
ReactHTML.h6 {
75-
className = ClassName("mb-2 text-center")
76-
style = jso {
77-
color = "yellow".unsafeCast<Color>()
78-
}
79-
+"${user.firstGameScore}/12"
80-
}
81-
ReactHTML.h6 {
82-
className = ClassName("mb-2 text-center")
83-
style = jso {
84-
color = "yellow".unsafeCast<Color>()
85-
}
86-
+"${user.thirdGameScore}/12"
87-
}
88-
} else {
89-
when (selection) {
90-
Selection.NONE -> {
91-
welcomeCard {
92-
this.setSelection = setSelection
93-
this.setUser = setUser
94-
this.tgUser = tgUser
95-
this.setTgUser = setTgUser
96-
}
97-
}
98-
99-
QUESTION -> questionCard {
100-
this.counter = counter
101-
this.setCounter = setCounter
102-
this.answers = answers
103-
this.setAnswers = setAnswers
104-
this.setPokemonId = setPokemonId
105-
this.pokemonId = pokemonId
106-
this.setSelection = setSelection
107-
this.uniqueRandom = uniqueRandom
108-
this.setUniqueRandom = setUniqueRandom
109-
110-
this.user = user
111-
this.tgUser = tgUser
112-
this.setUser = setUser
113-
}
114-
115-
ANSWER -> {
116-
answerCard {
117-
this.setSelection = setSelection
118-
this.counter = counter
119-
this.pokemonId = pokemonId
120-
this.answers = answers
121-
}
122-
}
65+
}
12366

124-
RESULTS -> {
125-
resultCard {
126-
this.counter = counter
127-
this.answers = answers
128-
this.setSelection = setSelection
129-
this.setCounter = setCounter
130-
this.setAnswers = setAnswers
131-
this.setUniqueRandom = setUniqueRandom
132-
this.setSelection = setSelection
67+
QUESTION -> questionCard {
68+
this.counter = counter
69+
this.setCounter = setCounter
70+
this.answers = answers
71+
this.setAnswers = setAnswers
72+
this.setPokemonId = setPokemonId
73+
this.pokemonId = pokemonId
74+
this.setSelection = setSelection
75+
this.uniqueRandom = uniqueRandom
76+
this.setUniqueRandom = setUniqueRandom
77+
78+
this.user = user
79+
this.tgUser = tgUser
80+
this.setUser = setUser
81+
}
13382

134-
this.user = user
135-
this.tgUser = tgUser
136-
this.setUser = setUser
137-
}
138-
}
83+
ANSWER -> {
84+
answerCard {
85+
this.setSelection = setSelection
86+
this.counter = counter
87+
this.pokemonId = pokemonId
88+
this.answers = answers
13989
}
14090
}
141-
}
14291

143-
if (selection != Selection.NONE) {
144-
progressBar {
145-
this.counter = counter
146-
this.selection = selection
147-
this.answers = answers
92+
RESULTS -> {
93+
resultCard {
94+
this.counter = counter
95+
this.answers = answers
96+
this.setSelection = setSelection
97+
this.setCounter = setCounter
98+
this.setAnswers = setAnswers
99+
this.setUniqueRandom = setUniqueRandom
100+
this.setSelection = setSelection
101+
102+
this.user = user
103+
this.tgUser = tgUser
104+
this.setUser = setUser
105+
}
148106
}
149107
}
108+
}
150109

151-
button {
152-
className = ClassName("btn btn-outline-info btn-lg")
153-
onClick = {
154-
setLuckyDraw(true)
155-
}
156-
+"Розыгрыш"
110+
if (selection != Selection.NONE) {
111+
progressBar {
112+
this.counter = counter
113+
this.selection = selection
114+
this.answers = answers
157115
}
158116
}
159117
}
160118
}
161-
} else {
162-
luckyDrawCard {
163-
164-
}
165119
}
166120
}
167-

frontend/src/jsMain/kotlin/ru/posidata/views/main/Welcome.kt

Lines changed: 9 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -38,42 +38,12 @@ val welcomeCard = FC<WelcomeCardProps> { props ->
3838
response.ok -> {
3939
props.setUser(response.decodeFromJsonString<UserForSerializationDTO>())
4040
}
41-
else -> window.alert("Failed to validate with telegram")
41+
else -> window.alert("Failed to authorize you with telegram")
4242
}
4343
}
4444
props.setSelection(Selection.QUESTION)
4545
}
4646

47-
// just a small test
48-
/*
49-
div {
50-
button {
51-
onClick = {
52-
console.log(props.tgUser)
53-
getUser()
54-
}
55-
}
56-
}
57-
58-
div {
59-
button {
60-
onClick = {
61-
val feUser = UserDataFromTelegram(
62-
authDate = 1725741859,
63-
firstName = "Андрей",
64-
lastName = "Кулешов",
65-
hash = "4a8cb14838a9797d8994bf73ac9734e3fd634a5abec5be7371f83737d1dc82e8",
66-
id = 221298772,
67-
photoUrl = "https://t.me/i/userpic/320/d3fKyG306aXHDBCxZXfWTpGlii6fZqZMo1tBmMPEl_E.jpg",
68-
username = "akuleshov7",
69-
)
70-
props.setTgUser(feUser)
71-
}
72-
}
73-
}
74-
*/
75-
76-
7747
div {
7848
className = ClassName("row justify-content-center mt-1 px-0")
7949
div {
@@ -92,7 +62,7 @@ val welcomeCard = FC<WelcomeCardProps> { props ->
9262
display = "inline".unsafeCast<Display>()
9363
color = "rgb(0, 206, 224)".unsafeCast<Color>()
9464
}
95-
+" или "
65+
+" or "
9666
}
9767
h1 {
9868
style = jso {
@@ -104,34 +74,31 @@ val welcomeCard = FC<WelcomeCardProps> { props ->
10474
}
10575

10676
h6 {
107-
// (https://docs.google.com/a/octo.com/forms/d/1kckcq_uv8dk9-W5rIdtqRwCHN4Uh209ELPUjTEZJDxc/viewform)
108-
// (https://github.com/pixelastic/pokemonorbigdata)
10977
className = ClassName("mt-3 mb-3 text-start")
110-
+("Шуточный тест из 12 вопросов, сделаный за пару ночей, чтобы показать " +
111-
"насколько большой зоопарк из названий образовался в дате. " +
112-
"Изначальная идея родилась "
78+
+("A humorous test of 12 questions, made over a couple of nights to show just how large a zoo of names " +
79+
"has formed in the Big Data world. The original idea was born "
11380
)
11481
a {
11582
href =
11683
"https://docs.google.com/forms/d/e/1FAIpQLScRsfRHXPTuEXdNvUcI8DzJIU5iazqlpksWucPF0d8l2ztkkA/viewform"
11784
className = ClassName("text-info")
118-
+"тут"
85+
+"here"
11986
}
12087

121-
+" и "
88+
+" and "
12289

12390
a {
12491
href = "https://pixelastic.github.io/pokemonorbigdata/"
12592
className = ClassName("text-info")
126-
+"тут"
93+
+"here"
12794
}
12895

129-
+" Иходный код этого сайта открыт "
96+
+" The source code of this site can be found on the "
13097

13198
a {
13299
href = "https://github.com/orchestr7/PokemonOrBigData"
133100
className = ClassName("text-info")
134-
+"здесь"
101+
+"GitHub"
135102
}
136103

137104
+". ${if (props.tgUser == null) "Чтобы участвовать в розыгрыше и рейтинге - залогинься:" else ""}"
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)