The app allows user to view all the phones, and book a phones that are available. The app will send a notification to the user that the phone is booked successfully together with a link to return the phone he booked.
Pre-requisites:
- Java version 21(Azul-zulu)
- Docker
- Docker Compose
- Clone the repository
git clone git@github.com:rshtishi/mobile-rent-infrastructure.git
- Go to the project directory
cd mobile-rent-infrastructure
- Build the project with the following command
# For Unix
./mvnw install
#For Windows
mvnw.cmd install
- Run the following docker compose command
docker-compose up
- While waiting the docker compose to finish, go to the browser and paste the following url: https://mailtrap.io/signin, and login with the following credentials:
account mailtrap.io: bt-test-x@proton.me
password: 12345678
- Go to the
Inboxes->My Inbox
and you will see the email that was sent by the app. - Create a new tab and paste the following url: http://localhost:4200/home
- You will see the home page of the app. You can view the phones and book a phone that is available.
- Angular for developing the web app
- Spring Boot for developing the mobile rent service and the notification service
- Docker for containerizing the app
- Mysql for the database
- RabbitMQ for the messaging service between services
We have the web app that is used by user all over the worlds that includes the following services:
- Mobile Rent Service: This service is responsible for managing the phones and the bookings. It exposes a REST API that is used by the web app to view the phones and book a phone.
- Notification Service: This service is responsible for sending the email to the user that the phone is booked successfully. It listens to the RabbitMQ queue and sends the email.
- RabbitMQ: This is the messaging service that is used by the Mobile Rent Service to send a message to the Notification Service that the phone is booked successfully.
- Mysql: This is the database that is used by the Mobile Rent Service to store the phones and the bookings.
- Web App: This is the web app that is used by the user to view the phones and book a phone.
We have also the Mobile Rent CLI that is developed to run in single machine and is used to manage the phones and the bookings.
The app provides a CLI that is used to manage the phones and the bookings. The CLI provides the following commands:
- Display available phones
- Book a phone
- Return a phone
- Exit
- Execute the following command to test the CLI
docker exec -it mobile-rent-cli /bin/bash
- Run the java application with the command below:
java -jar /app/mobile-rent-cli.jar
-
What aspect of this exercise did you find most interesting?
- I found the most interesting part of the exercise the freedom to choose the technologies that I wanted to use to implement the app and the requirement left to me room to decide how to implement the app.
-
What did you find most cumbersome?
- The most cumbersome part of the exercise writing the instructions on how to setup the app and the technologies that I used to implement the app.