{"id":26549898,"url":"https://github.com/miniopensource/cims-backend","last_synced_at":"2025-03-22T07:22:18.507Z","repository":{"id":278149254,"uuid":"933069900","full_name":"MINIOpenSource/CIMS-backend","owner":"MINIOpenSource","description":"ClassIsland 集控服务器 | 基于 Python 的适用于 ClassIsland 的集控服务器","archived":false,"fork":false,"pushed_at":"2025-03-15T11:36:56.000Z","size":396,"stargazers_count":29,"open_issues_count":4,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T12:26:58.918Z","etag":null,"topics":["classisland","classisland-mgmt","fastapi","grpc","grpc-server","material-ui","webapp"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MINIOpenSource.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-15T04:31:08.000Z","updated_at":"2025-03-15T11:36:59.000Z","dependencies_parsed_at":"2025-02-18T09:26:02.378Z","dependency_job_id":"f5c5b730-3645-4d6e-ac7d-2c99dcdce3e8","html_url":"https://github.com/MINIOpenSource/CIMS-backend","commit_stats":null,"previous_names":["kaokao221/classislandmanagementserver.py","miniopensource/cims-backend"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MINIOpenSource%2FCIMS-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MINIOpenSource%2FCIMS-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MINIOpenSource%2FCIMS-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MINIOpenSource%2FCIMS-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MINIOpenSource","download_url":"https://codeload.github.com/MINIOpenSource/CIMS-backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244920491,"owners_count":20532047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["classisland","classisland-mgmt","fastapi","grpc","grpc-server","material-ui","webapp"],"created_at":"2025-03-22T07:22:17.914Z","updated_at":"2025-03-22T07:22:18.502Z","avatar_url":"https://github.com/MINIOpenSource.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 基于 Python 的适用于 [ClassIsland](https://github.com/classisland/classisland) 的集控服务器\n\n[加入讨论区](https://qm.qq.com/ez2uhHJv2w)\n\n集控服务器分为三个部分，分别是[`api`](./ManagementServer/api.py)[`command`](./ManagementServer/command.py)[`gRPC`](./ManagementServer/gRPC.py)，分别用于：\n\n| 组件 | [`api`](./ManagementServer/api.py)   | [`command`](./ManagementServer/command.py) | [`gRPC`](./ManagementServer/gRPC.py) |\n|----|--------------------------------------|--------------------------------------------|--------------------------------------|\n| 用途 | 向客户端分发配置文件                           | 通过API以集控服务器为中介获取客户端状态、向客户端发送指令             | 与客户端建立gRPC链接                         |\n| 端口 | [50050](http://127.0.0.1:50050/docs) | [50052](http://127.0.0.1:50052/docs)       | 50051                                |\n\n## *实验性* 快速部署（适用于 Linux 平台）:\n\n```bash\nbash -c \"$(curl -sSL raw.githubusercontent.com/MINIOpenSource/CIMS-backend/main/install.sh)\" \u0026\u0026 cd CIMS/backend \u0026\u0026 source venv/bin/activate \u0026\u0026 python CIMS.py\n```\n\n## 如何使用？\n\n以下是使用 ClassIsland 集控服务器的步骤：\n\n1. **环境准备**:\n    *   **Python:** 确保你的系统已安装 Python 3.8+，推荐 Python 3.12+，推荐自行编译完整的 Python 3.12 \u0026 OpenSSL 3 环境。\n    *   **Node.js and npm:** 如果你需要使用 WebUI，请确保已安装 Node.js (v22+) 和 npm。\n    *   **Git (Optional):** 如果你想从 GitHub 克隆仓库，则需要安装 Git。\n2. **克隆代码:**\n    ```bash\n    git clone https://github.com/kaokao221/ClassIslandManagementServer.py.git\n    cd ClassIslandManagementServer.py\n    ```\n    *   如果你不使用 Git，可以下载 ZIP 压缩包并解压。\n3. **创建 venv 并安装依赖:**\n    ```bash\n    python -m venv venv\n    ./venv/Scripts/python.exe -m pip install -r requirements.txt\n    # Windows 环境\n    ```\n    ```bash\n    python3 -m venv venv\n    ./venv/bin/python3 -m pip install -r requirements.txt\n    # Linux 环境\n    ```\n    在 Linux 环境中，可能出现 venv / pip 不可用报错，请根据相关提示从命令行安装 venv 和 pip 后重新创建虚拟环境并安装依赖。\n4. **构建 Protobuf 文件:**\n    ```bash\n    ./venv/Scripts/python.exe -m grpc_tools.protoc --proto_path=. --python_out=. --grpc_python_out=. ./Protobuf/Client/ClientCommandDeliverScReq.proto ./Protobuf/Client/ClientRegisterCsReq.proto ./Protobuf/Command/HeartBeat.proto ./Protobuf/Command/SendNotification.proto ./Protobuf/Enum/CommandTypes.proto ./Protobuf/Enum/Retcode.proto ./Protobuf/Server/ClientCommandDeliverScRsp.proto ./Protobuf/Server/ClientRegisterScRsp.proto ./Protobuf/Service/ClientCommandDeliver.proto ./Protobuf/Service/ClientRegister.proto\n    # Windows 环境\n    ```\n    ```bash\n    ./venv/bin/python3 -m grpc_tools.protoc --proto_path=. --python_out=. --grpc_python_out=. ./Protobuf/Client/ClientCommandDeliverScReq.proto ./Protobuf/Client/ClientRegisterCsReq.proto ./Protobuf/Command/HeartBeat.proto ./Protobuf/Command/SendNotification.proto ./Protobuf/Enum/CommandTypes.proto ./Protobuf/Enum/Retcode.proto ./Protobuf/Server/ClientCommandDeliverScRsp.proto ./Protobuf/Server/ClientRegisterScRsp.proto ./Protobuf/Service/ClientCommandDeliver.proto ./Protobuf/Service/ClientRegister.proto\n    # Linux 环境\n    ```\n    这将会构建 `.proto` 文件生成对应的 Python 代码，以用于 gRPC 通信。\n5. **启动服务器:**\n    *   **使用 `CIMS.py` :**\n        \u003e 第一次启动时，会引导配置一些基础信息\n        ```bash\n        ./venv/Scripts/python.exe CIMS.py\n        # Windows 环境\n        ```\n        ```bash\n        ./venv/bin/python3 CIMS.py\n        # Linux 环境\n        ```\n        生成集控预设文件（`ManagementPreset.json`）：\n        ```bash\n        ./venv/Scripts/python.exe CIMS.py -g\n        # Windows 环境\n        ```\n        ```bash\n        ./venv/bin/python3 CIMS.py -g\n        # Linux 环境\n        ```\n6. **访问 API:**\n   * 你可以在浏览器中访问 `http://127.0.0.1:50050/docs` (或你设置的端口)查看 API 文档.\n\n\u003e ## 注意\n\u003e 目前所有的 README Guide 和 start.py 都是在 Windows 环境开发的，在 Linux 环境下已经有生产部署的先例，但在出现意料之外的问题时，还请在 commit 中提供更多诊断信息，谢谢！\n\n## 功能清单\n\n## Star 历史\n[![Stargazers over time](https://starchart.cc/kaokao221/ClassIslandManagementServer.py.svg?variant=adaptive)](https://starchart.cc/kaokao221/ClassIslandManagementServer.py)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminiopensource%2Fcims-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminiopensource%2Fcims-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminiopensource%2Fcims-backend/lists"}