Ralex91 / Rahoot

Rahoot is a straightforward and open-source Kahoot! clone platform, allowing users to host it on their own server for smaller events.
MIT License
3 stars 0 forks source link

Connected to localhost from other devices succesfully, but entering room pin does nothing. #6

Closed Kral-bohu closed 4 hours ago

Kral-bohu commented 5 hours ago

I have downloaded (zip folder than used npm install) and hosted (npm run all-dev) Rahoot succesfully, but other devices, when connected over IP adress of host, do nothing when entered room pin. When it loads enter-pin-screen, it looks like succes, but entering pin does nothing... even no "room not found" mesage, when incorrect pin inputted. Nothing. Tested on both phone and other PC. When i tried npm run all, it shows following error:

[0]   ▲ Next.js 14.2.10
[0]   - Local:        http://localhost:3000
[0]
[0]  ✓ Starting...
[0] Error: Could not find a production build in the '.next' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id
[0]     at setupFsCheck (C:\Users\jonas\Downloads\Rahoot-main\Rahoot-main\node_modules\next\dist\server\lib\router-utils\filesystem.js:151:19)
[0]     at async initialize (C:\Users\jonas\Downloads\Rahoot-main\Rahoot-main\node_modules\next\dist\server\lib\router-server.js:62:23)
[0]     at async Server.<anonymous> (C:\Users\jonas\Downloads\Rahoot-main\Rahoot-main\node_modules\next\dist\server\lib\start-server.js:249:36)
[0] npm run start exited with code 1
--> Sending SIGTERM to other processes..
[1] npm run socket exited with code 1

This software looks very promising to me, I've managed to "play" from same PC that host game. What causes that?

Ps. It's fuuny that there are plenty of self-hostable kahoot-like programs on Github, and I've tested many of them without succes, even through those all have description (README file), and yours program worked without it.

Ralex91 commented 5 hours ago

Before doing the npm run all command you have to do the npm run build command to build the prod version of Next js, you don't have to do it every time unless you change the code of the Next js app

Sorry, I haven't made a doc yet to really use it well ...

Kral-bohu commented 5 hours ago

Thanks. Error solved. But it did not solve the connection issue - entering room pin on other devices still does nothing ) :,

Kral-bohu commented 5 hours ago

I haven't made a doc yet to really use it well

I could do basic documentation (for windows) since I managed to make it working somehow, but there's still this connection problem. Any ideas what is this causing?

Ralex91 commented 5 hours ago

I think I have an idea, because I built the global config of the project wrong (which will change later), but check the following files to configure it well with the current version:

https://github.com/Ralex91/Rahoot/blob/main/src/constants.js https://github.com/Ralex91/Rahoot/blob/main/socket/quizz.config.js

Ralex91 commented 5 hours ago

This is a project I did in a month so that's why it's not perfect.

Kral-bohu commented 4 hours ago

configure it well with the current version

Ooh, I do not really know what I'm supposed to do, I'm not that much coder. Changing WEB_SOCKET to 3000 does no diffrence. But I appreciate your support. I'll look forward to update then. Does it work on your PC and devices?

I did it in a month

Well when you can do that good software so quickly, good job.

Ralex91 commented 4 hours ago

Do you have successful to make it work Rahoot?

I tested it on class room however, there is no reconnection system: if someone refreshes the page, they will not be able to come back. Also, I have not full tested the interface on the phone

Kral-bohu commented 4 hours ago

As I wrote, everything works, but connecting from other device on same wifi (http://192.168.xx.xx:3000), it loads, but entering room pin does nothing. Not on phone nor on other PC.

Ralex91 commented 4 hours ago

You have changed the file: https://github.com/Ralex91/Rahoot/blob/main/src/constants.js

Because you have to put the public IP, in your case: WEBSOCKET_URL = 192.168.xx.xx:5157 and redo the command npm run build before npm run all

Kral-bohu commented 4 hours ago

Thank you. So WEBSOCKET_URL should contain computers IP with port number okay? Sadly I can't try it now. I changed WEBSOCKET_URL to 4000, but only archived that it now does nothing on host pc when as manager entering password. Thank you for assistance!

Kral-bohu commented 4 hours ago

What about me writing basic docs for you and for future other users?

Ralex91 commented 4 hours ago

No, it'll be fine, I'll do it tomorrow.

Kral-bohu commented 4 hours ago

It WORKS! EXTREMELY thank you!! Very, verrry good job. Profesional assistance ☆☆☆☆☆. Feel free to ask me for the docs, even through I learn using npm yestersay now I feel like I know yours program throughout.