Skip to content

zuzqqa/codenames

Repository files navigation

Project logo

Codenames - Distributed Game Project

Status issues - codenames GitHub Pull Requests GitHub tag License


A distributed implementation of the popular board game "Codenames" created as a group project for the Gdańsk University of Technology.

📝 Table of Contents

🧐 About

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.

🏁 Getting Started

These instructions will help you get a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

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

Installing

To get the project up and running locally, follow these steps:

  1. Clone the repository
git clone https://github.com/zuzqqa/codenames.git
cd codenames
  1. Set up the .env file in the root directory to define necessary environment variables (see Environment Variables).

  2. Set up the .env.local file in the /codenames-frontend/ directory to define necessary environment variables (see Environment Variables).

  3. Set up the .env file in the /codenames-backend/ directory to define necessary environment variables (see Environment Variables).

  4. 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.

🔧 Running the tests

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"

🎈 Usage

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.

🚀 Deployment

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:

In the future, we will deploy the application to cloud platforms such as AWS, Azure, or Google Cloud.

🌍 Environment Variables

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.

⛏️ Built Using

✍️ Authors

See also the list of contributors who participated in this project.

About

Multiplayer board game adaptation

Resources

Stars

Watchers

Forks

Contributors 5