How infor-cloud/m3-h5-sdk works
Project Type and Overview
• Odin is a framework for building web applications that interface with Infor M3 systems.
• It is composed of three major parts:
– A Command Line Interface (CLI) (located under the “cli” directory) used for bootstrapping, serving, and building projects.
– A Core API library that depends only on RxJS and contains core M3 integration functionality.
– Angular services (packaged as @infor-up/m3-odin-angular) that provide M3-related features (such as executing MI programs, managing user context, etc.) and can optionally work with Infor IDS (SoHo) UI components.
• There are also sample projects, documentation, and plug-in boilerplates included (e.g., in the “m3-odin” and “login” directories) which illustrate usage in an Angular context and support the complete lifecycle from development through deployment in H5.
Analyzing the File Structure
• Top-level folders like “cli”, “m3-odin”, and “login” show how the project is modularized:
– The “cli” directory contains scripts, commands, boilerplates for Angular (both IDS and plain Angular), and utilities to create, serve, build, and publish new applications.
– The “m3-odin” directory holds the core API code, Angular integration (see “projects/infor-up/m3-odin-angular”), sample application code, e2e tests, documentation, and TypeScript configuration, indicating a robust modular design with clear separation between core logic and UI/integration layers.
– The “login” directory suggests a separate utility or component for handling authentication tasks (e.g., provisioning login functionality via the CLI and/or within the integrated apps).
• Configuration files (like angular.json, tsconfig.json, package.json in various subdirectories) indicate multiple build targets and support for different project types (Angular, basic vanilla web, etc.).
Components and Their Relationships
• CLI Component:
– Responsible for scaffolding new projects, managing development tasks (build, serve, version publish), and incorporating boilerplate templates.
– Interacts with other components by generating appropriate configuration files and by invoking underlying scripts (see the “cli/src/commands”).
• Core API (non-Angular):
– Provides functionalities to execute MI transactions and handle low-level M3 integrations using RxJS.
– Acts as the backbone over which Angular services are built.
• Angular Services:
– Wrap the core functionalities in Angular modules (see the “@infor-up/m3-odin-angular” package within “m3-odin/projects/infor-up/m3-odin-angular”).
– Supply service components that interact with M3 MI transactions, user context management, and potentially UI-level operations.
• Sample/Boilerplate Projects:
– Offer examples on how to use the CLI to generate projects that may include Angular IDS-based components or simple, vanilla web projects.
• External Integration:
– The system design should include elements showing integration with external systems such as the M3 backend and ION API, including the proxy authentication flows as described in the README.
– Indicate that the CLI supports setting proxy endpoints and authenticating (via basic auth or OAuth2 with the “odin login” flow).
Architectural Patterns and Design Principles
• Modular & Layered Architecture: Clear separation between CLI, core libraries, Angular services, and sample applications.
• Dependency Injection: Notably used in Angular services (e.g., IonApiConfig token) to allow for configuration overrides.
• Separation of Concerns: The CLI is solely for project scaffolding and build processes, while the core API focuses on M3 interactions without Angular dependencies.
• Extensibility: Provided boilerplates and sample codes indicate that the framework is designed to be customizable for different M3 application scenarios.
• Clear boundaries between front-end (Angular) logic and underlying service calls (using RxJS and MIRecord manipulation for MI transactions).
Detailed Steps for the Principal Software Engineer
– Begin with the CLI layer that covers project generation and build tasks.
– Then illustrate the generated application layer divided into the core API (which handles low-level M3 integration) and Angular services (which facilitate higher-level integration and UI interactions).
– Finally, show the external integration with Infor M3 and ION API.
• Component with its corresponding file tree locations (e.g., “cli/src/commands” for CLI commands, “m3-odin/projects/infor-up/m3-odin-angular” for Angular services).
– The flow of commands from CLI to the building process.
– The flow of data from Angular UI, through the service layer, to the core API and then to external endpoints.
– The configuration flow where the “odin set” and “odin login” commands update proxy and token configurations.
• Legends and annotations that explain key interactions and design principles.
• To capture details like:
– The CLI’s role in project creation (including boilerplate selection).
– The independent core API (with RxJS dependency).
– Conditional OAuth2 / Basic auth integrations for proxy authentication.
– The optional Infor IDS controls integration.