Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend Status Store #53

Open
wingtkw opened this issue Dec 28, 2023 · 5 comments
Open

Frontend Status Store #53

wingtkw opened this issue Dec 28, 2023 · 5 comments

Comments

@wingtkw
Copy link
Collaborator

wingtkw commented Dec 28, 2023

@KalpasWang @sandytang886
Any suggestion on how to store the status in frontend?

e.g. how many cultists & shoggoths left?
user info?
turns left?
that kind of thing

A library that I have used is named jotai
which is a more atomic one compared with redux

https://jotai.org/docs/basics/comparison

@wingtkw
Copy link
Collaborator Author

wingtkw commented Dec 28, 2023

here is a quick demo on the use of jotai
you may view how it's done in the /feature/frontend/navbar branch

image

@KalpasWang
Copy link
Collaborator

jotai looks good

also one thing, do we need something like react query to manage our server state?
or just manage it manually in jotai,

I haven't used react query, but it's very popular.

@wingtkw
Copy link
Collaborator Author

wingtkw commented Dec 29, 2023

For managing server state
I use react query before for rest api
And it's quite easy to use

But I guess in our game
We are mostly using socket as well for real time state change and update
So I think socket io client is more appropriate in this case

@KalpasWang
Copy link
Collaborator

ok, I see👌

@metalalive
Copy link
Collaborator

metalalive commented Jan 24, 2024

It is time to document API endpoint to socket.io server, to let frontend people know how to interact with socket.io server.
I will add more detail at here (by editing this comment) tomorrow morning if I have time .

Relevant discussion :

  • Ted suggested AsyncAPI to document API endpoints for real-time communication (socket.io in current project)
  • Issue #37 , currently the backend app supports 3 socket.io events
    • switch character, set difficulty level, chat message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants