taylodl / mortgageapp Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
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.
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.
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.
The service will be invoked via a GET request using the following query parameters:
?months=
?amount=
?apr=
Use Flask
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.
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:
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.
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.
Make it so all anyone has to do is build.sh and run.sh the application after cloning from the repository
Need to Dockerize the UI
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.