/cricketscoreandstats

Laravel - Cricket Score and Statistics

Primary LanguagePHP

Insider Project - Cricket Score and Statistics

Requirement Specifications

  • It contains tournaments.
  • Tournaments have multiple rounds (qualifier, semi-final, etc).
  • Rounds have matches.
  • Match is played between two teams.
  • Match Time Unit can be modified (e.g. Five seconds after the match starts 1 minute will be considered gone by.)
  • Match has multiple innings.
  • Innings belong to a team and match, and consists of runs scored by that team and team's wickets fallen.
  • Team has many players, but particular team players play in a single match, and are called "match_participants".
  • Players' batting and bowling stats are also calculated.

Installation

Environmental setup

Project setup

  • Create a file named .env and copy .env.example to it. Modify database connection details as per environment. Modify server settings in that file too.
  • Create a virtual host with any port available, pointing to public directory of the project.
  • Go to project directory and run database migration with php artisan migrate
  • Run php artisan db:seed for all data migrations

Run

Technical details

How it is developed.

  • First, a laravel basic skeleton is being created.
  • The requirement document is studied, and entities and its value objects are being drafted on paper.
  • Then database migrations are written in folder database/migrations
  • Models are created and placed in app/Domain/
  • Sample data is being input in database/seeds/DatabaseSeeder.php
  • Controllers are being namespaced in respective entity (using ADR pattern)
  • Flow of web call (route -> Controller -> Service -> Model -> Service -> Controller -> View )

Result Screenshot

Please see following screenshot - Result of Innigs Stats for the match ( https://ibb.co/swxxjQ3 )