Giter Site home page Giter Site logo

datafeeder's Introduction

Coding Task โ€“ Data Feed

A command-line program, based on Laravel Zero.

Specifications

  • The program processes a local XML file and pushes the data of that XML file to a DB of choice.
  • Errors are logged to a file
  • Application is tested using PHPUnit

Installation

clone the git repository

git clone [email protected]:fahadbinashraf/datafeeder.git

Setting up the .env file

The database and logging configurations are done using the environment file

Copy the .env.example:

cp .env.example .env

Running with Docker

The application can be simply executed using docker-compose.

Prerequisites

  • docker
  • docker-compose

The XML data file (feed.xml)

The XML file by default should be placed in the /data/feed.xml which is used when running the docker container.

Running docker-compose

docker-comopse up --build

This will do the following:

  • build the environment
  • install composer dependencies
  • run database migration (to create the table)
  • run unit tests
  • run the import:products command

Without Docker

Make sure you have following installed:

  • PHP 8.1
  • Composer 2

Install dependencies:

composer install

Run database migrations:

php datafeeder migrate

Run tests:

php datafeeder test

Run the import command:

php datafeeder import:products /path/to/file.xml

License

MIT

datafeeder's People

Contributors

fahadbinashraf avatar

Watchers

James Cloos avatar  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.