basic setup pong - frontend and backend with simplw socket message and fastify route

This commit is contained in:
NigeParis 2025-12-13 12:08:12 +01:00 committed by Maix0
parent 5354c01bad
commit 6e6162c3f0
19 changed files with 60 additions and 641 deletions

View file

@ -3,8 +3,8 @@ import { Socket } from 'socket.io-client';
import { getUser } from "@app/auth";
/**
* function sends socket.emit to the backend to active and broadcast a message to all sockets
* echos the message with addMessage to the sender
* function sends socket.emit to the backend to active and a broadcast message to all sockets
* echos addPongMessage() the message with addMessage to the sender
* @param socket
* @param msgCommand
*/

View file

@ -2,19 +2,28 @@
<div id="mainbox" class="mainboxDisplay">
<button id="b-whoami" class="btn-style absolute top-4 left-6">Who am i</button>
<h1 class="text-3xl font-bold text-gray-800">
Pong Box<span id="t-username"></span>
Pong Box<span id="t-username"></span>
</h1><br>
<!-- Horizontal Message Box -->
<div id="system-box" class="system-info">System: connecting ... </div>
<!-- Pong Box -->
<p>try this in a terminal</p>
</br>
<p>curl -k --data-raw '{"message": "Message SENT from the terminal en REMOTE"}' 'https://local.maix.me:8888/api/pong/broadcast' -H "Content-Type: application/json"</p>
<div class="flex justify-center mt-2">
<div id="g-textBoxes" class="flex flex-col">
<div id="t-chatbox" class="chatbox-style"></div>
<div id="t-input-send" class="flex gap-1 mt-2">
<div id="pongspace" class="flex flex-col">
<div id="pongbox" class="pongbox-style">
<div class="pong-field">
<div class="pong-center-line"></div>
<div class="pong-bat left"></div>
<div class="pong-bat right"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>