database - Trying to connect input devices to a DB to an output device on the web - Stack Overflow

Background: making a choose your own adventure type game, but as a website. Based on choice A or B (onl

Background: making a choose your own adventure type game, but as a website. Based on choice A or B (only 2 choices) the story will go that direction.

The setup: Let's say 5 phones, used for inputs Big screen, used to display video and the questions Basically like kahoot to this point.

So, I want to collect the inputs from the phones, get the majority lets say A, send that to the big screen to continue the story in the correct direction.

How would I go about this? I would like it to have a live updates, can be on intervals, not constant.

I would prefer to use JS based frameworks and mongoDB. It needs to be all online too, not locally.

Thanks in advance!

I've used chatgpt but then it only worked locally and didn't use a DB i believe. It used AJAX, NODE.js, Express. I asked to make it usable online, but it started talking about several things I've never heard about like heroku and time is ticking...

Background: making a choose your own adventure type game, but as a website. Based on choice A or B (only 2 choices) the story will go that direction.

The setup: Let's say 5 phones, used for inputs Big screen, used to display video and the questions Basically like kahoot to this point.

So, I want to collect the inputs from the phones, get the majority lets say A, send that to the big screen to continue the story in the correct direction.

How would I go about this? I would like it to have a live updates, can be on intervals, not constant.

I would prefer to use JS based frameworks and mongoDB. It needs to be all online too, not locally.

Thanks in advance!

I've used chatgpt but then it only worked locally and didn't use a DB i believe. It used AJAX, NODE.js, Express. I asked to make it usable online, but it started talking about several things I've never heard about like heroku and time is ticking...

Share Improve this question asked Nov 18, 2024 at 12:50 Li-MingLi-Ming 1
Add a comment  | 

1 Answer 1

Reset to default 0

I think the chatgpt thing is a good draft, maybe you have to do some improvements to do.

With node.js you can create a backend server, that gives a rest-api for communicating with your db. Phones can call this rest-api to update the counter and your big screen can fetch in a given intervall, from your backend server to give a live-update. (This concept is called AJAX) Make sure to track session IDs and maybe some sort of uuid to ensure every phone can give only one vote on each decision and to relate the phones to the correct big screen. (If you want that multiple games can be done simultaniously)

Express is just a node.js Framework so you haven't to write that much code on your own.


If something is unclear do not hesitate do ask, I will update the answer.

But please keep in mind that SO is not the place to give you hundreds line of code, so you do not have to write them at your own. If you have a problem with your code, make a new question, post a minimal example, that reproduce the error. Describe what it should do, what you have tried to solve it, etc.

https://stackoverflow/help/how-to-ask

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745616991a4636295.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信