Giter VIP home page Giter VIP logo

fullstack-dev-challenge's Introduction

Finimize Full-Stack Development Challenge

This repo is a response to Finimize's full-stack dev challenge!

Requirements

You will need node.js and yarn installed.

How to run

  1. Install dependencies by running yarn install.
  2. Run yarn start to start both, the API and the Client.
  3. Look at your browser.
  4. That's it! :)

How to test

  • Run yarn test from the root directory to run all tests (back-end + front-end)

Note: You can also run yarn test-client or yarn test-server to only run tests for a specific side of the application. Running cd client && yarn test will run all front-end tests in watch mode.

Deployment

  • This application can be easily deployed to AWS by running yarn deploy. This will bundle the whole app (server + client) using webpack and upload it to a lambda function. If everything goes as expected, the command will end by outputting logs with a live endpoint where the App can be accessed!

NOTE: To run yarn deploy, you will need to create an AWS account (if you don't have one already) and setup an AWS profile named playground.

THE END RESULT

If all goes well you should be able to have a working app that looks like this:

working app

client features

User input is debounced when it changes too quickly

debounce demo

User input is validated before requests are sent

input validation demo

Loading state for slow connections

loading demo

Handles errors and tells the user what's going on

error handling demo

server features

Fully fledged getProjections/ rpc endpoint:

  • Spec

    query param required type default must be
    initial_savings yes number - >= 0
    monthly_deposit yes number - >= 0
    start_year no integer 0 >= 0
    end_year no integer 50 >= start_year
    start_interest no integer 0 >= 0
    end_interest no integer 15 >= start_interest
  • Response type:

type ResponseBody = {
    projections?: {
        [interestRatePercentage: number]: {
            [year: number]: number
        }
    }
    errors?: Array<{
        value: string
        msg: string
        param: string
        location: string
    }>
}
  • Example 1 - valid response
const query =
    '/getProjections?initial_savings=1000&monthly_deposit=100&start_year=0&end_year=1&start_interest=0&end_interest=2'

const response = {
    projections: {
        0: {
            0: 1000,
            1: 2200,
        },
        1: {
            0: 1000,
            1: 2215.5612673489027,
        },
        2: {
            0: 1000,
            1: 2231.245696571609,
        },
    },
}
  • Example 2 - invalid request
const query = '/getProjections?initial_savings=1000&monthly_deposit=100&start_year=0.4'

const response = {
    errors: [
        {
            value: '0.4',
            msg: 'must be an integer',
            param: 'start_year',
            location: 'query',
        },
    ],
}

CREDITS

Thanks for reading!

fullstack-dev-challenge's People

Contributors

matt-dalton avatar neezurft avatar

Watchers

James Cloos 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.