System Overview and Context
Table of Contents
- Introduction
- Project Structure
- Core Components
- Architecture Overview
- Detailed Component Analysis
- Dependency Analysis
- Performance Considerations
- Troubleshooting Guide
- Conclusion
- Appendices
Introduction
This document provides a system overview of the BI Analysis Platform, an enterprise e-commerce Business Intelligence solution designed to deliver real-time analytics, AI-powered insights, and multi-tenant capabilities. The platform is built as a set of microservices using the Kratos framework, integrated with shared infrastructure components from the bi-common library. It emphasizes:
- Real-time analytics via streaming ingestion and OLAP-friendly storage
- AI agent system for conversational insights and automated analysis
- Multi-tenant architecture enabling tenant isolation and customizable configurations
- Unified APIs, observability, and operational excellence
Target audiences include:
- Data analysts who need fast, reliable access to metrics and dashboards
- Business users who benefit from conversational AI-driven insights
- System administrators who operate and maintain the platform at scale
Project Structure
The BI Analysis Platform is organized around modular microservices and shared libraries:
- bi-analysis: Core analytical service built on Kratos, exposing unified APIs and integrating bi-common
- bi-common: Shared infrastructure library providing configuration, logging, database, caching, messaging, and AI-related integrations
- Supporting services: bi-api-jushuitan, bi-api-leke, bi-basic, bi-chat, bi-tenant, and others form the broader ecosystem
Diagram sources
Section sources
Core Components
- Microservices with Kratos: Each service encapsulates domain capabilities, exposing HTTP/gRPC endpoints and leveraging bi-common for infrastructure.
- Shared components: Nacos for configuration and service discovery, gormx for database access, redisx for caching, kafkax for event streaming, and logger for observability.
- Unified API and documentation: Protobuf definitions and OpenAPI generation streamline API development and maintenance.
- Tenant isolation: Dedicated tenant service and configuration enable multi-tenancy across analytics and AI features.
Practical examples of common use cases:
- Real-time sales monitoring dashboard with drill-down analytics
- Conversational insights for marketing campaign ROI
- Tenant-specific KPI views and compliance reporting
Section sources
Architecture Overview
The platform follows a microservices-first architecture with centralized configuration and shared infrastructure:
- Application bootstrap loads environment-specific configuration from Nacos
- Kratos servers host HTTP and gRPC endpoints
- bi-common provides standardized components for reliability and operability
- AI agent system integrates with analytics data for contextual insights
Diagram sources
- [bi-analysis cmd/bi-analysis/main.go]
- [bi-analysis configs/application-dev.yaml]
- [bi-common README.md]
Section sources
Detailed Component Analysis
Microservices Bootstrap and Configuration
The bi-analysis service initializes Kratos, loads configuration from Nacos, sets up logging and service registration, and wires application components.
Diagram sources
Section sources
Shared Infrastructure Library (bi-common)
bi-common centralizes infrastructure concerns:
- Nacos integration for zero-configuration setup and dynamic configuration
- gormx for database connectivity and StarRocks support
- redisx for caching and session management
- kafkax for asynchronous event processing
- logger for structured logging and SLS integration
Diagram sources
Section sources
Unified API and Documentation
bi-analysis defines APIs using Protobuf and generates OpenAPI documentation automatically, ensuring consistent responses and discoverable endpoints.
Diagram sources
Section sources
Dependency Analysis
The bi-analysis service depends on bi-common and bi-proto, while bi-common integrates widely used OSS libraries for configuration, logging, database, caching, and messaging.
Diagram sources
Section sources
Performance Considerations
- Microservices enable independent scaling and resource allocation per domain
- OLAP-friendly storage (e.g., StarRocks) supports fast analytical queries
- Streaming ingestion via Kafka decouples producers and consumers for throughput
- Centralized logging and metrics improve observability and incident response
- Configuration via Nacos enables hot-reconfiguration without redeployments
Troubleshooting Guide
Common operational checks:
- Verify Nacos connectivity and configuration loading for the selected environment
- Confirm Kratos servers are listening and health endpoints are reachable
- Review structured logs for error traces and spans
- Validate database and cache connectivity
- Ensure Kafka topics and consumer groups are configured correctly
Operational references:
- Environment-specific configuration loading and service registration
- Structured logging initialization and shutdown
- Nacos-based configuration and service registry setup
Section sources
- [bi-analysis cmd/bi-analysis/main.go]
- [bi-analysis configs/application-dev.yaml]
- [bi-common README.md]
Conclusion
The BI Analysis Platform leverages a microservices-first design with Kratos, unified infrastructure via bi-common, and robust configuration management through Nacos. This architecture delivers real-time analytics, AI-powered insights, and multi-tenant scalability essential for enterprise e-commerce analytics. The combination of streaming ingestion, OLAP storage, and conversational AI enables actionable intelligence across diverse business domains.
Appendices
- Practical use cases:
- Real-time dashboards for sales and marketing KPIs
- AI-driven recommendations for product and inventory decisions
- Tenant-specific analytics and compliance reporting