Commit Graph

16 Commits

Author SHA1 Message Date
efim e1364c9b9b simple routes mapped to room service 2023-04-28 09:28:57 +04:00
efim 8098f24552 rooms service methods implementation
removed stubbed room, but thing compiles and maybe will work?
lot's of pain with trying to store Topic inside Ref together with Room.

storing them together in a tuple means for the room there should always
be a topic
but then modifying the room in side of ref is uncomfortable, because i
want to do F[Unit] send updated room together with room modification,
but Ref seems to take in only pure function to update the value

there got to be maybe some semaphors or something like that?
and storing topics where? in a separate state?
that would maybe simplify things, but i'm coding well into the night and
that's not a good idea really

now before testing this with front end, i need a way to create a room.
2023-04-28 02:54:15 +04:00
efim bd38a29b6d backend: move roomService usage to httpService
no longer used in auth module,
ready to connect rest routes to room service
2023-04-28 00:46:25 +04:00
efim f8bf1b961b new logout button
triggers /api/logout and updates app loggedIn state
2023-04-27 10:34:40 +04:00
efim 9db42cb522 connect login and room pages via logged in state
moving websocket into being managed by the room component.
if the partent would want access to "user signal" it can ask via
observer.
that would mean bidirectionality, and i already hear screeching of my
intuitions from react, but maybe that's ok and in react i would still
scope the websocket to the room page, plus callbacks
2023-04-26 22:32:53 +04:00
efim 90e886c62d new Join Room form that requests authcookie
getting stubbed session #1,
with auth module stubbed to accept that session in.
and stubbed method for streaming room state,
but that's enough to start testing room calling api's for other actions

next - pass in observable from parent to re-toggle subscription
websocket after successful login
2023-04-26 11:42:40 +04:00
efim 1f28a03d47 temporarily hardcoding backend room and session 2023-04-26 08:56:51 +04:00
efim 1b71c942ec adding room service, joining room
adding nick password into model, stored in the Room
to allow more secure joining for repeated times
2023-04-25 11:41:32 +04:00
efim 2244f38348 scalafmt all 2023-04-25 10:25:36 +04:00
efim 0a721b135f stubbed auth with tagless final 2023-04-25 10:23:13 +04:00
efim 64267a5f67 backend - adding room service and wiring
preparing to create a better auth module that uses room service
2023-04-25 09:55:45 +04:00
efim 8716385ea1 adding fork := true for backend server interrupts
without it app starts in same jvm and we're told that Ctrl+C will not
always kill the Ember server:

https://typelevel.org/cats-effect/docs/2.x/datatypes/ioapp
WARNING: If you run your IOApp program from sbt, you may observe cancellation and resource releasing is not happening. This is due to sbt, by default, running programs in the same JVM as sbt, so when your program is canceled sbt avoids stopping its own JVM. To properly allow cancellation, ensure your progam is forked into its own JVM via a setting like fork := true in your sbt configuration.
2023-04-23 23:35:45 +04:00
efim f3e51a4750 fixing websocket, it was misspelled port
wow. just wow
2023-04-23 23:01:51 +04:00
efim 329dc6e8b2 initial way to run the server:
sbt:backend> assembly
java -jar backend/target/scala-3.2.0/backend-assembly-0.1.0-SNAPSHOT.jar
2023-04-23 18:33:29 +04:00
efim df35f09b71 circe codec derivation to models 2023-04-23 15:00:00 +04:00
efim c6bfdacd1d dummy Auth and authed routes 2023-04-23 13:40:37 +04:00