very basic frontend skeleton

This commit is contained in:
2025-05-03 20:00:32 -06:00
parent cb08c08246
commit 76522cc053
9 changed files with 214 additions and 6 deletions
+5
View File
@@ -0,0 +1,5 @@
import score_update
pub type UpdateScore {
BuzzIn(user_id: Int, score_update: score_update.ScoreUpdateType)
}
+26
View File
@@ -0,0 +1,26 @@
pub type ScoreUpdateType {
Add
Subtract
Reset
}
pub type Error {
InvalidUpdateType
}
pub fn serialize(score_update: ScoreUpdateType) -> String {
case score_update {
Add -> "Add"
Subtract -> "Subtract"
Reset -> "Reset"
}
}
pub fn deseralize(score_update_string) -> Result(ScoreUpdateType, Error) {
case score_update_string {
"Add" -> Ok(Add)
"Subtract" -> Ok(Subtract)
"Reset" -> Ok(Reset)
_ -> Error(InvalidUpdateType)
}
}
-4
View File
@@ -1,5 +1 @@
import gleam/io
pub fn main() {
io.println("Hello from shared!")
}
+5
View File
@@ -0,0 +1,5 @@
import gleam/option
pub type UserState {
UserState(id: Int, name: String, game_id: option.Option(Int))
}