Rallyu is a modern, scalable online gaming platform built with a microservices architecture. It provides real-time multiplayer gaming experiences with features like tournaments, matchmaking, chat, and comprehensive player statistics.
- Real-time Multiplayer Gaming: Engage in competitive matches with players worldwide
- Tournament System: Organize and participate in gaming tournaments
- Intelligent Matchmaking: Advanced algorithms to match players of similar skill levels
- Live Chat: Real-time communication between players
- User Authentication: Secure JWT-based authentication and authorization
- Notifications: Real-time push notifications for game events
- Statistics & Analytics: Comprehensive player statistics and game analytics
- Responsive UI: Modern, responsive frontend built with Next.js
Rallyu follows a microservices architecture with the following components:
- Next.js 15 - React framework with server-side rendering
- TypeScript - Type-safe development
- Tailwind CSS - Modern utility-first CSS framework
- Socket.io Client - Real-time bidirectional communication
- i18n - Multi-language support
- API Gateway - Central entry point for all client requests, handles routing and WebSocket connections
- ms-auth - Authentication and authorization service (SQLite)
- ms-game - Game logic and state management
- ms-tournament - Tournament creation and management (SQLite)
- ms-matchmaking - Player matchmaking and lobby management
- ms-chat - Real-time chat functionality (SQLite)
- ms-notif - Push notification service (SQLite)
- NGINX - Reverse proxy and load balancer with SSL/TLS support
- Redis - In-memory data store for caching and session management
- NATS - Message broker for inter-service communication
- Prometheus - Metrics collection and monitoring
- Grafana - Metrics visualization and dashboards
- Elasticsearch - Log aggregation and search
- Logstash - Log processing pipeline
- Kibana - Log visualization and analysis
- HashiCorp Vault β Secure secrets management for credentials and API keys.
In this project, Vault is configured but not actively used.
- Next.js 15.5.3
- React 19.1.0
- TypeScript 5.8.3
- Tailwind CSS 4.1.3
- Socket.io Client 4.8.1
- Axios 1.9.0
- Framer Motion 12.19.2
- Node.js (v20+)
- Fastify 5.4.0
- TypeScript 5.9.2
- Socket.io 4.8.1
- NATS 2.29.3
- JWT Authentication
- SQLite (for microservices databases)
- Docker & Docker Compose v2.20+
- NGINX
- Prometheus
- Grafana
- ELK Stack (Elasticsearch, Logstash, Kibana)
- Redis Alpine 3.22
- NATS Alpine 3.22
Before you begin, ensure you have the following installed:
- Node.js: v20 or above
- npm: v11.3.0 or above
- Docker: Latest version
- Docker Compose: v2.20 or above (v2.30.0 recommended)
- Git: For version control
- Make: For using Makefile commands
git clone https://github.com/ismailassil/rallyu.git
cd rallyuThe project uses environment variables for configuration. Run the environment setup script:
make envThis will execute ./env-script/spread-env.sh to distribute environment variables across all services.
If you don't have Docker Compose v2.30.0, install it:
make dockermake up_appThis will:
- Build and start all application services (frontend, backend microservices, NGINX)
- Enable watch mode for automatic rebuilds on code changes
- Services will be accessible at
http://localhostorhttps://localhost
make up_allThis starts both the application and DevOps services (monitoring and logging).
The project includes a comprehensive Makefile for easy management:
make up_app # Start application services
make down_app # Stop application services
make clean_app # Stop and remove containers and volumes
make ps_app # List application containers with status
make re_app # Rebuild and restart applicationmake up_devops # Start monitoring and logging services
make down_devops # Stop DevOps services
make clean_devops # Stop and remove DevOps containers and volumes
make ps_devops # List DevOps containers with status
make re_devops # Rebuild and restart DevOps servicesmake up_all # Start all services (app + devops)
make down_all # Stop all services
make clean_all # Clean all containers and volumes
make fclean # Full cleanup (containers, volumes, images)
make prune # Remove all unused Docker resourcesmake env # Load environment variables
make docker # Install Docker Compose 2.30.0
make help # Display help informationrallyu/
βββ app/
β βββ frontend/ # Next.js frontend application
β β βββ src/
β β β βββ app/ # Next.js app directory
β β β βββ messages/ # i18n message files
β β βββ public/ # Static assets
β β βββ Dockerfile
β β βββ package.json
β β
β βββ backend/ # Backend microservices
β β βββ api-gateway/ # API Gateway service
β β βββ ms-auth/ # Authentication service
β β βββ ms-game/ # Game logic service
β β βββ ms-tournament/ # Tournament service
β β βββ ms-matchmaking/ # Matchmaking service
β β βββ ms-chat/ # Chat service
β β βββ ms-notif/ # Notification service
β β βββ compose.backend.yaml
β β
β βββ compose.app.yaml # Frontend compose configuration
β
βββ devops/
β βββ monitoring/ # Prometheus & Grafana
β β βββ prometheus/ # Prometheus configuration
β β βββ grafana/ # Grafana dashboards
β β βββ backend-exporter/ # Custom metrics exporter
β β βββ compose.monitoring.yaml
β β
β βββ logging/ # ELK Stack
β β βββ elasticsearch-policy/
β β βββ logstash/
β β βββ kibana/
β β βββ compose.logging.yaml
β β
β βββ compose.devops.yaml # Main DevOps compose file
β
βββ nginx/ # NGINX reverse proxy
β βββ conf/ # NGINX configurations
β βββ logs/ # NGINX logs
β βββ Dockerfile
β
βββ docker-compose.yaml # Main Docker Compose file
βββ Makefile # Build and deployment automation
βββ .env # Environment variables
βββ README.md # This file
Once the application is running, you can access:
- Frontend: http://localhost (port 80) or https://localhost (port 443)
- API Gateway: http://localhost:4025 (internal)
- Grafana: https://localhost:3035 (when DevOps is running)
- Kibana: https://localhost:5601 (when DevOps is running)
- Redis: localhost:6379 (internal)
- NATS: localhost:4222 (internal)
The application is configured with Docker Compose watch mode, enabling hot reload during development:
- Frontend changes are synced automatically
- Backend microservices sync source code changes
- Package.json changes trigger rebuilds
For frontend:
cd app/frontend
npm install <package-name>For backend services:
cd app/backend/<service-name>
npm install <package-name>Each microservice that requires persistence uses SQLite:
- ms-auth:
app/backend/ms-auth/src/database/database.db - ms-tournament:
app/backend/ms-tournament/database/tournament.db - ms-chat:
app/backend/ms-chat/database/database.sqlite - ms-notif:
app/backend/ms-notif/database/database.sqlite
These databases are mounted as volumes for data persistence.
Prometheus collects metrics from:
- NGINX (via nginx-prometheus-exporter)
- Backend services (custom metrics via fastify-metrics)
- System metrics
Grafana provides pre-configured dashboards for:
- Application performance monitoring
- Request rates and latencies
- Error rates
- Resource utilization
Access Grafana at https://localhost:3035 after running make up_devops.
Centralized logging with Elasticsearch, Logstash, and Kibana:
- Logstash processes and transforms logs
- Elasticsearch stores and indexes logs
- Kibana provides search and visualization
Access Kibana at https://localhost:5601 after running make up_devops.
- JWT-based authentication
- NGINX reverse proxy with rate limiting
- Helmet.js for security headers
- CORS configuration
- Environment-based secrets management
- SSL/TLS support
# Check service status
make ps_app
# Check logs
docker-compose logs <service-name>
# Restart services
make re_appEnsure the following ports are available:
- 80, 443 (NGINX)
- 3000 (Frontend - internal)
- 4025 (API Gateway - internal)
- 4222 (NATS - internal)
- 6379 (Redis - internal)
make fclean # Remove everything
make up_all # Start freshThis project is proprietary software.