How maneesana/video-streaming-cpp-backend works
Main Components
• Backend Service: The core application code is found in the src/ directory (for example, App.cpp, AppComponent.hpp, SwaggerComponent.hpp, controllers like MyController, and DTO definitions).
• Web Framework & API Layer: Oat++ is used to construct your REST endpoints (note the controllers and Swagger integration), which should be represented as part of your API layer.
• External Dependencies/Libraries: Note the external/ folder which includes submodules for oatpp, oatpp-postgresql, and oatpp-swagger. These represent the integral libraries enabling web server functionalities, database communication, and API documentation respectively.
• Deployment & Configuration: Include components for deployment (dockerfile, docker-compose.yml, deployment scripts in .github/workflows and deploy.sh). Also, acknowledge configuration elements like resources/config.json, build.sh, and configure.sh.
Relationships and Interactions
• Client/API Interaction: Start with a client (or end-user) making an HTTP request that hits one or more endpoints in your backend.
• API Routing: The request is processed by controllers (src/controller) which delegate business logic.
• Data Transfer Objects: DTOs (defined in src/dto) enable communication of structured data between layers.
• Swagger Integration: The SwaggerComponent shown in src/SwaggerComponent.hpp auto-generates API documentation, which could be denoted as an external service or part of the API layer.
• Deployment Flow: Display how build and deployment scripts (configure.sh, build.sh, run.sh, docker-compose.yml) lead to the actual deployed containerized service.
Architectural Patterns
• Separation of Concerns: Distinguish clearly between API (web layer), business logic (controllers and application components), data structures (DTOs), and persistence (database).
• Modular Design: The use of separate directories for controllers, DTOs, and integration libraries indicates a modular layout. This modularity allows you to highlight how each component interacts via clearly defined interfaces.
• DevOps & Automation: The presence of GitHub workflows and shell scripts for building/deploying denotes CI/CD pipelines.
Incorporate Relevant Technologies/Frameworks
• Oat++: Emphasize that the web framework underpins the server and API capabilities.
• PostgreSQL: Show the database system handling storage and queries.
• C++ 17: Indicate the programming language environment the application is built on.
• Docker: Illustrate how Docker (dockerfile and docker-compose.yml) packages the application for deployment.