GithubHelp home page GithubHelp logo

legal_providers's Introduction

TA Tech Test

This is a very simple implementation of the test requirements in node.js

To install: cd to the folder containing this file and type npm install To run: run npm run server. The server runs on port 3000s

The app exposes two endpoints:

Individual records

/v1/provider/{id} - this extracts a single legal provider from the data.

http://localhost:3000/v1/provider/1 should return Moore-Watson

The app simply rejects out of range ids.

Filtered response

providers?{paramName}={paramValue} - the filters the entire list of providers using the keywords supplied as arguments. You can search using all the column names from the CSV: id, name, address1, city, postcode, phone, org_type, cat_crime, cat_debt, cat_housing, cat_immigration_or_asylum, cat_welfare_benefits

Cat values are either 0 or 1; all others must be exact

Notes on implementation

This is very bare bones and there are a lot of things missing that I would normally regard as essential. Error messaging is minimal and testing is crude.

Normally for this sort of API we would expect data to be stored in some sort of storage mechanism, either a KV store like Redis or a full database like Postgres. However as the data is very small and static I've chosen to load it into memory at start up instead. This keeps the implementation small.

Notes on dependency choices:

CSV is the only NPM CSV library with a synchronous parse and load; all others are stream based, which would have added a considerable layer of complexity to the code.

Express is my default HTTP framework. I considered HAPI but felt that learning a new framework (even if I would only need to know the next bit after 'Hello, world') was overkill.

legal_providers's People

Contributors

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