🤝 Label Studio 1.11.0!Featuring a new unified codebase
Blog Post

Enhancing OSS Collaboration: Benefits the Label Studio Monorepo

Julio Sgarbi

Frontend Engineer

Introduction

In the dynamic realm of open-source software, collaboration and efficiency are key. Now the Label Studio team has embarked on an ambitious journey. With the latest Label Studio release, we're transitioning our front-end development from a multi-repository system to a monorepo structure. This change isn't just an internal restructuring; it's a strategic move that greatly benefits the OSS community.

The Challenges of Multiple Repositories

Our previous multi-repository setup faced several challenges:

  • Fragmented Codebases: Multiple repositories led to scattered and duplicated efforts, making it hard for external contributors to navigate and collaborate.
  • Complex Workflows: The use of submodules and follow-merge processes created a convoluted development workflow, deterring potential OSS contributors.
  • Significant Context Switching Burden: Constantly switching between repositories created a mental burden for our team and the OSS community, making collaboration more difficult.

Legacy Label Studio Repository Structure

Addressing the Challenges

The monorepo migration aims to address these challenges with specific benefits for the OSS community:

  1. Unified Codebase: Label Studio's single repository for frontend code makes it easier for OSS contributors to understand and contribute to the project.
  2. Streamlined Contribution Process: Simplifying the development and CI/CD processes reduces the barrier to entry and encourages community contributions.
  3. Enhanced Collaboration and Innovation: A monorepo fosters a more collaborative environment, enabling faster iteration and innovation.

Label Studio's New Monorepo Architecture

Label Studio is an application and an ecosystem designed to cater to a wide range of data annotation and management needs. Managed using NX, a powerful tool for orchestrating monorepos, the Label Studio organization comprises several key components, each serving a distinct purpose:

1. Main App (apps/labelstudio):

  • Central Integration Point: This is where the magic happens. The main application is a central integration point for all frontend elements, providing a unified user interface and experience.
  • Framework Agnostic Design: This design enables easy integration with different frontend libraries, providing flexibility and adaptability to new technologies and trends.

2. Library - Label Studio Frontend (libs/editor):

  • React and mobx-state-tree: This library utilizes React, a popular JavaScript library for building user interfaces, in conjunction with mobx-state-tree for state management. This combination ensures a resilient and scalable front-end solution.
  • Customization and Extensibility: One of the key features of this library is its ability to be customized and extended. Whether you need custom data visualization or specific annotation tools, this library is designed to be modified to meet unique and emergent project requirements.

3. Library - Datamanager (libs/datamanager):

  • Specialized Data Exploration Tool: DataManager is an advanced data exploration and management tool within Label Studio. It offers users comprehensive capabilities to interact with and analyze their data.
  • Integration with Label Studio: DataManager integrates seamlessly with the main Label Studio app, providing a cohesive experience for data management and annotation tasks.

Label Studio's New Monorepo Repository Structure

Benefits for Label Studio Community

  • Improved Navigation and Understanding: The consolidated codebase enables OSS contributors to navigate and understand the project structure more easily.
  • Increased Efficiency and Productivity: Streamlining the workflow allows contributors to concentrate on development tasks instead of dealing with complicated repository structures.
  • Consistent Code Quality and Standards: The monorepo structure helps maintain consistent coding standards and practices, which ensures higher code quality.
  • Facilitated Cross-Component Changes: Contributors can make changes across different components more efficiently, expanding the range of their contributions.
  • Improved Onboarding for New Contributors: A single, well-organized codebase makes it easier for new OSS contributors to get started.
  • Streamlined Development Workflow: With commands like yarn watch, **yarn test:unit**, yarn test:e2e, yarn test:integration, and yarn build, contributors can build and test their changes more efficiently, improving the development experience.

TL;DR

After migrating to a Monorepo, developers now enjoy a streamlined workflow. Just run a single 'watch' command, make your changes, and instantly see the results. Gone are the difficult to grok repositories and inconsistent commands to update them. No more technical gymnastics to see this change reflected in your work. How we work is now an all for one and one for all approach to allow us to work better together.

Conclusion

Our transition to a monorepo structure in Label Studio is more than an internal shift—it's a commitment to the OSS community. By simplifying and streamlining our development process, we're not only enhancing our own efficiency but also making it easier for open-source contributors to engage, innovate, and collaborate with us. We look forward to seeing how this change will spur further growth and innovation in the Label Studio community.