Git Product home page Git Product logo

family-tree's Introduction

Installation

I have used Laravel Sail (Docker) while working on this code. Coding has been done with TDD of the methods implemented for adding person or spouse.

Setup (for Mac or Windows):

  • Clone the repo in your local.
  • Paste the .env file from the email into the project's root directory.
  • Install the composer dependencies:
docker run --rm \
    -u "$(id -u):$(id -g)" \
    -v $(pwd):/var/www/html \
    -w /var/www/html \
    laravelsail/php81-composer:latest \
    composer install --ignore-platform-reqs
  • On the Terminal inside the project directory run the following:

sail up -d [Make sure docker is installed and running] or ./vendor/bin/sail up -d (if sail is not set as an alias)

Seeding

Family tree data of King Arthur & Queen Margret has been added to a seed file (FamilyTreeSeeder) which will be used to initialize the basic family tree to work with.

sail artisan migrate --seed

This will install and boot up all necessary packages to run the application along with the PHPUnit Test Suit.

Testing

Unit tests have been implement to test the critical functions of the Person class. To run the test suit simply execute the below command:

sail test

Database for Tests is called 'testing' where all the test operations are executed and its separate from the apps main database which is named as family_tree. (All automatically setup when running the sail up -d command)

Test Coverage

sail test --coverage (xDebug is already enabled in .env for this feature to work)

Current code coverage for the test suit is 73.1%

Input file & output

Please add the inputfile.txt into storage/app directory (sending in email).

I have added a console command to process this file and give an output on console.

sail artisan FamilyTree:run

Notes

There can be some refactoring and additional functionaly added to make the code more robust. I have tried to just cover the basics here.

family-tree's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.