YOVI is a web application for playing the Game Y, developed as part of the ASW course at the University of Oviedo.
| Name | GitHub Profile |
|---|---|
| Sara Lamuño García 🐦🔥 | |
| Andrea Acero Suárez 🫡 | |
| Jorge Suárez Álvarez 🧊 | |
| Sergio Blanco García ◻️ |
The project is divided into several components, each in its own directory:
webapp/: A frontend application built with React, Vite, and TypeScript.users/authservice/: Authentication microservice handling login and JWT token issuance.users/userservice/: User management microservice for creating and querying user data.gateway/: API Gateway that routes requests to the appropriate microservice and handles JWT authorization.game/: Game service managing game sessions and state, built with Node.js and Express.friends/: Friends service managing friend requests and notifications.gamey/: A Rust game engine and bot service.docs/: Architecture documentation sources following Arc42 template
Each Node.js component has its own package.json file with the necessary scripts to run and test the application. The gamey component uses Cargo instead.
- User Registration: Users can register with a username, email, and password.
- User Authentication: Registered users can log in and out securely using JWT-based authentication.
- Game Management: Users can start a new game choosing the board size, game mode (2D or 3D), victory condition (connection or not), turn time limit, and whether to play against another person or a bot (with selectable bot strategy).
- Game History: Users can consult their game history, view per-game details, see statistics charts, and sort games by date.
- Friend System: Users can send, accept, and reject friend requests and view their friends list.
- Profile Management: Users can update their personal information, username, password, and profile picture.
- Notifications: Users receive in-app notifications for pending friend requests and game invitations.
- GameY Engine: A Rust-based game engine that validates moves, enforces game rules, and provides bot strategies for different board configurations.
A short demonstration of the application showcasing its main features.
Users can create a new account with a username, email, and password, or log in to an existing one.
Before starting a game, players choose the board size, game mode (2D or 3D), victory condition, turn time limit, and opponent (human or bot). The board is then rendered in real time with move validation powered by the Rust engine. The 3D tetrahedron mode offers a unique spatial variant of the game.
Players can send and accept friend requests to build their network. All past games are recorded and accessible from the history page, with statistics and per-game details. Users can also edit their profile information at any time.
The webapp is a single-page application (SPA) created with Vite and React.
src/App.tsx: Root component and routing setup.src/pages/: Page-level components (login, register, game history, friends, profile).src/components/: Reusable UI components (game board, sidebar, notifications, etc.).src/services/: API client functions for communicating with the gateway.src/context/: React context providers for global state.package.json: Contains scripts to run, build, and test the webapp.vite.config.ts: Configuration file for Vite.Dockerfile: Defines the Docker image for the webapp.
The users/authservice is a REST API built with Node.js and Express that handles user authentication.
auth-service.js: Main file. Defines endpoints for login and token generation using JWT and bcrypt for password hashing.auth-model.js: Mongoose model for user credentials.package.json: Contains scripts to start and test the service.Dockerfile: Defines the Docker image for the auth service.
The users/userservice is a REST API built with Node.js and Express that manages user data.
user-service.js: Main file. Defines endpoints for user creation and retrieval.user-model.js: Mongoose model for user profiles.package.json: Contains scripts to start and test the service.Dockerfile: Defines the Docker image for the user service.
The gateway is the single entry point for all client requests, built with Node.js and Express.
gateway-service.js: Main file. Routes incoming requests to the auth, user, and game microservices. Validates JWT tokens and enforces authorization.openapi.yaml: OpenAPI/Swagger specification for the gateway API.monitoring/: Prometheus and Grafana configuration for metrics.package.json: Contains scripts to start and test the service.Dockerfile: Defines the Docker image for the gateway service.
The game service is a REST API built with Node.js and Express that manages game sessions and state.
game-service.js: Main file. Defines endpoints for creating and managing games.gameModel.js: Mongoose model for game data.package.json: Contains scripts to start and test the service.Dockerfile: Defines the Docker image for the game service.
The friends service is a REST API built with Node.js and Express that manages friend relationships and notifications between users.
friend-service.js: Main file. Defines endpoints for sending, accepting, and rejecting friend requests.models/friendRequest.js: Mongoose model for friend requests.models/notification.js: Mongoose model for user notifications.middlewares/auth.js: JWT authentication middleware.package.json: Contains scripts to start and test the service.Dockerfile: Defines the Docker image for the friends service.
The gamey component is a Rust-based game engine with bot support, built with Rust and Cargo.
src/main.rs: Entry point for the application.src/lib.rs: Library exports for the gamey engine.src/bot/: Bot implementation and registry.src/core/: Core game logic including actions, coordinates, game state, and player management.src/notation/: Game notation support (YEN, YGN).src/web/: Web interface components.Cargo.toml: Project manifest with dependencies and metadata.Dockerfile: Defines the Docker image for the gamey service.
You can run this project using Docker (recommended) or locally without Docker.
This is the easiest way to get the project running. You need to have Docker and Docker Compose installed.
- Build and run the containers: From the root directory of the project, run:
docker compose up --buildThis command will build and start all services: webapp, gateway, authservice, userservice, game, gamey, friends, and MongoDB.
2.Access the application (default compose):
- Web application:
https://localhost(self-signed cert) - Gateway API:
https://localhost:8000 - API Documentation (Swagger UI):
https://localhost:8000/api-doc/
- Local ports + HTTP gateway (recommended for load tests):
docker compose --env-file .env.local up --build- Web application:
https://localhost:8443 - Gateway API:
http://localhost:8000 - API Documentation (Swagger UI):
http://localhost:8000/api-doc/
Load testing (Gatling): see webapp/load-tests/README.md.
Monitoring (Prometheus + Grafana): see gateway/monitoring/README.md.
To run the project locally without Docker, you will need to run each component in a separate terminal.
On Windows, you can launch all microservices at once using the provided batch script from the root directory:
launch_services.batThis opens a separate terminal window for each service (webapp, gateway, game, gamey, authservice, userservice, and friends) and installs dependencies automatically.
- Node.js and npm installed.
Navigate to the users/userservice directory:
cd users/userserviceInstall dependencies:
npm installRun the service:
npm startThe user service will be available at http://localhost:8001.
Navigate to the webapp directory:
cd webappInstall dependencies:
npm installRun the application:
npm run devThe web application will be available at http://localhost:5173.
Navigate to the gamey directory and run:
cd gamey
cargo runThe GameY engine will be available at http://localhost:4000.
Each component has its own set of scripts defined in its package.json. Here are some of the most important ones:
npm run dev: Starts the development server for the webapp.npm test: Runs the unit tests.npm run test:e2e: Runs the end-to-end tests.npm run start:all: A convenience script to start the webapp and all backend microservices concurrently.
npm start: Starts the auth service.npm test: Runs the tests with coverage.
npm start: Starts the user service.npm test: Runs the tests with coverage.
npm start: Starts the gateway service (HTTP).npm run start:https: Starts the gateway with HTTPS enabled.npm test: Runs the tests with coverage.
npm start: Starts the game service.npm test: Runs the tests.npm run test:coverage: Runs the tests with coverage report.
npm start: Starts the friends service.npm test: Runs the tests with coverage.
cargo build: Builds the gamey application.cargo test: Runs the unit tests.cargo run: Runs the gamey application.cargo doc: Generates documentation for the GameY engine applicationcargo check: Check that it compiles.cargo add <list_of_dependencies>: Add dependencies in <list_of_dependencies>.
rustup docs: Opens the Rust documentation in local.







