Skip to content

Create an employee batch import and manage REST APIs

Notifications You must be signed in to change notification settings

abdallah-zaghloul/LBX-task

Repository files navigation

Laravel Logo

LBX Task Documentation

Live Demo

Please watch this video 👇

Live Demo

  • Please run "Truncate DB API" Firstly for a clean demo database

    Project Infra Structure

    • The Project is a Decoupled Modular Monolithic App : HMVC Modules (you can turn on/off each module and republish/reuse it at another project)

    • Module Structure (Repository Design Pattern)

    • Separated/Attached Tests

    Import Solution Implementation

    Preparation :
    - validate excel-sheet file memType and Extension
    - upload it at S3 Bucket with status = "Processing"
    ----------------
    Execution : 2 Background Job Queue Buses (groups)
    are chained in chunks (Read 1000 Record/ChunkedJob) :
    - Validator : validate records
    - Importer : Import records if the all the excel-sheet is Valid with ability 
                 to rollback in case of failure
    - Updates Url : show the updated status of file validation and importation
      so front end can utilize it with ajax to update the UI continuously
    ----------------
    * Recommendation :
     we can utilize after import and validation event-listener not only to
     update file status but also for send the user updates via email
    

    How To Run The Project Locally

    Requirements (all can be installed automatically using docker desktop):
    ---------------
    - PHP 8.2
    - Run Docker Desktop
    - MYSQL
    - SQL lite PHP Extension
    
    Run the following at the project root dir Terminal ---------------
    • Download Vendor folder composer install
    • Make Sail alias alias sail='[ -f sail ] && sh sail || sh vendor/bin/sail'
    • Generate .env file from .env.decrypted: php artisan env:decrypt --key="base64:IMQS06IFVHHEqYuLNYQRQ1XYEyEXUr57kNXqkpBIPlo="
    • Laravel Sail install php artisan sail:install
    • Make an alias for ./vendor/bin/sail: alias sail='[ -f sail ] && sh sail || sh vendor/bin/sail'
    • Make an alias for ./vendor/bin/sail: alias sail='[ -f sail ] && sh sail || sh vendor/bin/sail'
    • Run Your local server up: sail up -d
    • Run Your local server down: sail down
    • To Run Unit/Feature Tests but configure your test with xdebug php artisan test --testsuite=Employee

    if you have an issue you can see Laravel Sail

  • About

    Create an employee batch import and manage REST APIs

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published