This project is small adaption of credit application service made using spring boot REST API standards.
- Customers can create,delete or update their account. Application must obey these critiries.
- Customers with creditscore lower than 500 is rejected.
- Creditscore higher than 500 approved.
- creditscore under 1000 and income lower than 5000 get 10000 TL limit
- under 1000 and income higher than 5000 gets 20000 TL limit
- upper 1000 get special 4 times of thir income in TL limit.
- Application can only searched by national ID.
- Java (Programming Language)
- Spring Boot (Application Platform)
- Spring Data JPA (Data persistence)
- Hibernate
- PostgreSQL
- Swagger
- JUnit, Mockito (Unit Testing)
- Docker
- JSON Web Token (Spring security)
- Mapstruct
- SLF4J
The project follow monolitic layered architecture by Model ,Service, Repository, Controller approach
- Configs
- Security
- Swagger
- Controllers
- Exceptions
- Models
- Entities
- enums
- requestDTOs
- ResponseDTOs
- Mappers
- Services
- Security
- Repositories
There are User , Customer and CreditApplication controller
Sign in and sign up endpoint return bearer token which required to reach other endpoints
| Type | Method |
|---|---|
| POST | localhost:8050/users/signin |
Then sign in with the following credentials:
{
"username": "admin-user",
"password": "pass1234"
}
Create new customer
| Type | Method |
|---|---|
| POST | localhost:8050/v1/customer |
Request body
{
"nationalId": "22554885544",
"firstName": "Fevzi",
"lastName": "Yuksel",
"monthlyIncome": 10000.0,
"gender": "MALE",
"age": 26,
"phoneNo": "+905312513462",
"email": "fevziyuksel1996@gmail.com"
}
Then create new application
| Type | Method |
|---|---|
| POST | localhost:8050/v1/application |
Request body
{
"nationalId": "22554885544"
}
Check user's applications
Then create new application
| Type | Method |
|---|---|
| GET | localhost:8050/v1/application/all/{22554885544} |
Other endpoints can be reached from this link
API documentation can be accessed via localhost:8050/swagger-ui/index.html
The source code can be checked out to your local and then build and run the application either from your IDE after importing to it as a maven project, or just from a command line. Follow these steps for the command-line option:
- Java 8
- Maven 3
- Git
- PostgreSQL
git clone https://github.com/FevziYuksel/Todeb-Patika-Java-Spring-Bootcamp-Credit-Score-Application-Project.git
mvn clean install
mvn spring-boot:run
The application will be available at the URL: Home.
First you need to uncomment this line in application.properties;
- spring.profiles.active=docker
Start Docker Engine in your machine.
Run mvn clean install.
Build executable jar file - mvn clean package
Run application on docker
docker compose up
Exposing the Costumer as a service to be used by another micro-service. Kafka Consumer Project. When Credit Application approved, credit will produce and send to consumer
Start Kafka-server and ZooKeeper after installing it on your machine
It doesn't work yet When receive the message throw Consumer exception. When receive the message throw Consumer exception.
Test cases for this project:
CreditApplicationControllerTest.java
You can run it either from:
- Command line
mvn test
-
Your IDE
Right click on this file and "Run As JUnit Testcase"
