Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/maciekiwaniuk/snake-monorepo

🐍 Web application made in PHP with Laravel where you can interact via API with my Snake game which is made in Python
https://github.com/maciekiwaniuk/snake-monorepo

bootstrap-icons bootstrap5 css datatables dropify jquery js-cookie laravel8 mysql php7 progressive-web-app redis rest-api testing toastr web-app

Last synced: 23 days ago
JSON representation

🐍 Web application made in PHP with Laravel where you can interact via API with my Snake game which is made in Python

Awesome Lists containing this project

README

        

# Snake monorepo ![](https://github.com/maciekiwaniuk/snake-monorepo/blob/main/readme/icon.png?raw=true)

## Commands using Make

Initialize for first time run

make initialize

Run containers

make run

Seed database

make db_seed

Run all tests

make test

## Commands without Make

Initialize for first time run

docker-compose up -d
docker-compose exec php composer install
npm install
npm run dev
docker-compose exec php cp .env.example .env
docker-compose exec php php artisan key:generate
docker-compose exec php php artisan storage:link
docker-compose exec php php artisan migrate

#### For other commands check content of Makefile

# Captcha validation

To enable captcha validation you need to set public and private keys in .env file and set CAPTCHA_VALIDATION_ENABLED to true

CAPTCHA_VALIDATION_ENABLED=true

# E-mail service

To enable e-mail service and send e-mails properly you need to fill all necessary variables related with prefix MAIL_ in .env and after that set MAIL_SERVICE_ENABLED to true

MAIL_SERVICE_ENABLED=true

You have to also run queue:work command to set up queue system

php artisan queue:work

# PWA cache service

In case of any problems with PWA caching, you can easily disable PWA caching system via set PWA_SERVICE_WORKER_ENABLED to false in .env file

PWA_SERVICE_WORKER_ENABLED=false

# Application usage

Every account generated by db:seed command has same password except one with administrative permissions

password: test1234

To log into account with administrative permissions use

email: [email protected]

password: admin1234

To log into account with normal permissions use

email: [email protected]

password: test1234

# Web application appearance

![](https://github.com/maciekiwaniuk/snake-monorepo/raw/main/readme/gifs/gif_web_1.gif)
![](https://github.com/maciekiwaniuk/snake-monorepo/raw/main/readme/gifs/gif_web_2.gif)
![](https://github.com/maciekiwaniuk/snake-monorepo/raw/main/readme/gifs/gif_web_3.gif)

# Snake game ![](https://github.com/maciekiwaniuk/monorepo/blob/main/images/icon.png?raw=true)

> ### Project of the game which interacts via API with the web application that handles necessary stuff related with storing data.

- Application is made in [python](https://www.python.org/downloads/).
- To create login panel is used [PyQt5 Framework](https://pypi.org/project/PyQt5/).
- Game application is made with [pygame library](https://getbootstrap.com/docs/5.1/getting-started/introduction/).
- Properly configured [web application](https://github.com/maciekiwaniuk/snake-monorepo) is required to process the data.

# Installation

To successfully install application you need to have installed [python](https://www.python.org/downloads/), [pip](https://pypi.org/project/pip/) and properly configured web application which is available to get from [this repository](https://github.com/maciekiwaniuk/snake-monorepo).

Open folder where you want to have project files, open console and then clone the repository

git clone https://github.com/maciekiwaniuk/snake-monorepo

Change folder in console to created folder with project files

cd snake-monorepo

Install all the required modules using pip

pip install -r requirements.txt

Copy the env_example.py file and make the required configuration changes in the env.py file

copy env_example.py env.py

Configuration variables should be the same as in the .env in web application

SECRET_GAME_KEY = "example_secret_game_key"
VERSION = "example_game_version_1.0"
URL = "http://127.0.0.1:8000"

Run application

py main.py

# Application usage

To log into game you need to use account from configured web application. Example data from seeded database

email: [email protected]

password: admin1234

# Application appearance

![](https://github.com/maciekiwaniuk/snake-monorepo/raw/main/readme/gifs/gif_desktop_1.gif)
![](https://github.com/maciekiwaniuk/snake-monorepo/raw/main/readme/gifs/gif_desktop_2.gif)