Git Product home page Git Product logo

arbnco_task's Introduction

Description

This Ruby on Rails application provides a solution for importing one or more .inp file extensions through a simple form.

When a file is uploaded, it’s created a background process to store its data in the database. After all of this process one email is sent to notify the user. The user can see attached a link with the stored data. It’s possible to download the file in the original .inp file too.

Deployed

This application was deployed, using Heroku at https://arbnco.herokuapp.com/.

Steps

To build this feature it was created a class called "UserSubmission” which contains the email and user files (stored with ActiveStorage). Validations were used to check the email format, presence, and the files content type.

After the upload is done, the ProcessFileWorker worker is triggered in background to store the file data.

To process the file is used the ProcessFile service class which handles file process in four steps:

  • Convert the file data to a text format using the InptToHash service. Its result allows data manipulation for the next step.
  • The Imports controller gets the parameters and stores the data, such as email and import fields (Import model).
  • The third stage transforms the raw data stored in imports into information in the ObjectItem table, where you can view the structured data.
  • Finally, the SendGridNotify email service is triggered to notify the user that the process has been completed.

Navigation

The visualization structure for the sent information has been created, and you can view it by clicking on "imports" in the navbar.

Navigation provides you with the ability to: View all completed imports, including information, email, and date.

In the "View All Imports" screen, you can click on "Show Import" to see the entire import, "Show Objects" to view all objects of that import, and also download the .inp file again.

In "Show Objects," you can see all objects and details of their properties in an organized manner. I believe that I have accomplished all the objectives set out for the test.

Notes

All the example files were tested (models, services, mailers and jobs)

The .inp files can be accessed at https://arbnco.herokuapp.com/imports/id.inp.

Bonus tasks done

  • Allowing the submission of multiple .inp files
  • Convert the stored database records to a .inp file again.

To run the application

rails s && bundle exec sidekiq -q default -e development

arbnco_task's People

Contributors

oswaldolinhares 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.