- In root folder run
docker-compose up
in terminal - Load app from browser
localhost:45000/bla
Dockerized app consisting of,
- bla-web (frontend)
- bla-api (backend)
- provider-xero (application-software-1)
- provider-myob (application-software-2)
- decision-engine
bla-web is the frontend of the application which uses Typescript + React JS. Used tailwind as app's CSS. Project is structured to group each components functionality.
Fronend running on port 45000
- Load
localhost:45000/bla
: Homepage loaded. Restful API calls will be initiated to backend to retrieve details of,
- Businesses - By making restful API to backend endpoint:
GET /businesses
- Loan providers - By making restful API to backend endpoint:
GET /providers
User can select business and provider from the dropdown list populated in homepage and provide loan amount and click on submit.
-
On form submit, app loads balance sheet in
localhost:45000/bla/review
Backend call to retrieve monthly profit data of the business with the selected provider. e.g:GET /balance?provider=MYOB&business=business_2
- Provider and business sent as query param -
On click of submit loan application, app loads in
localhost:45000/bla/loanResult
Backend call to retrieve approval status e.g:GET loanDecision?business=business_1&provider=MYOB&loanAmount=1400
- Provider, business and loan amount as query param
bla-api is the backend of the application which uses Typescript + Express JS. Backend interacts with other apps using RESTFul apis.
Project is structured in routes-controllers-services-model
Backend running on port 6060
Repository is mocked as model db
RESTful API endpoints in backend:
- Business
GET /businesses
- returns all business
- Providers
GET /providers
- returns all loan providers
- BalanceSheets
GET /balance?provider={provider}&business={business}
- Provider and business as query params. Api call returns the balance sheet of the business with respect to the loan provider
- LoanDecision
GET /loanDecision?business={business}&provider={provider}&loanAmount={loanAmount}
- Provider, business and loan amount query params. preAssessment percent and approval status
provider-xero app represents loan provider's backend. It is built using json-server to provide balance sheets for the different businesses.
provider-myob app represents loan provider's backend. It is built using json-server to provide balance sheets for the different businesses.
provider-xero app represents decision engine backend. API request from backend with loan pre-assessment field and business details are posted to the system and system returns the approval status.
- Unit tests for bl-api are added for controllers and services layer with 100% coverage.
Below services have been dockerized:
- bla-web
- bla-api
- provider-xero
- provider-MYOB
- decision-engine
docker-compose up
from the root folder will spin up the different applications within the project.