LuoChinWen c9f743e882 -dev:完成数据库的切换 4 minggu lalu
..
__mocks__ 53564ecbf7 -init:初始化项目 1 bulan lalu
apps 7e2974cc6d -dev:增加了docker与前端编译 4 minggu lalu
libs 96c4f3dab6 -dev:优化了登录界面样式,优化了弹窗提示 1 bulan lalu
tools 53564ecbf7 -init:初始化项目 1 bulan lalu
.editorconfig 53564ecbf7 -init:初始化项目 1 bulan lalu
.gitignore 53564ecbf7 -init:初始化项目 1 bulan lalu
.prettierignore 53564ecbf7 -init:初始化项目 1 bulan lalu
.prettierrc 53564ecbf7 -init:初始化项目 1 bulan lalu
.stylelintignore 53564ecbf7 -init:初始化项目 1 bulan lalu
.stylelintrc.json 53564ecbf7 -init:初始化项目 1 bulan lalu
README.md 53564ecbf7 -init:初始化项目 1 bulan lalu
babel.config.json 53564ecbf7 -init:初始化项目 1 bulan lalu
biome.json 53564ecbf7 -init:初始化项目 1 bulan lalu
components.json 53564ecbf7 -init:初始化项目 1 bulan lalu
design-tokens.json 53564ecbf7 -init:初始化项目 1 bulan lalu
feature_flags.json 53564ecbf7 -init:初始化项目 1 bulan lalu
jest.config.ts 53564ecbf7 -init:初始化项目 1 bulan lalu
jest.preset.js 53564ecbf7 -init:初始化项目 1 bulan lalu
learn.md c9f743e882 -dev:完成数据库的切换 4 minggu lalu
nx.json 53564ecbf7 -init:初始化项目 1 bulan lalu
package.json 1740b548dd -dev:修改了样式、配色,以及前端性能和前端逻辑优化 1 bulan lalu
postcss.config.js 53564ecbf7 -init:初始化项目 1 bulan lalu
pyproject.toml 53564ecbf7 -init:初始化项目 1 bulan lalu
release.js 53564ecbf7 -init:初始化项目 1 bulan lalu
tailwind.config.js 53564ecbf7 -init:初始化项目 1 bulan lalu
tsconfig.base.json 53564ecbf7 -init:初始化项目 1 bulan lalu
tsconfig.json 53564ecbf7 -init:初始化项目 1 bulan lalu
webpack.config.js 53564ecbf7 -init:初始化项目 1 bulan lalu
yarn.lock 1740b548dd -dev:修改了样式、配色,以及前端性能和前端逻辑优化 1 bulan lalu
项目结构分析.md 53564ecbf7 -init:初始化项目 1 bulan lalu

README.md

Label Studio

Label Studio is a complex, NX-managed project divided into three main components:

Main App (apps/labelstudio)

This is the primary application that consolidates all frontend framework elements. It's the hub for integrating and managing the different libraries and functionalities of Label Studio.

Library - Label Studio Frontend (libs/editor)

Label Studio Frontend, developed with React and mobx-state-tree, is a robust frontend library tailored for data annotation. It's designed for seamless integration into your applications, providing a rich set of features for data handling and visualization. Customization and extensibility are core aspects, allowing for tailored annotation experiences.

Library - Datamanager (libs/datamanager)

Datamanager is an advanced tool specifically for data exploration within Label Studio. Key features include:

Installation Instructions

1 - Dependencies Installation:

  • Execute yarn install --frozen-lockfile to install all necessary dependencies.

2 - Environment Configuration (Optional for HMR):

  • If you want to enable Hot Module Replacement (HMR), create an .env file in the root Label Studio directory.
  • Add the following configuration:
    • FRONTEND_HMR=true: Enables Hot Module Replacement in Django.

Optional configurations (defaults should work for most setups):

If using Docker Compose with HMR:

  • Update the env_file: .env directive in docker-compose.override.yml under the app service.
  • Rerun the app or docker compose service from the project root for changes to take effect.

To start the development server with HMR:

  • From the web directory: Run yarn dev
  • Or from the project root: Run make frontend-dev

Custom Configuration for DataManager:

  • If you need to customize the configuration specifically for DataManager, follow these steps:
    • Duplicate the .env.example file located in the DataManager directory and rename the copy to .env.
    • Make your desired changes in this new .env file. The key configurations to consider are:
      • NX_API_GATEWAY: Set this to your API root. For example, http://localhost:8080/api/dm.
      • LS_ACCESS_TOKEN: This is the access token for Label Studio, which can be obtained from your Label Studio account page.
  • This process allows you to have a customized configuration for DataManager, separate from the default settings in the .env.local files.

Usage Instructions

Key Development and Build Commands

  • Label Studio App:
    • yarn ls:dev: Build the main Label Studio app with Hot Module Reload for development.
    • yarn ls:watch: Build the main Label Studio app continuously for development.
    • yarn ls:e2e: Run end-to-end tests for the Label Studio app.
    • yarn ls:unit: Run unit tests for the Label Studio app.
  • Label Studio Frontend (Editor):
    • yarn lsf:watch: Continuously build the frontend editor.
    • yarn lsf:serve: Run the frontend editor standalone.
    • yarn lsf:e2e: Run end-to-end tests for the frontend editor.
    • yarn lsf:integration: Run integration tests for the frontend editor.
    • yarn lsf:unit: Run unit tests for the frontend editor.
  • Datamanager
    • yarn dm:watch: Continuously build Datamanager.
    • yarn dm:unit: Run unit tests for Datamanager.
  • General
    • yarn build: Build all apps and libraries in the project.
    • yarn ui:serve: Serve the Storybook instance for the shared UI library.
    • yarn test:e2e: Run end-to-end tests for all apps and libraries.
    • yarn test:integration: Run integration tests for all apps and libraries.
    • yarn test:unit: Run unit tests for all apps and libraries.
    • yarn lint: Run biome linter across all files with autofix.
    • yarn lint-scss: Run stylelint linter across all scss files with autofix.

Git Hooks

This project uses python pre-commit hooks to ensure code quality. To install the hooks, run make configure-hooks in the project root directory. This will install the hooks and run them on every pre-push to ensure pull requests will be aligned with linting for both python and javascript/typescript code.

If for any reason you need to format or lint using the same pre-commit hooks directly, you can run make fmt or make fmt-check respectively from the project root directory.

Ecosystem

| Project | Description | |----------------------------------|-| | label-studio | Server part, distributed as a pip package | | label-studio-frontend | Frontend part, written in JavaScript and React, can be embedded into your application | | label-studio-converter | Encode labels into the format of your favorite machine learning library | | label-studio-transformers | Transformers library connected and configured for use with label studio | | datamanager | Data exploration tool for Label Studio |

License

This software is licensed under the Apache 2.0 LICENSE © HumanSignal. 2020