/MovieGame

Movie Game - Symfony 5.4 / React 18.2

Primary LanguagePHPMIT LicenseMIT

MovieGame Project

A cinematographic culture test game.

Purpose

Assess knowledge and practical application of JavaScript ES6 and PHP 8.1 programming languages and architectures with moderns frameworks such as Symfony 5.4 LTS and React 18.2.

Requirement

The compose V2 command is a docker sub command.
Basically, you can run Compose V2 using docker compose, instead of docker-compose.

Get started

  1. Run git clone git@github.com:ptim4x/MovieGame.git to download this project.
  2. Run cd MovieGame to change current directory.

Next steps with make

  1. Run make install.prod to build fresh Docker images and build front prod assets.
  2. Run make run to start the Docker containers.
  3. Run make game.data setsize=100 to fetch TMDB API and generate 100 game question set.
  4. Open https://localhost:4443 in your favorite web browser, accept the auto-generated TLS certificate and enjoy playing.
  5. Run make clean to stop and remove the Docker containers.

Next steps without make

  1. Run docker compose build --no-cache to build fresh images.
  2. Run docker compose -f docker-compose.builder.yml run --rm install to install node packages.
  3. Run docker compose -f docker-compose.builder.yml run --rm build to build front assets.
  4. Run HTTP_PORT=8000 HTTPS_PORT=4443 docker compose up -d to start the Docker containers.
  5. Run docker compose exec php php bin/console app:data:load 100 --themoviedb to fetch TMDB API and generate 100 game question set.
  6. Open https://localhost:4443 in your favorite web browser, accept the auto-generated TLS certificate and enjoy playing.
  7. Run docker compose down --remove-orphans to stop and remove the Docker containers.

Game play

Rules

Within a given time (60 seconds), the game has several rounds with an actor and a movie poster for each.
The player must say if the actor played in the film presented or not.
The game ends at the end of the allotted time or at the first error, and gives the score to the user.
He has the possibility of replaying to try to beat his best score.

Keyboard shortcut

  • Play button : Space or Enter
  • Answer buttons : Left arrow = Yes / Right arrow = No

Utils

  • PostgreSql Database : available on port 54321 in dev environement
  • Run docker-compose exec database psql -U meatloaf -d game -c "TRUNCATE TABLE question; TRUNCATE TABLE answer CASCADE; TRUNCATE TABLE answer CASCADE; TRUNCATE TABLE movie CASCADE;" to truncate all tables.

ChangeLog

  • v0.1 : First working version.

  • v0.2 : Improve react-ivity beetween rounds by preloading images.

  • v0.3 (in progress) : Add Redis storage implementation in replacement of doctrine, 3 ways redis support will be implemented :

      1. Predis client service=done
      2. Symfony cache contracts=in progress
      3. PSR6=in progress
    

Credits

Made with love and sleepless nights by Maxime Brignon