Skip to content

This is a very basic utility page to show financial transactions.

Notifications You must be signed in to change notification settings

mortonprod/glabs

Repository files navigation

Glab

The app will convert XML files to JSON and store this to a mongodb. The app uses xml2js to convert the XML. This is relatively agnostic about the format of the xml. Therefore any information stored as xml can be transformed.

The app allows the output json to be formatted before storing which allows you to easily extend the app without having to rewrite code again and again.

The XML files can be from an s3 bucket or saved locally on the server.

At the moment it only automatically uses a local store but access to s3 is provided.

The app manages the xml files to ensure we have a complete list of all files from all sources. It also keeps a record of the files processed so we don't lose track of what files need attention.

The conversion is viewed through a UI rendered by jade(pug).

A submit form has not been added but the backend API route has been added.

Building

You will need the repository:

git clone https://github.com/mortonprod/glabs .

Then you will need to install the npm packages:

npm install

The app is built with typescript so to transpile you will need to run

npm run build

which will create the dist folder.

Documentation

To build the documentation and server it to your browser run:

npm run docs

Then go to: https://localhost:3001/

ServerDocs.js is the node server which will serve the static documentation assets.

Deployment with docker

The app had been deployed through a digital ocean droplet with the database on a docker volume.

If you want to run the docker droplet build:

npm run docker:build

then run in detach mode with:

npm run docker:start

You can then see this running at https://localhost:3001/. Make sure to kill this afterwards using:

docker stop <Your process ID>

If you would like to see this running from digital ocean go to https://glabs.services

Deployment without docker

If you want to run this on your local machine you will need to have mongodb installed and then run

npm run start:db

to start the database.

You can then start your app from another terminal after building it with:

npm run start

Test

Note when you run the tests the databases will reset by removing all the old collections

The keys provided are for access to s3 only

Need to start your local version of mongodb. When this is done run:

npm run start:db
npm run test

The tests only cover the converter and xmlManager since they are the most complicated parts of the app.

Components

Converter