Imagine you are an Alten consultant and you got assigned to a project at one of our top partners. They have a number of connected vehicles that belongs to a number of customers. They have a need to be able to view the status of the connection among these vehicles on a monitoring display.
The vehicles send the status of the connection one time per minute. The status can be compared with a ping (network trace); no request from the vehicle means no connection.
Your task will be to create a data store that keeps these vehicles with their status and the customers who own them, as well as a GUI (preferably web-based) that displays the status. How the GUI is designed is up to you, as well as how you chose to implement the features and use suitable technologies.
Obviously, for this task, there are no real vehicles available that can respond to your "ping" request. This can either be solved by using static values or by creating a separate machinery that returns random fake status.
- Web GUI (Single Page Application Framework/Platform).
- An overview of all vehicles should be visible on one page (full-screen display), together with their status.
- It should be able to filter, to only show vehicles for a specific customer.
- It should be able to filter, to only show vehicles that have a specific status.
- Random simulation to vehicles status sending.
- If database design will consume a lot of time, use data in-memory representation.
- Unit Testing.
- .NET Core, Java or any native language.
- Complete analysis for the problem.
- Full architectural sketch to solution.
- Analysis behind the solution design, technologies,....
- How the solution will make use of cloud.
- Deployment steps.
- Write an integration test.
- Write an automation test.
- Use CI(Travis, Circle, TeamCity...) to verify your code (Static analysis,..) and tests.
- Dockerize the whole solution.
- Microservices architecture for driver, vehicle and FaaS APIs.
- Use any Microservices Chassis Framework.
- Explain if it is possible to be in Serverless architecture and how?
Below you have all customers from the system; their addresses and the vehicles they own.
Customer name: Kalles Grustransporter AB
Customer address: Cementvägen 8, 111 11 Södertälje
VIN (VehicleId) | Reg. nr. |
---|---|
YS2R4X20005399401 | ABC123 |
VLUR4X20009093588 | DEF456 |
VLUR4X20009048066 | GHI789 |
Customer name: KJohans Bulk AB
Customer address: Balkvägen 12, 222 22 Stockholm
VIN (VehicleId) | Reg. nr. |
---|---|
YS2R4X20005388011 | JKL012 |
YS2R4X20005387949 | MNO345 |
Customer name: Haralds Värdetransporter AB
Customer address: Budgetvägen 1, 333 33 Uppsala
VIN (VehicleId) | Reg. nr. |
---|---|
VLUR4X20009048066 | PQR678 |
YS2R4X20005387055 | STU901 |
In our project the partner's business is highly dynamic. Also the business scaling is promising. So we recommed that the application will be cloud compliant. The selection of the archicture here will be a Microservice Architecure it will be optimal for this business agility. The load on the application endpoints is not close. ex:ping service will be hitted more that the custoemr search so scalling this endpoint only will be cost saving compared to replicaing the whole application. Also the give the flexability to add new small and independant components to enrich the customer business.
The related technologies to this Reference Architecture mentioned in the below diagram.
The mentioned technologies are used in the impelemantation of this project into the below modules.
- discovery-service : build over Zuul to load balance and hide the service complexity.
- gateway-service : build over Eureka to keep registery with the service instances, also used by the gateway to load balance.
- customer : Spring boot (web, Data) ,flywayDB, h2-database, swagger and jacoco. Customer store management.
- vehicle : Spring boot (web, Data) ,flywayDB, h2-database, Swagger and jacoco. Vehicle store management.
- vehicle-monitoring: Angular frontend app.
- vehicle-signal-generator : Spring boot (web) , util to demo the signal status.
first of all you need to build the mentioned projects (each project has it's own pipeline):
- discovery-service
cd discovery-service mvn package
- gateway-service
cd gateway-service mvn package
- customer
cd customer mvn package
- vehicle
cd vehicle mvn package
- vehicle-monitoring
cd vehicle-monitoring npm install ng build
- vehicle-signal-generator
cd vehicle-signal-generator mvn package
now got to the workspace root to run the whole environment locally using docker-compose
docker-compose build
docker-compose up
or
docker-compose up --build
Check up the components
- vehicle-monitoring : open the Webapp http://localhost:4200/
- customer service : check the swagger of the customer service http://localhost:8080/customer/swagger-ui.html#
- vehicle service : check the swagger of the customer service http://localhost:8080/vehicle/swagger-ui.html#
- discovery-serice : check the Eureka dashboard http://localhost:8090/
- AWS S3 for serving the static content.
- AWS ECS cluster for hosting the Container images.
travis-ci and AWS AWS CodeBuild is used to achieve:
- build the application.
- build the Docker image.
- publish it to the AWS ECR.
*) check the
${app.dir}/buildspec.yml
AWS Codepipeline
- Trigger the build
- Deploy the a task.
ECS is used to achive:
- Runtime enviroment.
S3
- Static content for the Angular App.
Here's the live version of the app http://altenvehicle.s3-website-us-east-1.amazonaws.com/
I've integrated travis-ci to SonarCloud to publish the Code analysis for Two Services
- Customer Rest SonarCloud public link : https://sonarcloud.io/dashboard?id=com.alten%3Acustomer
- Vehicle Rest SonarCloud public link : https://sonarcloud.io/dashboard?id=com.alten%3Avehicle