How vehicle-telematics-control-unit/backend-gateway-service works
Project Type and Purpose
• This is a containerized backend gateway service written in C++.
• Its purpose is to communicate directly with a back-end server using the VSOME/IP protocol for service discovery/communication, while leveraging an HTTP-Builder module to generate HTTP requests.
• The README and the repository structure indicate that the service is intended to run in Docker containers, built with CMake, and supports multiple platforms.
Key Components
a. Container Environment:
– The Docker container built via the provided Dockerfile and boost_build/dockerfile.
– Indicate multi-platform build support (linux/amd64, linux/arm64).
b. Application Core:
– Source code under build_src/src (including main.cpp, Authenticator.hpp, Internetconnectivity.hpp, servicesId.hpp).
– Illustrate the “core” application that initializes and orchestrates the VSOME/IP client service and HTTP Builder modules.
c. Dependencies and Modules:
– HTTP Client Module:
• Located under build_src/dependencies/http_client/
• Components like GetRequestClient, PostRequestClient, PutRequestClient, HttpRequest, and HttpRequestBuilder.
• Builder pattern applied in generating HTTP requests.
– VSOME/IP Service Module:
• Located under build_src/dependencies/someipService/
• Contains ServiceManagerAdapter to interact with the VSOME/IP API.
– JSON Support:
• Provided via the nlohmann/json.hpp dependency for handling JSON (likely used in HTTP payloads or configurations).
d. Build and Configuration Elements:
– CMakeLists.txt files for build orchestration (both at the project level in build_src and for individual dependencies).
– Additional assets such as private_key.der and certificates (ChainedCertficate.cer) used for secure communications.
Relationships and Data Flow
• The core application (main.cpp) acts as the entry point and ties together the dependencies.
• It uses the HTTP Client module (via HTTP Request Builder) to create and send HTTP requests to the backend server.
• Simultaneously, the VSOME/IP client (through ServiceManagerAdapter) handles protocol-specific communication.
– Initialization flow from main.cpp to HTTP client builder routines.
– Interaction flow from the VSOME/IP service to the backend server.
– Possible feedback loops if response handling is integrated.
Architectural Patterns and Design Principles
• Containerization: Emphasize how the entire application is packaged as a Docker container for consistent deployment.
• Builder Pattern: Used in creating complex HTTP requests via the HTTP Request Builder.
• Modular Design: Clear separation between HTTP communication (HTTP client dependency) and protocol-specific handling (VSOME/IP service dependency) suggests decoupled modules.
• Build Automation: Use of CMake for configuring and building the C++ modules and Docker for containerization.