/beanworks-accounts-payable

test during a challenge

Primary LanguageJavaScript

JavaScript Style Guide

Beanworks Accounts Payable module

This project was created during a code challenge, when I was asked to implement a system that reads some information from an external api (xero) and let Vendors and Accounts list available for download.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

What things you need to install the software and how to install them

Node.js (version 8.11)
Create a free Xero developer account (xero.com) and load it with their sample data/create a sample company. 

Installing

First and foremost, clone this repository into your local environment

git clone git@github.com:xumes/beanworks-accounts-payable.git

And then, install the dependencies

cd beanworks-accounts-payable
npm install

You can replace the Xero credentials using yours at:

/config/config.json

Make sure you have created a public application, and just replace the consumerKey and consumerSecret values.

The application is ready for use. You can run the tests or skip for the next section.

Running the tests

The application follows the JavaScript Standard Style: JavaScript Style Guide You can validate it running:

npm test

Running the application locally

In order to run the application locally, trigger the script dev. It will run in parallel the scripts server (backend) and client (frontend)

npm run dev

How does the application works

The application runs on localhost port 3000:

http://localhost:3000

The landpage welcomes and invites you to connect to the Xero account and give access to the application.

Next, the application is redirected to the Xero website and asks for your credentials (must be the same where you created the public application described on the prerequisites on this README)

After insert your credentials and click on Login, select the organisation (It is recommended to use the Demo Company).

You will see the Taking you back to screen, hold on for a moment.

The Home Page application is loaded. A few information about the Demo Company is displayed for reference, like its address, phone number and a few finance information.

The two cards displayed at the bottom directs you to the subject area where yu can see or download the information: Vendors or Accounts

By clicking on Vendors the following page is displayed:

By clicking on Accounts the following page is displayed:

On both pages, clicking on Download button the excel file is generated:

Deployment

The application is production ready. In order to start the deployment process, run the beforeInstall process and the minified bundle is created:

npm run beforeInstall

Check the result on '/dist' folder

Built With

  • Node.js - The web framework used on Backend
  • React - The web framework used on Frontend
  • Redux - Used for state controlling
  • Redux Promise - Used to work with async flow on Redux
  • Xero - Used to integrate the app with Xero

Author

  • Reginaldo Marcelo dos Santos - developer