This project is written in Node.js with TypeScript, using Angular.js framework for the frontend, with Java Spring Boot framework for the backend, and SQLite for lightweight database storage due to the small scale of the project.
The frontend app will run on http://localhost:4200
and backend app on http://localhost:8080
. Please ensure that these two ports are free.
Instructions on how to log in the app can be found here.
- Pre-requisites
- Setup Guide (Local)
- Login Information
- API Documentation
- Cross-Origin Resource Sharing (CORS)
As the frontend is built with Angular.js, you must have Node.js installed on your device to be able to run it. A quick way to get started is to directly install Node.js on your system. You may download the installer here.
However, it is strongly recommended to use a Node version manager such as nvm to install Node.js and npm. You may read more about it here.
The backend is built with Java Spring Boot with Java 17, hence it is necessary to install the JDK on your device so that you can start the Spring Boot application without compatibility issues.
You may download it here.
If this is your first time running this project, you will be required to install the Node dependencies for the frontend Angular.js project.
You may can enter npm ci
into the terminal in ./frontend
folder. This will step will install all necessary dependencies based on the ./frontend/package-lock.json
. This process may take awhile.
To simplify this step, you may run the following batch script:
.\setup-npm.bat
A batch script has been created for your convenience in starting up both the frontend and backend application.
.\run.bat
NOTE: Amend the
JAVA_HOME
in this batch script to the Java JDK 17 directory on your device.
Alternatively, you may start the frontend app by entering npm start
into the terminal from ./frontend
folder, and entering mvnw spring-boot:run
into the terminal from ./backend
folder.
For demonstration purposes, any combination of username and password can be used to access the banking system. However, empty username and password fields are not allowed.
This API supports JSON format. Please ensure request body is in a Content-Type: application/json
format.
POST /create/creditFacility
{
"applicantId": Integer
}
Parameter | Type | Description |
---|---|---|
applicantId |
Integer |
Required. Applicant object ID. |
// Valid Request Response
true
// Invalid Request Response
false
POST /create/loan
{
"amount": Double,
"type": String,
"creditId": Integer
}
Parameter | Type | Description |
---|---|---|
amount |
Double or Decimal |
Required. Loan amount. |
type |
String |
Required. Loan type: Home or Car |
creditId |
Integer |
Required. Credit facility object ID. |
// Valid Request Response
true
// Invalid Request Response
false
GET /get/loan/all/:applicantId
Parameter | Type | Description |
---|---|---|
:applicantId |
Integer |
Required. To retrieve all loans made by an applicant based on the applicantId . |
// Valid Request Response
[
{
loanId: Integer,
amount: Double,
type: String,
status: String,
creditId: Integer,
},
...
];
// Invalid Request Response
null
GET /get/applicant/all
// Valid Request Response
[
{
"applicantId": Integer,
"nric": String,
"firstName": String,
"lastName": String
},
...
];
// Invalid Request Response
null
GET /get/credit-facility/all
// Valid Request Response
[
{
"creditId": Integer,
"applicantId": Integer,
"applicant": {
"applicantId": Integer,
"nric": String,
"firstName": String,
"lastName": String
}
},
...
];
// Invalid Request Response
null
Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources on a web page to be requested from another domain outside the domain from which the first resource was served.
By default, the frontend app do not have access toi the API endpoints, thus CORS is granted on the backend app for the frontend host and port of http://localhost:4200
.