How eoussama/fut-card-generator works
• Command Line Interface (CLI) – Implemented in src/cli and include/cli. This module handles user parameters and calls the underlying C++ generation engine.
• Python API – Found in api/app.py and its related helper modules and routes. This serves as an HTTP layer to wrap the CLI functionality and expose endpoints (GET /, POST /generate) to generate cards.
• Assets and Templates – Represented by the assets/ directory (including card images, fonts, logos) and the include/template directories. These are used by both the CLI and API to generate the visual card output.
• Docker & Deployment – Dockerfiles (docker/Dockerfile, Dockerfile.api, Dockerfile.dev) along with scripts in scripts/ provide containerized deployment and development environments.
• External Dependencies – The external/ directory indicates imported libraries or adaptations (like argparse, json) which are integrated into the project.
Relationships and data flow
• The API, implemented in Python, acts as an adapter: it receives HTTP requests (with arguments and file uploads) → translates them into command-line-like parameters → invokes the underlying C++ executable/library.
• The core library communicates with asset management, template handling, and drawing modules. Most functional modules in the src/ and include/ directories interact to produce the final Fut card.
• Error handling by showing a connection from the core functions to various exception components (found in include/exceptions and src/exceptions) to handle failures such as image download or loading issues.
• Data/information flow regarding configuration and internationalization that uses language dictionaries (see include/core/i18n and assets/i18n).
Architectural patterns/design principles
• Separation of Concerns – Different modules (CLI, API, core library) are separated clearly.
• Modularity – Several modules (card, template, player, and exception handling) are distinctly organized in both the include/ and src/ directories.
• Reusability – The library can be reused in multiple interfaces (command line and web).
Technology specifics
• C++ and CMake for building the core binary.
• Python with Flask for the API.
• Docker for containerization.
• External libraries included from the external/ directory, possibly for argument processing and JSON utilities.
• Assets like images and fonts are stored under assets/ for use by both the API and CLI modules.
Detail the inter-component interactions
• That both the CLI and API layers rely on the same underlying card generation engine.
• That Docker scripts (with deployment containers) encapsulate both the API server and the development/build processes.
• Annotations for important configuration files (e.g., CMakeLists.txt, Dockerfiles) that facilitate building and deployment.