● Project documentation can be found by clicking here.
● Project also contains a user manual which can be found by clicking here.
This section describes the step-by-step process to install and configure the project, including the necessary tools, database setup, and configuration settings required to successfully run the application.
Before running the project, You need to have the following requirements:
- Installed Java 21 and Maven 4.0.0.
- Installed PostgreSQL.
- Installed IDE for running the app (Preferable: IntelliJ IDEA).
- Installed Postman or web version.
- Installed Git.
- Installed Kafka 3.1.0.
After You have installed all the requirements, You can start the installation process:
- Copy an SSH link from the repository.
- Open terminal and execute
git clone git@github.com:UnknownPug/MPBA-api.git. - Open the project folder in Your IDE.
Next, You need to set up the database:
1. Open the database in IntelliJ, click on "+" button.
2. Choose the datasource and then find and choose the PostgreSQL database.
3. Set the port (if port 5432 is already in use), username and password
to Your requirements and click "Apply".
After You have set up the database, open the src/main/resources/application.yml file and review the configuration.
If it does not meet your requirements, modify it accordingly:
-
Set the
server.portto8082, or to any other desired port for your web services. -
Update the
spring.datasource.usernameandspring.datasource.passwordwith the credentials you configured in your PostgreSQL database. -
Specify the
spring.datasource.urlasjdbc:postgresql://localhost:5432/postgresor as appropriate for your database setup. -
Configure the security settings by setting
spring.security.user.nameandspring.security.user.passwordto the appropriate values (default:postgres). -
Set
spring.kafka.bootstrap-serversto your server's IP address and port (default:localhost:9092). -
Enter the generated API key from the ExchangeRate-API in the
api.keyfield. -
For JWT security, set the
security.jwt.secret-keyto your desired secret and configuresecurity.jwt.expiration-timeas needed (default:3600000milliseconds).
To run the Kafka, You need to follow these steps:
- Open the installed folder of Kafka
cd {path to kafka folder}/bin. - Run Zookeeper:
zookeeper-server-start ../config/zookeeper.properties - Run Kafka server:
kafka-server-start ../config/server.properties- Run the Kafka console for reading events:
kafka-console-consumer --topic messages --from-beginning --bootstrap-server Your_ip:Your_portTo run the project, follow these steps:
-
Run Maven command:
mvn clean install(ormvn clean install -U). -
Run the project by executing
Application.javaclass.
Also in this application was used third-party APIs:
- Exchange Rate API for getting exchange rate currencies.
- REST Countries API for validation of existing countries.