最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

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

matteradmin6PV0评论

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

Post a comment

comment list (0)

  1. No comments so far