How un-35/3d_ponggame works
Project Type and Purpose
• This is a full-stack real-time 3D Pong game.
• Frontend: Three.js powered UI and game logic delivered via Vite.
• Backend: Django web server with Django Channels providing WebSocket endpoints for three game modes (local, remote, tournament).
• Database: SQLite for persistence (scores, tournament brackets, etc.).
File Structure
• Top level:
• backend/ – Django project (“backend/backend/” contains settings, URLs, ASGI/WGI entry points).
• backend/game/ – Django app with WebSocket consumers (BallConsumer.py, consumers.py), routing.py, models.py, views.py.
• frontend/ – Vite project with Three.js assets (Ball.js, Paddle.js, game-mode.js, manage-scores.js).
• requirements.txt and venv/ – Python dependencies and virtual environment.
• Configuration and entry scripts:
• backend/asgi.py + routing.py in game/ define channel routes (/ws/local-game/, etc.).
• frontend/vite.config.js and index.html boot the dev server.
Key Architecture Insights from README
• Technology stack reinforces WebSocket–based real-time communication via Django Channels and Daphne ASGI server.
• Three game modes map to three WebSocket endpoints.
• Frontend subscribes to game state updates (ball position, scores) over JSON messages.