Pong with user management & authentication, tournaments, 3D gameplay, AI opponent, blockchain integration and game customization. Designed as a containerized microservices architecture.
Stack: Node.js • TypeScript • Fastify • Babylon.js • SQLite • Avalanche Blockchain • Docker • Elasticsearch • Tailwind
-
Use Fastify with Node.js to build the backend
-
Use Avalanche and Solidity to store the score of a tournament in the Blockchain
-
Standard user management, authentication, users across tournaments
-
Introduce an AI opponent
-
Infrastructure setup for log management
-
Designing the backend as microservices
-
Use advanced 3D techniques
-
Use Tailwind CSS in addition of the TypeScript to build the frontend
-
Use SQLite database for the backend
-
Game customization options
-
Expanding browser compatibility
See full checklist.
Total Score: 9/7 points (exceeded project requirements)
# Clone repository
git clone <repo-url>
cd transcendence
# Display available commands
make
# First-time setup and launch
make upThis will:
- Generate
.envfile with random secrets - Create SSL certificates
- Build all Docker images
- Start all services
Then go to
https://localhost
on your browser.
| Command | Purpose |
|---|---|
make up |
Build and start all services |
make down |
Stop all services |
make clean |
Stop services and remove database |
make test |
Run unit tests for all services |
make logs |
Start ELK Stack (logging dashboard) |
make load |
Load sample data into database |
make testTests cover:
- User registration and authentication
- Tournament score tracking
- Game state management
- API endpoint validation
- Blockchain contract interactions
- 2D rendering with state synchronization
- Hidden canvas game loop feeding 3D visualization
- Collision detection and physics simulation
- Intelligent paddle control algorithm
- Secure JWT-based authentication
- Password hashing with bcrypt
- User profiles with statistics
- Friend request/management system
- User search and discovery
- Adjustable paddle speed and ball velocity
- Multiple map/texture themes
- Power-up toggle
- Tournament creation and bracket management
- Score calculation and leaderboards
- Historical match tracking
- Integration with blockchain for permanent record
- Babylon.js 3D rendering
- Textured game environments
- Dynamic camera controls
- Shader-based visual effects
- Real-time state synchronization with 2D game loop
- Smart contract-based tournament registry
- Immutable score storage on-chain
- Solidity contract deployment and interaction
- Fuji testnet integration
- Centralized log aggregation with Elasticsearch
- Structured logging across all services
- Kibana visualization dashboard
- Real-time log streaming and analysis
TypeScript-based immutable game state:
interface GameState {
paddle1Y: number;
paddle2Y: number;
ballX: number;
ballY: number;
ballSpeedX: number;
ballSpeedY: number;
score1: number;
score2: number;
gameRunning: boolean;
ballFlash: number;
powerUpActive?: boolean;
}- API Reference - Complete endpoint documentation
- Blockchain Setup - Avalanche integration guide
- Checklist - Module completion status
Framework & HTTP
- Fastify - High-performance Node.js framework
- fastify/jwt - JWT authentication middleware
- fastify/auth - Authorization plugin
Database
- better-sqlite3 - SQLite database driver with connection pooling
- SQLite - Lightweight relational database
Security
Blockchain
- Hardhat - Ethereum development framework
- Solidity - Smart contract language
- Web3.js - Blockchain interaction library
- Avalanche - Blockchain platform
Logging & Monitoring
- Pino - Low-overhead JSON logging
- Elasticsearch - Search and analytics engine
- Logstash - Log processing pipeline
- Kibana - Data visualization platform
Language & Build Tools
- TypeScript - JavaScript with static typing
- Vite - Lightning-fast build tool and dev server
- Tailwind CSS - Utility-first CSS framework
3D Graphics & Game Engine
- Babylon.js - Full-featured 3D engine
- Babylon.js Materials - Advanced shader effects
- Babylon.js Loaders - Asset loading system





