Application url: http://4.233.210.164
Documentation url: https://arquisoft.github.io/yovi_es5c/
This project is a template with some basic functionality for the ASW labs.
| Contributor | Profile |
|---|---|
| Rodríguez Fuertes, Claudia | |
| Martínez de Zuvillaga, José | |
| Trelles Riestra, Mario | |
| González Pérez, Daniel | |
| Arias Guerrero, Miguel |
The project is divided into three main components, each in its own directory:
gatewayservice/: A frontend gateway service that serves as the main entry point of the application.webapp/: A frontend application built with React, Vite, and TypeScript.users/: A backend service for managing users, built with Node.js and Express.gamey/: A Rust game engine and bot service.docs/: Architecture documentation sources following Arc42 template
Each component has its own package.json file with the necessary scripts to run and test the application.
- User Registration: The web application provides a simple form to register new users.
- User Service: The user service receives the registration request, simulates some processing, and returns a welcome message.
- GameY: A basic Game engine which only chooses a random piece.
It acts as the entry point for users, providing the interface to interact with backend services such as the users service.
src/App.tsxThe main component of the application, responsible for routing and overall layout.package.json: Contains scripts to run, build, and preview the application.Dockerfile: Defines the Docker image for the user service.
The webapp is a single-page application (SPA) created with Vite and React.
src/App.tsx: The main component of the application.src/RegisterForm.tsx: The component that renders the user registration form.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 service is a simple REST API built with Node.js and Express.
users-service.js: The main file for the user service. It defines an endpoint/createuserto handle user creation.package.json: Contains scripts to start the service.Dockerfile: Defines the Docker image for the user 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 the Docker images for both the webapp and users services and start them.
2.Access the application:
- Web application: http://localhost
- Gateway service API: http://localhost:8000
- User service API: http://localhost:3000
- Gamey API: http://localhost:4000
To run the project locally without Docker, you will need to run each component in a separate terminal and a MongoDB running on port 27017 (MongoDB default port).
- Node.js and npm installed.
- Docker available if you run the end-to-end tests locally.
- A
JWT_SECRETvalue configured in the environment for local login flows. - On Windows, if
gameyfails withdlltool.exe: program not found, use the MSVC Rust toolchain or install the GNU binutils that providedlltool.exe. - An instance of MongoDB running on port 27017.
Navigate to the users directory:
cd usersInstall dependencies:
npm installRun the service:
npm startThe user service will be available at http://localhost:3000.
Navigate to the webapp directory:
cd webappInstall dependencies:
npm installRun the application:
npm run devThe web application will be available at http://localhost:5173.
At this moment the GameY application is not needed but once it is needed you should also start it from the command line.
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:services: Starts MongoDB andgameywith Docker Compose for end-to-end tests.npm run test:e2e: Starts MongoDB andgameywith Docker Compose, starts the app services, and runs the end-to-end tests.npm run test:e2e:run: Runs only the Cucumber end-to-end tests against already running services.npm run start:all: A convenience script to start thewebapp,users,gatewayservice, andgameyservices concurrently.
npm start: Starts the gateway service.npm test: Runs the tests for the service.
npm start: Starts the user service.npm test: Runs the tests for the service.
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 application