116: OpenIM Component-Base


OpenIM Component-Base

Implement OpenIM RPC Proposal 32: https://github.com/OpenIMSDK/community/edit/main/RFC/0006-openim-component-base.md

Welcome to the OpenIM Component-Base repository. This repository hosts a collection of shared tools and utilities dedicated to strengthening the modular and scalable nature of the OpenIM project ecosystem.

Table of Contents

  1. Introduction
  2. Motivation
  3. Getting Started
  4. Components
  5. Contribution
  6. Prior Art
  7. License


OpenIM strives to offer a potent, streamlined, and expansive instant messaging solution. To ensure a cohesive yet modular architecture, common components are housed in this repository. This structure not only delineates clear boundaries but also facilitates the reuse of components across diverse OpenIM projects.


In our journey to optimize and expand the OpenIM project, we discerned overlapping tools and utilities across repositories like chat, core, and server. To streamline dependencies and enhance reusability, the component-base repository was conceived, inspired by best practices from projects like Kubernetes.

Getting Started

To integrate any component from this repository:

  1. Clone the repository:
   git clone https://github.com/OpenIM/component-base.git
  1. Delve into the chosen component's directory.
  2. Adhere to the designated README or documentation pertinent to that component.


[Mention primary components with succinct descriptions. For instance:]

  • ComponentConfig: Streamlines flag and command handling for better user interaction. More Details
  • HTTPSUtility: Ensures secure HTTPS serving. More Details
  • AuthDelegate: Manages delegated authentication and authorization. More Details
  • LogManager: Provides uniform logging functionalities across projects. More Details

(Elaborate on this index with the inclusion of new components.)


Our doors are always open to community contributions. If the idea of enhancing OpenIM resonates with you, do peruse our contribution guidelines and embark on this collaborative voyage!

Prior Art

Our inspiration draws from Kubernetes's component-base repository, which embodies a consolidated platform for components, encouraging shared utilities and consistent configurations.


Embarking on a project with OpenIM Component-Base implies agreement with our MIT License. For an exhaustive understanding, we recommend perusing the LICENSE file.


[RFC #0001] Introduction of component-base Repository


  • Name: Introduction of component-base Repository
  • Start Date: 2023-08-25
  • Author(s): @cubxxw
  • Status: Draft
  • RFC Pull Request: (leave blank)
  • OpenIMSDK Pull Request: (leave blank)
  • OpenIMSDK Issue: (leave blank)
  • Supersedes: N/A



Proposal to introduce the component-base repository, a centralized hub to house common tools and shared code, aimed to enhance code reusability and component coherence, inspired by Kubernetes's component-base.


  • Current repositories like chat, core, and server share multiple common tools, but dependencies aren't clearly isolated.
  • A clear, independent repository helps external contributors or platforms to leverage OpenIMSDK's tools effortlessly.
  • Achieve similar component structure like Kubernetes to maintain a modular and scalable codebase.

What it is

component-base is a repository designed to contain shared tools and utilities used across OpenIMSDK projects. This will include, but isn't limited to:

  • ComponentConfig implementations
  • Flag and command handling
  • HTTPS serving
  • Delegated authn/z
  • Logging.

How it Works

Existing shared tools and code from repositories like chat, core, and server will be migrated to component-base. This repository will not provide compatibility guarantees initially but will align with OpenIMSDK's branches for compatibility.


Transition involves:

  1. Identifying common tools/code from the respective repositories.
  2. Refactoring and migrating them to component-base.
  3. Adjusting dependencies in the original repositories to now point to component-base.


  • Initial overhead due to refactoring.
  • Potential for issues during the migration phase.


  • Maintain the current structure but ensure stricter guidelines for code sharing.
  • Create separate utility repositories for each original repository instead of a single shared one.

Prior Art

Kubernetes's component-base repository serves a similar purpose. They created it to have a unified, consistent base for components, promoting shared utilities and configurations.

Unresolved Questions

  • What might be the challenges in the migration phase?
  • How do we ensure minimal disruption during the transition?

Spec. Changes (OPTIONAL)

No specification changes as of now.


  • 2023-08-25: Initial draft proposed by @cubxxw