Involved transaction: purchasing tickets
- Admin
- Admin_E
- User
- Turnstile/Embedded_system
The following guidelines illustrate how to set up the project concretely:
Run in the project command line:
docker-compose up -d
Once completed,
start the two created containers (kafka_kafka_1 and kafka_zookeeper_1)
docker start group04_final_project_kafka_1 group04_final_project_zookeeper_1
Two containers are necessary, each one with 2 databases respectively.
For creating these two containers,
execute the following command in the command line:
docker run --name login_traveler_container -p 54320:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=db_traveler -d postgres
and then
docker run --name ticketCatalogue_payment_container -p 54321:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=db_payment -d postgres
These four databases have the following names respectively:
-
Container login_traveler_container has the following two databases:
- postgres, on port 54320, that contains info regarding login service
- db_traveler, on port 54320, that contains info regarding traveler service
-
Container ticketCatalogue_payment_container has the following two databases:
- postgres, on port 54321, that contains info regarding ticket catalogue service
- db_payment, on port 54321, that contains info regarding payment service
Start the created containers with the following command:
docker start login_traveler_container ticketCatalogue_payment_container
In addition, to successfully run the app,
Add two new Datasources of type PostegreSQL in the IntelliJ project,
for each one username and password (should be postgres and postgres respectively) specified in:
- application-credentials.properties
- fields: spring.datasource.username and spring.datasource.password
- application.properties
- fields: spring.r2dbc.username and spring.r2dbc.password
and the host and port specified in
- spring.datasource.url of the application.properties ( should be localhost and 54320)
- spring.r2dbc.url of the application.properties (should be _ localhost_ and 54321)
-
LoginService server (DB: postgres on port 54320) on port 8081
-
TravelerService server (DB: db_traveler on port 54320) on port 8085
-
TicketCatalogueService server (DB: postgres on port 54321) on port 8082
-
PaymentService server (DB: db_payment on port 54321) on port 8083
-
EurekaService server on port 8761
-
GatewayService server on port 8761