Coder Social home page Coder Social logo

mercyoseni / spree-test-task Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 327 KB

Spree Commerce Test Task to add a feature that will let admins upload products to the Spree database from a .csv file

Ruby 37.16% JavaScript 2.97% CSS 0.11% HTML 59.77%
spree spree-ecommerce ruby-on-rails spree-commerce sidekiq

spree-test-task's Introduction

Spree Test Task

  • Spree Commerce Test Task to add a feature that will let admins upload products to the Spree database from a .csv file

Getting Started

  • Clone this repo git clone https://github.com/mercyoseni/spree-test-task.git

  • Install the gem dependencies bundle install

  • To setup database and run migrations rails db:setup

  • To load seed data, run bundle exec rake spree_sample:load

  • To run the app (use different tabs):

    • run redis-server to start Redis (You can install using brew install redis)
    • run rails s to start the server
    • run bundle exec sidekiq to run Sidekiq

Import Products CSV

  • Here is the sample.csv file to import products.
    ;name;description;price;availability_date;slug;stock_total;category
    ;Ruby on Rails Bag;Animi officia aut amet molestiae atque excepturi. Placeat est cum occaecati molestiae quia. Ut soluta ipsum doloremque perferendis eligendi voluptas voluptatum.;22,99;2017-12-04T14:55:22.913Z;ruby-on-rails-bag;15;Bags
    ;Spree Bag;Rerum quaerat autem non nihil quo laborum aut hic. Iure adipisci neque eum qui dolor. Velit sed molestias nostrum et dolore. Amet sed repellendus quod et ad.;25,99;2017-12-04T14:55:22.913Z;spree-bag;5;Bags
    ;Spree Tote;Consequuntur quibusdam repellendus quia non. Iste et pariatur nulla fugit. In ipsum accusantium quasi mollitia et eos. Ullam veniam quis ut adipisci est autem molestiae eos. Ab necessitatibus et rerum quasi quia debitis eum.;14,99;2017-12-30T14:55:22.913Z;spree-tote;20;Bags
    

Screenshots:

Upload Product CSV modal

Screenshot 2019-06-23 at 7 49 32 PM

The modal requires a file before submission

Screenshot 2019-06-23 at 7 55 14 PM (2)

When an Admin bypasses the frontend validation and submit, the page displays the related error message

Screenshot 2019-06-23 at 7 56 37 PM (2)

Product Import Report Page

While the background job is running

Screenshot 2019-06-24 at 4 37 35 AM (2)

After the background job is completed

Screenshot 2019-06-24 at 4 37 45 AM (2)

Tests

  • To run the tests, run rspec spec

Reference

spree-test-task's People

Contributors

dependabot[bot] avatar mercyoseni avatar

Stargazers

 avatar

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.