The game is implemented as an example of scalable and high load architecture combined with modern software development practices

Overview

Crossword game

Build Status Scrutinizer Code Quality Code Intelligence Status Code Coverage License Minimum PHP Version

The game is implemented as an example of scalable and high load architecture combined with modern software development practices

Examples

image

Project structure

Packaging approach Branch HEAD
By features feature/package-by-feature master
By layers feature/package-by-layer

Architecture

RabbitMQ - need for handling commands and events asynchronous via the Symfony Messenger component.

Elasticsearch - used as storage for dictionary with 10,000 english and 10,000 russian words from the box.

Redis - used as a cache for generated crosswords.

SQLite - used as the main storage for player data and his game history.

image

Microservices

To simplify the development and sharing of code, the Monorepository code storage approach was chosen. Each module of the system is independents, and they can be separated like an independent microservice and communicate by API.

Port and Adapters

To integrate existing, or a new modules applied solutions like the Port and Adapters pattern.

Ports are represented by Interfaces - {modue}\Domain\Port

These implementations will be the adapter - {modue}\Infrastructure\Adapter:

  • ApiAdapter - used to API communicate with another module
  • DirectAdapter - used to direct communicate with another module
  • InMemoryAdapter - used to mock module in teh tests

Layered

To make the code organised each module uses Layered Architecture and each functional area is divided on four layers:

  • Application
  • Doman
  • Infrastructure
  • UI

Switch to check it feature/package-by-layer

👍 Checked by Deptrac

ADR

Action Domain Responder organizes a single user interface interaction between an HTTP client and a HTTP server-side application into three distinct roles.

DDD

Domain-driven design is not a technology or a methodology. It is a way of thinking and a set of priorities, aimed at accelerating software projects that have to deal with complicated domains.

On a macro level using DDD concepts like Ubiquitous Language and Bounded Contexts can solve complex perspectives on data in to smaller models and clear data ownership. Follow practices splitting the source code based on bounded contexts we define a next context:

For reducing duplication of code we use a SharedKernel, it helps share a common code between context.

Docker

The docker-compose up command aggregates and run each container.

docker network create game

make start

Open in browser

https://app.test:1001/game/play

image

Swagger

Swagger help to describe the structure of APIs for better understand how is it works.

👍 URL: /swagger

Postman

Сollections with queries can be found: cd /postman

👍 Checked by Newman

CI

Stack

  • PHP 8.0
  • Symfony 5.2
  • Elasticsearch
  • RabbitMQ
  • Redis
  • SQLite

Clean code support packages

  • phpunit
  • phpcs
  • psalm
  • rector
  • phpcs-calisthenics-rules
  • newman
  • deptrac

Resources

Author

Dykyi Roman, e-mail: [email protected]

You might also like...
An utility component for XML usage and best practices in PHP

An utility component for XML usage and best practices in PHP

Learn to apply best practices as a PHP backend developer

PHP eCommerce Project Here are the things that this repo will cover: Object oriented programming principles and best practices Object oriented session

A Magento 1.x module which facilitates automatic purging of static assets from HTTP caches such as browser cache, CDN, Varnish, etc using best practices outlined within the HTML5 boilerplate community.

Magento Cachebuster Cachebuster is a Magento module which facilitates automatic purging of static assets from HTTP caches such as browser cache, CDN,

A cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.

Motan Overview Motan is a cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services. Related

software development kit for purwantara.id payment gateway
software development kit for purwantara.id payment gateway

PURWANTARA LARAVEL ✨ What is Purwantara? Purwantara is a digital payment service provider that helps businesses to accept digital payments with seamle

This is a port of the original WireGuard UI bits as implemented by Netgate in pfSense 2.5.0 to a package suitable for rapid iteration and more frequent updating on future releases of pfSense.

This is a port of the original WireGuard*** UI bits as implemented by Netgate in pfSense 2.5.0 to a package suitable for sideloading and more frequent updating on future releases of pfSense. This also includes some improvments such as a proper status page (found under Status / WireGuard Status) and improved assigned interface handling.

Exploiting and fixing security vulnerabilities of an old version of E-Class. Project implemented as part of the class YS13 Cyber-Security.

Open eClass 2.3 Development of XSS, CSRF, SQLi, RFI attacks/defences of an older,vulnerable version of eclass. Project implemented as part of the clas

 Scalable and durable data imports for publishing and consuming APIs
Scalable and durable data imports for publishing and consuming APIs

Porter Scalable and durable data imports for publishing and consuming APIs Porter is the all-purpose PHP data importer. She fetches data from anywhere

Examples of some common design patterns implemented in php

What is a Design Pattern? Design patterns are typical solutions to common problems in software design. Each pattern is like a blueprint that you can c

Owner
Roman
PHP Software Engineer
Roman
The Lucid Architecture for Scalable Laravel Applications.

Website: https://lucidarch.dev Documentation: https://docs.lucidarch.dev Social: we share updates & interesting content from the web Twitter: @lucid_a

Lucid 256 Dec 25, 2022
FFCMS 3 version core MVC architecture. Build-on use with ffcms main architecture builder.

FFCMS 3 version core MVC architecture. Build-on use with ffcms main architecture builder.

FFCMS 0 Feb 25, 2022
Tars is a high-performance RPC framework based on name service and Tars protocol, also integrated administration platform, and implemented hosting-service via flexible schedule.

TARS - A Linux Foundation Project TARS Foundation Official Website TARS Project Official Website WeChat Group: TARS01 WeChat Offical Account: TarsClou

THE TARS FOUNDATION PROJECTS 9.6k Jan 1, 2023
A simple but scalable FFA Practice Core featuring one Game Mode & Vasar PvP aspects.

A simple but scalable FFA Practice Core featuring one Game Mode & Vasar PvP aspects. An example of this Plugin can be found in-game at ganja.bet:19132!

null 6 Dec 7, 2022
Laravel boilerplate with the best development practices.

Laravel Boilerplate Introduction ?? Welcome to Laravel Init - a boilerplate for installing laravel application. It covers: One-liner shell script to s

ColoredCow 7 Dec 29, 2021
my personal example of Laravel clean architecture

what is this repo about Clean Architect Laravel ###run we assume docker desktop is up and running open up a terminal cd project directory run "cp .env

Sadegh Salari 37 Dec 23, 2022
PPM is a process manager, supercharger and load balancer for modern PHP applications.

PPM - PHP Process Manager PHP-PM is a process manager, supercharger and load balancer for PHP applications. It's based on ReactPHP and works best with

PPM - PHP Process Manager 6.5k Jan 3, 2023
Roach-example-project - Example project to demonstrate how to use RoachPHP in a Laravel project.

Example repository to illustrate how to use roach-php/laravel in a Laravel app. Check app/Spiders/FussballdatenSpider.php for an example spider that c

Kai Sassnowski 11 Dec 15, 2022
Leaf's very own high-speed, high-performance server

[WIP] Leaf Eien Server Eien is Leaf's implementation of a high-speed, high-performance server based on powerful tools like Open Swoole and Swoole. Eie

Leaf Framework 8 Dec 28, 2022
🎓 Collection of useful PHP frequently asked questions, articles and best practices

PHP.earth documentation These files are available online at PHP.earth. Contributing and license We are always looking forward to see your contribution

PHP.earth 278 Dec 27, 2022