This project is a fullstack application consisting of two main components: a Game Launcher backend developed in Spring Boot and a Back Office application developed in Node.js. Both applications share a PostgreSQL database and are containerized using Docker.
- Hexagonal Architecture: Implements a modular architecture that separates the core business logic from external components.
- Create a Session UUID: Generates a unique session UUID for each game launch.
- Persist Session Information: Saves relevant information about the session and the game to be launched in a PostgreSQL database.
- Redirect to Game URL: Redirects to a specified URL, injecting the created session UUID and the language parameter into the query parameters.
- Error Handling: Gracefully handles errors and returns appropriate HTTP status codes.
- Test Coverage: Achieves 90% test coverage using JUnit and Mockito for unit testing.
- Server-Side Rendering: Renders an HTML page listing all games and sessions launched on the current day.
- Data Display: Displays relevant data about the games launched.
- Responsive Design: Utilizes Bootstrap to ensure the interface is responsive and user-friendly.
- Pagination and Filtering: Provides server-side pagination and filtering functionality for efficient data management.
- Error Handling: Gracefully handles errors and returns appropriate HTTP status codes.
- Test Coverage: Includes unit tests with Jest for robust test coverage.
The project includes a docker-compose.yml
file that defines the services for the Spring Boot application, the Node.js application, and the PostgreSQL database.
-
Game Launcher (Spring Boot):
- Dockerfile located in the
gamelauncher
directory. - Uses Java 17.
- Runs on port 80.
- Dockerfile located in the
-
Back Office (Node.js):
- Dockerfile located in the
backoffice-assignment
directory. - Uses Node.js version 20.
- Runs on port 3000.
- Dockerfile located in the
-
PostgreSQL Database:
- Uses the official PostgreSQL image.
- Database name:
postgres
- User:
postgres
- Password:
postgres
- Runs on port 5432.
-
Clone the repository:
git clone git@github.com:victorpacheco3107/xciting-test-fullstack-dev-victor-pacheco.git cd xciting-test-fullstack-dev-victor-pacheco
-
Set up environment variables: Ensure you have a
.env
file at thebackoffice-assignment
folder with the following content:DB_USER=postgres DB_PASSWORD=postgres DB_HOST=postgres DB_NAME=postgres DB_PORT=5432 PORT=3000
-
Build and run the containers:
docker-compose up --build
Note: Ensure that the ports 80, 3000, and 5432 are not in use on your host machine before run this command.
- Access the applications:
- Game Launcher: http://localhost/play/{game-code}
- Back Office: http://localhost:3000/games
To stop the running containers, use the following command:
docker-compose down
- The Game Launcher API endpoint can be tested using tools like
curl
or Postman. - The Back Office application can be accessed via a web browser and provides a paginated, searchable view of the games launched on the current day.
- Ensure that Docker and Docker Compose are installed on your machine before running the setup commands.