How kabucom/kabusapi works
API Portal & Documentation (Website)
• The "ptal" directory holds HTML pages (e.g., index.html, guide.html, faq.html), CSS, and images that make up a static portal for users. This portal serves as the documentation and entry-point for the API, offering guides, FAQs, how-to instructions, and reference material.
• The "reference" directory contains API documentation files, including the OpenAPI (YAML) file (kabu_STATION_API.yaml) and some bundled JavaScript libraries for redoc, which support interactive API reference generation.
API Client Library / Integration Components
• "ExcelAddin": This directory contains the source code for an Excel add-in. Inside it, the code base built using .NET (e.g., C# files, .csproj, .dna file) is responsible for integrating Excel with the kabuステーション API. It includes controllers, elements, functions, and utilities that encapsulate API operations for Excel users.
Sample Code in Multiple Languages
• "sample": This directory is subdivided further into language-specific samples:
• "sample/C#": Demonstrates C# implementations, including many examples that encapsulate different API calls such as “CancelOrder”, “Board”, “Exchange”, “Orders”, etc.
• "sample/JavaScript": Contains JavaScript files that mirror the API calls seen in the Excel Addin and C# samples.
• "sample/Python": Provides Python examples covering the same API functionality.
• "sample/ExcelMacro": Offers Excel Macro samples (using XLSX and XLSM files) to illustrate how the API can be consumed in Excel environments.
Architectural Insights
• Even though the README is minimal, the file structure shows a clear separation of concerns and technology domains. The API portal is present as a static web site, while the ExcelAddin and the various language samples show a modular approach for demonstrating and integrating with the kabuステーション API.
• The existence of separate directories for controllers, elements (data models), utilities, and settings in the Excel Addin implies adherence to separation between business logic, UI integration, and support utilities, typical of a layered architecture.
a. Main Components:
• API Portal & Documentation: Represented by the static website (ptal) and interactive API reference (reference).
• Excel Addin: The .NET-based add-in that integrates with Excel, with its controllers, models (elements), and utility classes.
• Multi-Language API Client Samples: Include components for C#, JavaScript, Python, and Excel Macro, showing how the API is accessed across various programming environments.
• Underlying API / Web Service (if applicable): Although not directly shown as a server in this repository, the design should note that all these clients connect to a backend service provided by kabuステーション®.
b. Relationships and Interactions:
• The API Portal presents guidelines, documentation, and interactive examples that direct developers on how to use the kabuステーション API.
• The Excel Addin acts as a client that integrates directly into Excel, connecting to the underlying API service.
• The sample code modules provide independent examples (in C#, JavaScript, Python, and via Excel Macros) of how to interface with the API, showcasing its capabilities, and serving as learning tools for developers.
c. Important Architectural Patterns/Design Principles:
• Layered Architecture: Separation between UI (portal), business logic (Excel Addin controllers and logic), and utilities (helper functions, libraries).
• Multi-Platform Client Integration: Structuring samples per language demonstrates adaptability and flexibility.
• Use of Modular Components: Notice the separation of API functions into various files/components; each major API operation gets its own module across different language implementations.
d. Relevant Technologies, Frameworks, or Libraries:
• .NET / C# Components (Excel Addin) including the Excel-DNA integration system.
• Web technologies for the portal: HTML, CSS, and JavaScript.
• Redoc (as evidenced by the bundled files in the reference directory) for rendering interactive API documentation.
• Additional language-specific runtime environments (e.g., Python interpreter, JavaScript engine) for executing the sample code.
• For the Excel Addin, clearly separate its layers (controllers, models/elements, utilities) and show its integration with Excel.
• For sample codes, group them by language and show how each one makes use of the central kabuステーション API.
• Labels: Each component should have a clear label (e.g., "API Portal (ptal)", "API Documentation & Redoc", "Excel Addin (.NET)", "C# Sample Client", "JavaScript Sample Client", "Python Sample Client", "Excel Macro Samples").