A distributed implementation of the popular board game "Codenames" created as a group project for the Gdańsk University of Technology.
Codenames is a distributed game inspired by the popular board game "Codenames" (Tajniacy). This project is being developed as part of a group project for the Gdańsk University of Technology. The current version includes both a frontend (React with TypeScript) and a backend (Spring Boot) that can communicate over a network to simulate the gameplay.
In the future, we plan to expand this application into a mobile version and possibly integrate with other platforms.
These instructions will help you get a copy of the project up and running on your local machine for development and testing purposes.
Before running the project, make sure you have the following installed:
- Docker - For containerization of both backend and frontend applications.
- Docker Compose - For running the applications locally using Docker.
Install Docker and Docker Compose if you haven't already:
https://www.docker.com/get-started
To get the project up and running locally, follow these steps:
- Clone the repository
git clone https://github.com/zuzqqa/codenames.git
cd codenames
-
Set up the .env file in the root directory to define necessary environment variables (see Environment Variables).
-
Set up the .env.local file in the
/codenames-frontend/
directory to define necessary environment variables (see Environment Variables). -
Set up the .env file in the
/codenames-backend/
directory to define necessary environment variables (see Environment Variables). -
Run the application using Docker Compose:
docker-compose up --build
The backend and frontend should now be running locally. You can access the frontend at http://localhost:5173 and the backend will be available through its API.
Currently, there are unit an integration tests for backend available.
To run the tests you can use this commands:
- for unit tests:
mvn test -Dtest="**/unitTests/*.java"
- for integration tests:
mvn test -Dtest="**/integrationTests/*.java"
To start the game, open the frontend application in your browser. The gameplay will be conducted between multiple players, with the game logic managed by the backend.
The most recent releases of the frontend and backend are available as Docker images on Docker Hub. You can find them under the following links:
- [Frontend Docker Image] (https://hub.docker.com/r/codenames/codenames-frontend)
- [Backend Docker Image] (https://hub.docker.com/r/codenames/codenames-backend)
In the future, we will deploy the application to cloud platforms such as AWS, Azure, or Google Cloud.
The following environment variables are required to run the project:
- SECRET: JWT secret key for token generation (needed for secure authentication).
- SPRING_MAIL_USERNAME: Username for sending emails.
- SPRING_MAIL_PASSWORD: Password for the mail account.
- MONGO_INITDB_ROOT_USERNAME: Root username for MongoDB initialization.
- MONGO_INITDB_ROOT_PASSWORD: Root password for MongoDB initialization.
- VITE_GOOGLE_CLIENT_ID: Google Client ID used to authorize users with Google OAuth 2.0.
- GOOGLE_CLIENT_ID: Google Client ID used to authorize users with Google OAuth 2.0.
- GOOGLE_CLIENT_SECRET: OAuth 2.0 key used to authorize and exchange tokens in the authorization processes using Google.
Create a .env
file in the root directory of the project and define these variables as follows:
SECRET=your_jwt_secret_key
SPRING_MAIL_USERNAME=your_email_username
SPRING_MAIL_PASSWORD=your_email_password
MONGO_INITDB_ROOT_USERNAME=your_mongo_root_username
MONGO_INITDB_ROOT_PASSWORD=your_mongo_root_password
Create a .env.local
file in the /codenames-frontend/
directory and define these variables as follows:
VITE_GOOGLE_CLIENT_ID=your_google_clientid
Create a .env
file in the /codenames-backend/
directory and define these variables as follows:
SECRET=your_jwt_secret_key
SPRING_MAIL_USERNAME=your_email_username
SPRING_MAIL_PASSWORD=your_email_password
MONGO_INITDB_ROOT_USERNAME=your_mongo_root_username
MONGO_INITDB_ROOT_PASSWORD=your_mongo_root_password
GOOGLE_CLIENT_ID=your_google_clientid
GOOGLE_CLIENT_SECRET=your_google_client_secret
Alternatively, you can set these variables directly in your system as environment variables.
- MongoDB - NoSQL Database
- Spring Boot - Backend Framework
- React - Frontend Framework
- Docker - Containerization
- Docker Compose - Multi-container Docker applications
- JUnit 5 - Testing framework for Java and the JVM
- Zuzanna Nowak - Project Lead
- Agata Domasik
- Adam Chabraszewski
- Jakub Walasik
See also the list of contributors who participated in this project.