Giter Club home page Giter Club logo

mortgageapp's Introduction

MortgageApp - A mortgage calculator POC

This application is a POC to show the client the basics of the mortgage calculator application we've been discusing. The idea is to show the basic functionality just so we can review and see that we're on the right track.

The Architecture Decision Record (ADR) can be found here.

The Lessons Learned during this exercise can be found here

To build run ./build.sh

To run run ./run.sh

You must have Docker installed on your machine.

mortgageapp's People

Contributors

taylodl avatar

Watchers

 avatar

mortgageapp's Issues

Docker the Loan API

We need to package Flask and Docker the Loan API.

We won't map the Flask ports - we know it runs at 5000 and we can map it when we run the container.

Add a Data Tier

We need to add a data service to this application to store previously computed values. Since we're going to access this service via an API, we can implement the data store however we want for the POC. When we go to deliver the project to the client, we can figure out what to do with the data tier.

Meanwhile, we'll use memcached as our working implementation.

Implement Mortgage Calculator API function

The point is to get the basic functionality defined - not to create the service. We're looking to create the function.

The function has to have the following parameters:

  • Loan Amount (real number > 0)
  • Length of the loan in months (positive integer >= 1)
  • Loan's interest rate (real number > 0, interpret as the annual percentage rate)

What needs to be returned is the following:

[
"Loan Data" :
{ "Monthly Payment" : ,
" Payments" : ,
" Total Interest" :
"Total Loan Cost" : <Loan Amount + Total Interest>
},

"Payment Data": [
    {  "Month" : <monotonically increasing number starting with 1>,
       "Beginning Balance" :  <principle balance at the start of the month>,
       " Payment" : <payment to be made this month>, 
       " Principal" : <of the payment made this month, how much went to the principle>,
       "Interest" : <of the payment made this month, how much went to the interest>,
       "Ending Balance" : <should equal Beginning Balance - Payment>
    }
]

]

It should be clear that Payment = Principal + Interest, and the Ending Balance of the previous month is the Beginning Balance for the next month. Also, of course, we're going to have Payment Data for each month of the loan.

Ensure API is using the Data services

Right now the data services are implemented using a Python dictionary to cache the data, but that's okay because what we're after is the service interface. However, the API needs to use both store and retrieve so we need to ensure it's properly using the services.

Use Memcached

Would still like to use Memcached over a Python dictionary in the data tier. At this point we can argue the service interface is working and everything is working, but it would be nice to use something a little more robust.

The plan: add a Memcached container to the docker-compose network, expose port 11211, and utilize it from the Data service. Instead of using the Python dictionary.

Need to work with currency

Basic implementation works, but currency handling isn't quite where it should be

The monthly payment, monthly principle, and monthly interest should all be in currency = not floats. The numbers should add as expected. The client won't like numbers that don't add, not even for a POC.

Create UI

Need to create and Dockerize the UI. Since I'm not a "UI guy" - it's not my first love - the UI is going to look straight out of the 90's. Since it's a POC for the client this is appropriate. If we need to we can have a UX person add our standard CSS to make it look a little more modern and not so stark.

Right now though, focus on functionality.

Since we used Flask on the service tier and got it Dockerized, for expediency let's do the same thing on the UI tier. We can do this since this is a POC. If we get green lighted to move forward with this project then we'll re-do the UI in something appropriate such as React. In other words, don't spend too much time on the UI since it's a complete throwaway.

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.