How infra-geo-ouverte/sdg works
Main Components
• Library Entry Point: The @igo2/sdg package exposed via packages (with a public API in packages/carto/src/public-api.ts, packages/core/src/public-api.ts, packages/geo/src/public-api.ts, and packages/src/public-api.ts). This entry point lets developers import top-level components and submodules.
• Submodules / Packages:
• Core Module (located in packages/core): Contains layout, styles, theming, router, translation, and global utilities.
• Carto Module (in packages/carto): Focused on mapping functionality leveraging OpenLayers (as seen under the src/ol folder), map controllers, and directives for geolocation and map interactions.
• Geo Module (in packages/geo): Provides additional geo-specific components such as map browsers, filters, legends, queries, and screens.
• UI/Lib Components (in packages/src/lib): Encompasses a broad collection of standard UI components (alerts, breadcrumbs, headers, footers, lateral menus, buttons, contact components, etc.).
Relationships and Interactions
• Each module is built as an Angular module that can be imported into an Angular application. The public API files expose the components and services.
• The Core package provides global resources (theme, routing, layout, translations) that are consumed by the other submodules like Carto and Geo to ensure consistency.
• The Carto and Geo modules interact to deliver a cohesive map experience (for example, the mapping browser component in geo might use services or directives from carto).
• The library’s UI components (in the shared “lib” folder) are designed to be integrated into any screen or composite UI and orchestrated within the demo application as found in projects/demo.
• The demo application itself acts as a consumer to illustrate how the submodules work together in a full-stack Angular context.
• Build, lint, and deployment scripts (in the root, .github/workflows, and scripts folders) show the CI/CD integration points.
Architectural Patterns and Design Principles
• Modular and Layered Architecture: The separate packages (core, carto, geo, src) each encapsulate a dedicated domain of functionality.
• Component-Based Design: The code is organized into Angular components along with supporting services, directives, and utilities.
• Public API Exposure: Each package exposes its interface via a primary “public-api” file that hides internal implementation details.
• Integration with Angular’s Dependency Injection and routing mechanisms to maintain separation of concerns.
• Use of testing (spec.ts files) and style guidelines (Prettier, ESLint, Prettier configurations) to enforce code quality and consistency.
• Design for extensibility: Submodules in the library (UI components and mapping systems) allow developers to import either the entire library or only the required pieces using namespaced imports (for example, “@igo2/sdg/geo”).
Relevant Technologies, Frameworks, or Libraries
• Angular: As the web framework driving the component architecture.
• OpenLayers: Implied by the “ol” directories in the Carto package for mapping functionalities.
• IGO2-LIB Integration: Especially in the mapping and cartographic functionalities, as mentioned in the README.
• Node.js, npm, and associated tooling (ESLint, Prettier, Commitlint) for development and CI/CD, as seen in the configurations and GitHub workflows.
• SCSS/CSS for theming, and Angular’s templating for component view rendering.