This project is a full-stack application designed to automate loan decisions based on a person's credit modifier and requested loan attributes.
- Decision Logic: Calculates the maximum loan amount based on credit modifiers.
- Period Adjustment: If the requested amount is not available for the selected period, it automatically searches for an alternative period (12-60 months).
- Responsive UI: A modern frontend to interact with the decision engine.
Backend:
- Java 21 / Spring Boot
- Gradle as the build tool
- JUnit for unit testing
Frontend:
- Angular 21 for building the user interface
- TypeScript for type safety
- CSS3 for styling
- Vitest for unit testing
For this project, I chose Java 21 and Spring Boot for the backend due to their robustness, scalability, and extensive ecosystem. I actually had never worked with Spring Boot before, but I had planned to learn it and am familiar with Java, so it was a great opportunity to gain hands-on experience with a new framework while using my existing Java knowledge. I previously had experience with Angular, so I chose Angular 21 for the frontend to use my existing skills and ensure a smooth development process. During my academic studies, we has a course on web development where we used Angular alongside TypeORM, so I was already familiar with Angular's component-based architecture and TypeScript.
Java 21 is an LTS version, which ensures long-term support and stability for the backend. Angular 21 is the latest version. While I am familiar with some CSS frameworks (like Bootstrap), I opted for plain CSS because extensive styling was not a requirement for this project, and I wanted to keep the frontend simple and focused on functionality.
For the backend, I chose to separate the logic between the controller and the service layer to adhere to the Single Responsibility Principle. The controller handles HTTP requests and responses, while the service layer contains the business logic for loan decision-making. I also implement custom Exceptions to handle specific error cases, when a user is not found, to return a 404 status code. This is the only exception that I implemented, but in a real-world application, I would implement more specific exceptions to handle different error scenarios (invalid input, database errors, etc.) and return appropriate HTTP status codes.
"What is one thing you would improve about the take home assignment and how would you improve it?"
Currently, the mocked users are hardcoded in a switch case. In a real-world scenario, I would implement a database (like MySQL or PostgreSQL) to store user segments and debt status. As banking is sensitive, I would also implement proper authentication and authorization mechanisms to ensure that only authorized personnel can access the loan decision engine, with OAuth2. Additionally, I could implement logging and monitoring to track the performance and usage of the application. I would also add more tests, especially for the frontend, to ensure that all components and services are working as expected.
How to run the project:
-
Prerequisites:
- Ensure you have Java 21, Node.js (with npm), and Angular CLI installed on your machine.
- For the backend, you will need Gradle installed or you can use the Gradle wrapper included in the project.
-
Backend:
- Navigate to the
backdirectory. - Run
./gradlew bootRunto start the Spring Boot application. - The server starts on
http://localhost:8080.
- Navigate to the
-
Frontend:
- Navigate to the
frontdirectory. - Run
npm installto install dependencies. - Run
ng serveto start the Angular application. - The frontend will be available at
http://localhost:4200.
- Navigate to the
.
├── back/ # Spring Boot Application
├── front/ # Frontend Application
└── README.md # Project documentation