├── docker ├── data │ ├── api │ │ └── api.txt │ ├── minio │ │ └── miniio.txt │ ├── postgres │ │ └── pg.txt │ ├── redis │ │ └── redis.txt │ ├── celery │ │ └── celery.txt │ └── README.md ├── postgres │ └── init.sql ├── reset-redis.sh ├── redis │ └── redis.conf └── start.sh ├── backend ├── app │ ├── plugins │ │ ├── __init__.py │ │ └── base_plugin.py │ ├── api │ │ └── v1 │ │ │ ├── endpoints │ │ │ ├── __init__.py │ │ │ ├── plugins.py │ │ │ └── llm_test.py │ │ │ ├── __init__.py │ │ │ └── schemas │ │ │ ├── conversion_schemas.py │ │ │ └── library_schemas.py │ ├── tasks │ │ └── __init__.py │ ├── utils │ │ └── response.py │ ├── celery_app.py │ └── models │ │ ├── permission.py │ │ ├── plugin.py │ │ ├── role_permission.py │ │ ├── role.py │ │ ├── conversion_file_detail.py │ │ ├── user_session.py │ │ ├── user_organization.py │ │ ├── user.py │ │ ├── project_team_member.py │ │ ├── user_role.py │ │ ├── resource_permission.py │ │ ├── audit_log.py │ │ ├── project_data_source.py │ │ └── organization.py ├── alembic │ ├── README │ ├── script.py.mako │ ├── versions │ │ └── 9d5aba691653_add_dataflow_task_types_to_enum.py │ └── env.py ├── celery_worker.py ├── start_celery.sh ├── migrations │ └── reset_system.sh ├── test │ ├── test_api.py │ └── test_minio_fix.py ├── Dockerfile ├── requirements_optimized.txt ├── start_celery_threads.sh ├── config.example.env └── debug_llm.py ├── frontend ├── .bolt │ └── ignore ├── src │ ├── screens │ │ ├── RawData │ │ │ ├── index.ts │ │ │ └── LibraryDetails │ │ │ │ ├── index.ts │ │ │ │ └── README.md │ │ ├── StitchDesign │ │ │ ├── index.ts │ │ │ ├── sections │ │ │ │ ├── ActivitySection │ │ │ │ │ └── index.ts │ │ │ │ └── OverviewSection │ │ │ │ │ └── OverviewSection.tsx │ │ │ └── StitchDesign.tsx │ │ ├── Auth │ │ │ └── index.tsx │ │ ├── Datasets │ │ │ ├── SmartDatasetCreator.tsx │ │ │ ├── index.tsx │ │ │ └── SmartDatasetCreator │ │ │ │ ├── components │ │ │ │ ├── index.ts │ │ │ │ ├── ErrorMessage.tsx │ │ │ │ └── NavigationButtons.tsx │ │ │ │ └── index.tsx │ │ ├── DataGovernance │ │ │ ├── ProjectDetail.tsx │ │ │ ├── index.ts │ │ │ ├── components │ │ │ │ └── index.ts │ │ │ └── ProjectDetail │ │ │ │ ├── index.ts │ │ │ │ └── README.md │ │ ├── Settings │ │ │ ├── components │ │ │ │ └── index.ts │ │ │ └── README.md │ │ └── Plugins │ │ │ └── Plugins.tsx │ ├── i18n │ │ ├── locales │ │ │ ├── zh │ │ │ │ ├── time.json │ │ │ │ ├── actions.json │ │ │ │ ├── navigation.json │ │ │ │ ├── common.json │ │ │ │ ├── annotation.json │ │ │ │ ├── libraryDetails.json │ │ │ │ ├── dataPreview.json │ │ │ │ ├── index.ts │ │ │ │ ├── overview.json │ │ │ │ ├── auth.json │ │ │ │ └── datasets.json │ │ │ ├── en │ │ │ │ ├── time.json │ │ │ │ ├── actions.json │ │ │ │ ├── navigation.json │ │ │ │ ├── common.json │ │ │ │ ├── index.ts │ │ │ │ ├── annotation.json │ │ │ │ ├── dataPreview.json │ │ │ │ ├── libraryDetails.json │ │ │ │ ├── overview.json │ │ │ │ └── auth.json │ │ │ └── ja │ │ │ │ ├── actions.json │ │ │ │ ├── time.json │ │ │ │ ├── navigation.json │ │ │ │ ├── common.json │ │ │ │ ├── index.ts │ │ │ │ ├── dataPreview.json │ │ │ │ ├── overview.json │ │ │ │ ├── libraryDetails.json │ │ │ │ └── auth.json │ │ └── index.ts │ ├── components │ │ ├── auth │ │ │ ├── index.ts │ │ │ ├── AuthProvider.tsx │ │ │ └── ProtectedRoute.tsx │ │ ├── MediaFileDetails │ │ │ ├── dialogs │ │ │ │ └── index.ts │ │ │ └── index.ts │ │ ├── DataPreview │ │ │ └── index.ts │ │ ├── ui │ │ │ ├── progress.tsx │ │ │ ├── main-content-layout.tsx │ │ │ ├── textarea.tsx │ │ │ ├── input.tsx │ │ │ ├── slider.tsx │ │ │ ├── language-switcher.tsx │ │ │ ├── badge.tsx │ │ │ ├── switch.tsx │ │ │ ├── checkbox.tsx │ │ │ ├── tabs.tsx │ │ │ ├── button.tsx │ │ │ ├── card.tsx │ │ │ ├── table.tsx │ │ │ └── dropdown-menu.tsx │ │ └── Layout.tsx │ ├── lib │ │ ├── utils.ts │ │ └── config.ts │ ├── env.d.ts │ ├── index.tsx │ ├── services │ │ ├── index.ts │ │ └── overview.service.ts │ ├── types │ │ ├── api.ts │ │ ├── data-governance.ts │ │ ├── systemLog.ts │ │ ├── library.ts │ │ └── llm.ts │ ├── hooks │ │ ├── useOverview.ts │ │ ├── useTaskStats.ts │ │ ├── useFileDetails.ts │ │ └── useFileConversion.ts │ └── examples │ │ └── DataPreviewExample.tsx ├── public │ ├── depth-5--frame-0.png │ ├── vector---0-6.svg │ ├── vector---0-12.svg │ ├── vector---0.svg │ ├── vector---0-9.svg │ ├── vector---0-2.svg │ └── vector---0-3.svg ├── tsconfig.json ├── Dockerfile.dev ├── vite.config.ts ├── .gitignore ├── Dockerfile ├── .dockerignore ├── index.html ├── tsconfig.node.json ├── tsconfig.app.json ├── README.md ├── package.json ├── tailwind.config.js └── nginx.conf ├── poster.png ├── .gitmodules ├── wechat_2025-06-10_175702_266.png ├── run.py ├── Procfile ├── .gitignore ├── plugins ├── custom_distillers │ └── __init__.py └── custom_parsers │ ├── __init__.py │ └── my_custom_parser.py ├── doc └── tmp │ ├── user.md │ ├── muti.md │ └── design.md └── cleanup.sh /docker/data/api/api.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docker/data/minio/miniio.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docker/data/postgres/pg.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docker/data/redis/redis.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docker/postgres/init.sql: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docker/data/celery/celery.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /backend/app/plugins/__init__.py: -------------------------------------------------------------------------------- 1 | """插件系统初始化""" -------------------------------------------------------------------------------- /frontend/.bolt/ignore: -------------------------------------------------------------------------------- 1 | src/components/ui/* 2 | -------------------------------------------------------------------------------- /backend/app/api/v1/endpoints/__init__.py: -------------------------------------------------------------------------------- 1 | # 端点模块初始化 -------------------------------------------------------------------------------- /backend/alembic/README: -------------------------------------------------------------------------------- 1 | Generic single-database configuration. -------------------------------------------------------------------------------- /frontend/src/screens/RawData/index.ts: -------------------------------------------------------------------------------- 1 | export { RawData } from './RawData'; -------------------------------------------------------------------------------- /poster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hikariming/pindata/HEAD/poster.png -------------------------------------------------------------------------------- /frontend/src/screens/StitchDesign/index.ts: -------------------------------------------------------------------------------- 1 | export { StitchDesign } from "./StitchDesign"; 2 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Dataflow"] 2 | path = Dataflow 3 | url = https://github.com/OpenDCAI/DataFlow.git 4 | -------------------------------------------------------------------------------- /frontend/src/i18n/locales/zh/time.json: -------------------------------------------------------------------------------- 1 | { 2 | "hoursAgo": "{{count}}小时前", 3 | "daysAgo": "{{count}}天前" 4 | } -------------------------------------------------------------------------------- /frontend/src/screens/Auth/index.tsx: -------------------------------------------------------------------------------- 1 | export { Login } from './Login'; 2 | export { Register } from './Register'; -------------------------------------------------------------------------------- /wechat_2025-06-10_175702_266.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hikariming/pindata/HEAD/wechat_2025-06-10_175702_266.png -------------------------------------------------------------------------------- /frontend/public/depth-5--frame-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hikariming/pindata/HEAD/frontend/public/depth-5--frame-0.png -------------------------------------------------------------------------------- /frontend/src/i18n/locales/en/time.json: -------------------------------------------------------------------------------- 1 | { 2 | "hoursAgo": "{{count}} hours ago", 3 | "daysAgo": "{{count}} days ago" 4 | } -------------------------------------------------------------------------------- /frontend/src/screens/StitchDesign/sections/ActivitySection/index.ts: -------------------------------------------------------------------------------- 1 | export { ActivitySection } from "./ActivitySection"; 2 | -------------------------------------------------------------------------------- /frontend/src/screens/Datasets/SmartDatasetCreator.tsx: -------------------------------------------------------------------------------- 1 | // 重新导出重构后的组件 2 | export { SmartDatasetCreator } from './SmartDatasetCreator/index'; -------------------------------------------------------------------------------- /frontend/src/screens/DataGovernance/ProjectDetail.tsx: -------------------------------------------------------------------------------- 1 | // 重新导出ProjectDetail组件 2 | export { ProjectDetail } from './ProjectDetail/ProjectDetail'; -------------------------------------------------------------------------------- /run.py: -------------------------------------------------------------------------------- 1 | from app import create_app 2 | 3 | app = create_app() 4 | 5 | if __name__ == '__main__': 6 | app.run(host='0.0.0.0', port=5000, debug=True) -------------------------------------------------------------------------------- /frontend/src/components/auth/index.ts: -------------------------------------------------------------------------------- 1 | export { ProtectedRoute, PermissionGuard } from './ProtectedRoute'; 2 | export { AuthProvider } from './AuthProvider'; -------------------------------------------------------------------------------- /frontend/src/components/MediaFileDetails/dialogs/index.ts: -------------------------------------------------------------------------------- 1 | export { AIQuestionDialog } from './AIQuestionDialog'; 2 | export { ObjectDetectionDialog } from './ObjectDetectionDialog'; -------------------------------------------------------------------------------- /frontend/src/i18n/locales/ja/actions.json: -------------------------------------------------------------------------------- 1 | { 2 | "createDataset": "データセットを作成", 3 | "startNewTask": "新しいタスクを開始", 4 | "edit": "編集", 5 | "delete": "削除", 6 | "view": "表示" 7 | } -------------------------------------------------------------------------------- /frontend/src/i18n/locales/zh/actions.json: -------------------------------------------------------------------------------- 1 | { 2 | "createDataset": "创建数据集", 3 | "smartCreateDataset": "智能创建数据集", 4 | "startNewTask": "开始新任务", 5 | "edit": "编辑", 6 | "delete": "删除", 7 | "view": "查看" 8 | } -------------------------------------------------------------------------------- /frontend/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [], 3 | "references": [ 4 | { 5 | "path": "./tsconfig.app.json" 6 | }, 7 | { 8 | "path": "./tsconfig.node.json" 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /frontend/src/components/DataPreview/index.ts: -------------------------------------------------------------------------------- 1 | export { DataPreview } from './DataPreview'; 2 | export { DataPreviewContainer } from './DataPreviewContainer'; 3 | export type { DataPreviewProps } from './DataPreview'; -------------------------------------------------------------------------------- /frontend/src/lib/utils.ts: -------------------------------------------------------------------------------- 1 | import { type ClassValue, clsx } from "clsx"; 2 | import { twMerge } from "tailwind-merge"; 3 | 4 | export function cn(...inputs: ClassValue[]) { 5 | return twMerge(clsx(inputs)); 6 | } 7 | -------------------------------------------------------------------------------- /frontend/src/screens/DataGovernance/index.ts: -------------------------------------------------------------------------------- 1 | export { DataGovernanceProjects } from './DataGovernanceProjects'; 2 | export { ProjectDetail } from './ProjectDetail'; 3 | export { CreateProject } from './CreateProject'; -------------------------------------------------------------------------------- /frontend/src/screens/Datasets/index.tsx: -------------------------------------------------------------------------------- 1 | export { Datasets } from './Datasets'; 2 | export { DatasetDetail } from './DatasetDetail'; 3 | export { CreateDataset } from './CreateDataset'; 4 | export { DatasetTasks } from './DatasetTasks'; -------------------------------------------------------------------------------- /frontend/src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | interface ImportMetaEnv { 4 | readonly VITE_API_BASE_URL: string 5 | // 更多环境变量... 6 | } 7 | 8 | interface ImportMeta { 9 | readonly env: ImportMetaEnv 10 | } -------------------------------------------------------------------------------- /frontend/src/i18n/locales/en/actions.json: -------------------------------------------------------------------------------- 1 | { 2 | "createDataset": "Create Dataset", 3 | "smartCreateDataset": "Smart Create Dataset", 4 | "startNewTask": "Start New Task", 5 | "edit": "Edit", 6 | "delete": "Delete", 7 | "view": "View" 8 | } -------------------------------------------------------------------------------- /frontend/src/i18n/locales/ja/time.json: -------------------------------------------------------------------------------- 1 | { 2 | "justNow": "たった今", 3 | "minutesAgo": "{{count}}分前", 4 | "hoursAgo": "{{count}}時間前", 5 | "daysAgo": "{{count}}日前", 6 | "weeksAgo": "{{count}}週間前", 7 | "monthsAgo": "{{count}}ヶ月前", 8 | "yearsAgo": "{{count}}年前" 9 | } -------------------------------------------------------------------------------- /frontend/src/i18n/locales/ja/navigation.json: -------------------------------------------------------------------------------- 1 | { 2 | "overview": "概要", 3 | "datasets": "データセット", 4 | "tasks": "タスク", 5 | "rawData": "生データ", 6 | "plugins": "プラグイン", 7 | "settings": "設定", 8 | "storage": "ストレージ", 9 | "expand": "サイドバーを展開", 10 | "collapse": "サイドバーを折りたたみ" 11 | } -------------------------------------------------------------------------------- /frontend/src/i18n/locales/zh/navigation.json: -------------------------------------------------------------------------------- 1 | { 2 | "overview": "概览", 3 | "datasets": "数据集", 4 | "tasks": "任务", 5 | "rawData": "原始数据", 6 | "governance": "数据治理(开发中)", 7 | "plugins": "插件", 8 | "settings": "设置", 9 | "storage": "存储", 10 | "expand": "展开侧边栏", 11 | "collapse": "收起侧边栏" 12 | } -------------------------------------------------------------------------------- /frontend/src/screens/DataGovernance/components/index.ts: -------------------------------------------------------------------------------- 1 | export { TeamManagement } from './TeamManagement'; 2 | export { DataPipelineVisualization } from './DataPipelineVisualization'; 3 | export { ProjectCreationWizard } from './ProjectCreationWizard'; 4 | export { ProjectDataIntegration } from './ProjectDataIntegration'; -------------------------------------------------------------------------------- /frontend/src/screens/Settings/components/index.ts: -------------------------------------------------------------------------------- 1 | export { LLMConfigComponent } from './LLMConfig'; 2 | export { SystemLogs } from './SystemLogs'; 3 | export { UserProfile } from './UserProfile'; 4 | export { SessionManagement } from './SessionManagement'; 5 | export { UserAdministration } from './UserAdministration'; -------------------------------------------------------------------------------- /frontend/src/i18n/locales/en/navigation.json: -------------------------------------------------------------------------------- 1 | { 2 | "overview": "Overview", 3 | "datasets": "Datasets", 4 | "tasks": "Tasks", 5 | "rawData": "Raw Data", 6 | "plugins": "Plugins", 7 | "settings": "Settings", 8 | "storage": "Storage", 9 | "expand": "Expand Sidebar", 10 | "collapse": "Collapse Sidebar" 11 | } -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | backend: CONDA_PATH=$(conda info --base); cd backend && $CONDA_PATH/envs/pindata-env/bin/python run.py 2 | celery: CONDA_PATH=$(conda info --base); cd backend && $CONDA_PATH/envs/pindata-env/bin/celery -A celery_worker.celery worker --loglevel=info --pool=threads --concurrency=4 -n worker@%h 3 | frontend: cd frontend && pnpm run dev -------------------------------------------------------------------------------- /frontend/Dockerfile.dev: -------------------------------------------------------------------------------- 1 | FROM node:18-alpine 2 | 3 | WORKDIR /app 4 | 5 | # 安装 pnpm 6 | RUN npm install -g pnpm 7 | 8 | # 复制依赖文件 9 | COPY package.json pnpm-lock.yaml ./ 10 | 11 | # 安装依赖 12 | RUN pnpm install --frozen-lockfile 13 | 14 | # 暴露端口 15 | EXPOSE 3000 16 | 17 | # 开发模式启动命令 18 | CMD ["pnpm", "dev", "--host", "0.0.0.0"] -------------------------------------------------------------------------------- /frontend/src/screens/RawData/LibraryDetails/index.ts: -------------------------------------------------------------------------------- 1 | export { LibraryDetails } from './LibraryDetails'; 2 | export { ConvertToMarkdownDialog } from './components/ConvertToMarkdownDialog'; 3 | export { ConversionProgress } from './components/ConversionProgress'; 4 | export type { ConversionConfig } from './components/ConvertToMarkdownDialog'; -------------------------------------------------------------------------------- /frontend/src/screens/DataGovernance/ProjectDetail/index.ts: -------------------------------------------------------------------------------- 1 | export { ProjectDetail } from './ProjectDetail'; 2 | export { RawDataTab } from './RawDataTab'; 3 | export { GovernedDataTab } from './GovernedDataTab'; 4 | export { KnowledgeTab } from './KnowledgeTab'; 5 | export { DatasetsTab } from './DatasetsTab'; 6 | export { AnalyticsTab } from './AnalyticsTab'; -------------------------------------------------------------------------------- /frontend/vite.config.ts: -------------------------------------------------------------------------------- 1 | import react from "@vitejs/plugin-react"; 2 | import tailwind from "tailwindcss"; 3 | import { defineConfig } from "vite"; 4 | 5 | // https://vite.dev/config/ 6 | export default defineConfig({ 7 | plugins: [react()], 8 | base: "./", 9 | css: { 10 | postcss: { 11 | plugins: [tailwind()], 12 | }, 13 | }, 14 | }); 15 | -------------------------------------------------------------------------------- /backend/app/api/v1/__init__.py: -------------------------------------------------------------------------------- 1 | from flask import Blueprint 2 | 3 | api_v1 = Blueprint('api_v1', __name__) 4 | 5 | # 导入所有端点 6 | from .endpoints import datasets, tasks, plugins, raw_data, overview, libraries, llm_configs, system_logs, conversion_jobs, enhanced_datasets, auth, users, organizations, roles, annotations, image_annotations, data_governance, llm_test, dataflow 7 | -------------------------------------------------------------------------------- /docker/data/README.md: -------------------------------------------------------------------------------- 1 | # 数据卷 2 | 3 | ## 数据卷说明 4 | 5 | - postgres_data: 数据库数据 6 | - minio_data: 对象存储数据 7 | - redis_data: 缓存数据 8 | - api_data: 后端数据 9 | - celery_data: 任务数据 10 | 11 | ## data volume 12 | 13 | - postgres_data: db data 14 | - minio_data: object storage data 15 | - redis_data: cache data 16 | - api_data: backend data 17 | - celery_data: task data 18 | -------------------------------------------------------------------------------- /backend/celery_worker.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Celery Worker启动脚本""" 3 | import os 4 | import sys 5 | 6 | # 添加项目路径到 Python 路径 7 | sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) 8 | 9 | from app.celery_app import celery 10 | 11 | # 任务会通过include自动发现,不需要显式导入 12 | 13 | if __name__ == '__main__': 14 | # 启动 Celery Worker 15 | celery.start() -------------------------------------------------------------------------------- /frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? -------------------------------------------------------------------------------- /frontend/src/index.tsx: -------------------------------------------------------------------------------- 1 | import { StrictMode } from "react"; 2 | import { createRoot } from "react-dom/client"; 3 | import { BrowserRouter as Router } from "react-router-dom"; 4 | import { App } from "./App"; 5 | import './i18n'; 6 | 7 | createRoot(document.getElementById("app") as HTMLElement).render( 8 | 9 | 10 | 11 | 12 | , 13 | ); -------------------------------------------------------------------------------- /backend/app/tasks/__init__.py: -------------------------------------------------------------------------------- 1 | from .conversion_tasks import process_conversion_job 2 | from .dataset_import_tasks import import_dataset_task 3 | from .dataset_generation_tasks import generate_dataset_task 4 | # from .multimodal_dataset_tasks import generate_multimodal_dataset_task # 暂时移除 5 | 6 | __all__ = ['process_conversion_job', 'import_dataset_task', 'generate_dataset_task'] # , 'generate_multimodal_dataset_task' -------------------------------------------------------------------------------- /frontend/src/screens/StitchDesign/StitchDesign.tsx: -------------------------------------------------------------------------------- 1 | // frontend/src/screens/StitchDesign/StitchDesign.tsx 2 | 3 | import React from 'react'; 4 | import { ActivitySection } from './sections/ActivitySection'; 5 | 6 | /** 7 | * StitchDesign组件 8 | * 9 | * @returns {JSX.Element} StitchDesign页面 10 | */ 11 | export const StitchDesign: React.FC = (): JSX.Element => { 12 | return ( 13 | 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /frontend/src/components/MediaFileDetails/index.ts: -------------------------------------------------------------------------------- 1 | export { MediaFileDetailsContainer } from './MediaFileDetailsContainer'; 2 | export { ImagePreviewPanel } from './ImagePreviewPanel'; 3 | export { VideoPreviewPanel } from './VideoPreviewPanel'; 4 | export { MediaAnnotationPanel } from './MediaAnnotationPanel'; 5 | export { FileMetadataPanel } from './FileMetadataPanel'; 6 | export { ProcessingHistoryPanel } from './ProcessingHistoryPanel'; 7 | export * from './dialogs'; -------------------------------------------------------------------------------- /backend/start_celery.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 启动 Celery Worker 脚本 4 | 5 | echo "Starting Celery Worker..." 6 | 7 | # 设置环境变量 8 | export FLASK_APP=run.py 9 | export FLASK_ENV=development 10 | 11 | # macOS 兼容性设置 12 | export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES 13 | 14 | # 启动 Celery Worker 15 | # -A: 指定 Celery 应用 16 | # -l: 日志级别 17 | # -c: 并发数(worker 进程数) 18 | # -n: worker 名称 19 | celery -A celery_worker.celery worker --loglevel=info --concurrency=4 -n worker@%h -------------------------------------------------------------------------------- /docker/reset-redis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "停止Redis容器..." 4 | docker compose -f docker compose.yml down redis 5 | 6 | echo "清理Redis数据卷..." 7 | docker volume rm docker_redis_data 2>/dev/null || true 8 | 9 | echo "重新启动Redis..." 10 | docker compose -f docker compose.yml up -d redis 11 | 12 | echo "等待Redis启动..." 13 | sleep 3 14 | 15 | echo "检查Redis状态..." 16 | docker compose -f docker compose.yml logs --tail=20 redis 17 | 18 | echo "测试Redis连接..." 19 | docker exec llama_redis redis-cli ping -------------------------------------------------------------------------------- /frontend/public/vector---0-6.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /frontend/src/screens/Datasets/SmartDatasetCreator/components/index.ts: -------------------------------------------------------------------------------- 1 | export { StepIndicator } from './StepIndicator'; 2 | export { Step1DataSelection } from './Step1DataSelection'; 3 | export { Step2DatasetConfig } from './Step2DatasetConfig'; 4 | export { Step3ModelConfig } from './Step3ModelConfig'; 5 | export { Step4PreviewConfirm } from './Step4PreviewConfirm'; 6 | export { Step5Generation } from './Step5Generation'; 7 | export { NavigationButtons } from './NavigationButtons'; 8 | export { ErrorMessage } from './ErrorMessage'; 9 | export { FormatDetailsModal } from './FormatDetailsModal'; -------------------------------------------------------------------------------- /frontend/src/i18n/locales/zh/common.json: -------------------------------------------------------------------------------- 1 | { 2 | "appName": "拼好数", 3 | "cancel": "取消", 4 | "save": "保存", 5 | "delete": "删除", 6 | "justNow": "刚刚", 7 | "pageNotFound": "页面未找到", 8 | "loading": "加载中...", 9 | "error": "错误", 10 | "retry": "重试", 11 | "refresh": "刷新", 12 | "close": "关闭", 13 | "confirm": "确认", 14 | "edit": "编辑", 15 | "view": "查看", 16 | "actions": "操作", 17 | "status": "状态", 18 | "name": "名称", 19 | "description": "描述", 20 | "size": "大小", 21 | "type": "类型", 22 | "create": "创建", 23 | "upload": "上传", 24 | "download": "下载", 25 | "preview": "预览" 26 | } -------------------------------------------------------------------------------- /frontend/src/components/ui/progress.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { cn } from "../../lib/utils"; 3 | 4 | interface ProgressProps { 5 | value: number; 6 | className?: string; 7 | } 8 | 9 | export const Progress: React.FC = ({ value, className }) => { 10 | return ( 11 |
12 |
16 |
17 | ); 18 | }; -------------------------------------------------------------------------------- /frontend/Dockerfile: -------------------------------------------------------------------------------- 1 | # 第一阶段:构建阶段 2 | FROM node:18-alpine AS builder 3 | 4 | WORKDIR /app 5 | 6 | # 安装 pnpm 7 | RUN npm install -g pnpm 8 | 9 | # 复制依赖文件 10 | COPY package.json pnpm-lock.yaml ./ 11 | 12 | # 安装依赖 13 | RUN pnpm install --frozen-lockfile 14 | 15 | # 复制源代码 16 | COPY . . 17 | 18 | # 构建应用 19 | RUN pnpm run build 20 | 21 | # 第二阶段:生产阶段 22 | FROM nginx:alpine AS production 23 | 24 | # 复制构建产物到 nginx 25 | COPY --from=builder /app/dist /usr/share/nginx/html 26 | 27 | # 复制 nginx 配置 28 | COPY nginx.conf /etc/nginx/nginx.conf 29 | 30 | # 暴露端口 31 | EXPOSE 80 32 | 33 | # 启动 nginx 34 | CMD ["nginx", "-g", "daemon off;"] -------------------------------------------------------------------------------- /frontend/.dockerignore: -------------------------------------------------------------------------------- 1 | # 依赖目录 2 | node_modules/ 3 | npm-debug.log* 4 | yarn-debug.log* 5 | yarn-error.log* 6 | 7 | # 构建输出 8 | dist/ 9 | build/ 10 | 11 | # 环境文件 12 | .env 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | # 编辑器和IDE 19 | .vscode/ 20 | .idea/ 21 | *.swp 22 | *.swo 23 | *~ 24 | 25 | # 操作系统 26 | .DS_Store 27 | .DS_Store? 28 | ._* 29 | .Spotlight-V100 30 | .Trashes 31 | ehthumbs.db 32 | Thumbs.db 33 | 34 | # 日志文件 35 | *.log 36 | 37 | # 测试覆盖率 38 | coverage/ 39 | 40 | # 临时文件 41 | *.tmp 42 | *.temp 43 | 44 | # Git 45 | .git/ 46 | .gitignore 47 | 48 | # 其他 49 | README.md 50 | .bolt/ -------------------------------------------------------------------------------- /frontend/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | pindata 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /frontend/src/i18n/locales/en/common.json: -------------------------------------------------------------------------------- 1 | { 2 | "appName": "pindata", 3 | "cancel": "Cancel", 4 | "save": "Save", 5 | "delete": "Delete", 6 | "justNow": "Just now", 7 | "pageNotFound": "Page not found", 8 | "loading": "Loading...", 9 | "error": "Error", 10 | "retry": "Retry", 11 | "refresh": "Refresh", 12 | "close": "Close", 13 | "confirm": "Confirm", 14 | "edit": "Edit", 15 | "view": "View", 16 | "actions": "Actions", 17 | "status": "Status", 18 | "name": "Name", 19 | "description": "Description", 20 | "size": "Size", 21 | "type": "Type", 22 | "create": "Create", 23 | "upload": "Upload", 24 | "download": "Download", 25 | "preview": "Preview" 26 | } -------------------------------------------------------------------------------- /frontend/src/i18n/locales/ja/common.json: -------------------------------------------------------------------------------- 1 | { 2 | "cancel": "キャンセル", 3 | "save": "保存", 4 | "delete": "削除", 5 | "edit": "編集", 6 | "create": "作成", 7 | "update": "更新", 8 | "refresh": "更新", 9 | "loading": "読み込み中...", 10 | "saving": "保存中...", 11 | "creating": "作成中...", 12 | "updating": "更新中...", 13 | "deleting": "削除中...", 14 | "processing": "処理中...", 15 | "confirm": "確認", 16 | "success": "成功", 17 | "error": "エラー", 18 | "warning": "警告", 19 | "info": "情報", 20 | "unknown": "不明", 21 | "never": "なし", 22 | "primary": "プライマリ", 23 | "actions": "アクション", 24 | "noPermission": "この機能にアクセスする権限がありません", 25 | "justNow": "たった今", 26 | "pageNotFound": "ページが見つかりません" 27 | } -------------------------------------------------------------------------------- /frontend/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", 4 | "target": "ES2022", 5 | "lib": [ 6 | "ES2023" 7 | ], 8 | "module": "ESNext", 9 | "skipLibCheck": true, 10 | "moduleResolution": "bundler", 11 | "allowImportingTsExtensions": true, 12 | "isolatedModules": true, 13 | "moduleDetection": "force", 14 | "noEmit": true, 15 | "strict": true, 16 | "noUnusedLocals": true, 17 | "noUnusedParameters": true, 18 | "noFallthroughCasesInSwitch": true, 19 | "noUncheckedSideEffectImports": true 20 | }, 21 | "include": [ 22 | "vite.config.ts" 23 | ] 24 | } -------------------------------------------------------------------------------- /frontend/src/components/ui/main-content-layout.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | interface MainContentLayoutProps { 4 | children: React.ReactNode; 5 | isFullWidth?: boolean; 6 | className?: string; 7 | } 8 | 9 | export const MainContentLayout = ({ 10 | children, 11 | isFullWidth = false, 12 | className = "" 13 | }: MainContentLayoutProps): JSX.Element => { 14 | return ( 15 |
20 |
21 | {children} 22 |
23 |
24 | ); 25 | }; -------------------------------------------------------------------------------- /frontend/public/vector---0-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /frontend/src/services/index.ts: -------------------------------------------------------------------------------- 1 | // 导出所有服务 2 | export { libraryService } from './library.service'; 3 | export { systemLogService } from './systemLog.service'; 4 | export { llmService } from './llm.service'; 5 | export { fileService } from './file.service'; 6 | export { overviewService } from './overview.service'; 7 | export { authService } from './auth.service'; 8 | export type { User, Role, Organization, UserSession, LoginRequest, RegisterRequest, LoginResponse, ChangePasswordRequest } from './auth.service'; 9 | 10 | // 导出所有Hooks 11 | export * from '../hooks/useLibraries'; 12 | 13 | // 导出所有类型 14 | export * from '../types/api'; 15 | export * from '../types/library'; 16 | 17 | // 导出配置 18 | export * from '../lib/config'; 19 | export { apiClient } from '../lib/api-client'; -------------------------------------------------------------------------------- /backend/alembic/script.py.mako: -------------------------------------------------------------------------------- 1 | """${message} 2 | 3 | Revision ID: ${up_revision} 4 | Revises: ${down_revision | comma,n} 5 | Create Date: ${create_date} 6 | 7 | """ 8 | from typing import Sequence, Union 9 | 10 | from alembic import op 11 | import sqlalchemy as sa 12 | ${imports if imports else ""} 13 | 14 | # revision identifiers, used by Alembic. 15 | revision: str = ${repr(up_revision)} 16 | down_revision: Union[str, None] = ${repr(down_revision)} 17 | branch_labels: Union[str, Sequence[str], None] = ${repr(branch_labels)} 18 | depends_on: Union[str, Sequence[str], None] = ${repr(depends_on)} 19 | 20 | 21 | def upgrade() -> None: 22 | ${upgrades if upgrades else "pass"} 23 | 24 | 25 | def downgrade() -> None: 26 | ${downgrades if downgrades else "pass"} 27 | -------------------------------------------------------------------------------- /frontend/src/i18n/index.ts: -------------------------------------------------------------------------------- 1 | import i18n from 'i18next'; 2 | import { initReactI18next } from 'react-i18next'; 3 | import LanguageDetector from 'i18next-browser-languagedetector'; 4 | import enTranslations from './locales/en'; 5 | import zhTranslations from './locales/zh'; 6 | import jaTranslations from './locales/ja'; 7 | 8 | i18n 9 | .use(LanguageDetector) 10 | .use(initReactI18next) 11 | .init({ 12 | resources: { 13 | en: { 14 | translation: enTranslations 15 | }, 16 | zh: { 17 | translation: zhTranslations 18 | }, 19 | ja: { 20 | translation: jaTranslations 21 | } 22 | }, 23 | fallbackLng: 'en', 24 | interpolation: { 25 | escapeValue: false 26 | } 27 | }); 28 | 29 | export default i18n; -------------------------------------------------------------------------------- /frontend/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", 4 | "target": "ES2020", 5 | "useDefineForClassFields": true, 6 | "lib": [ 7 | "ES2020", 8 | "DOM", 9 | "DOM.Iterable" 10 | ], 11 | "module": "ESNext", 12 | "skipLibCheck": true, 13 | "moduleResolution": "bundler", 14 | "allowImportingTsExtensions": true, 15 | "isolatedModules": true, 16 | "moduleDetection": "force", 17 | "noEmit": true, 18 | "jsx": "react-jsx", 19 | "strict": true, 20 | "noUnusedLocals": true, 21 | "noUnusedParameters": true, 22 | "noFallthroughCasesInSwitch": true, 23 | "noUncheckedSideEffectImports": true 24 | }, 25 | "include": [ 26 | "src" 27 | ] 28 | } -------------------------------------------------------------------------------- /backend/app/plugins/base_plugin.py: -------------------------------------------------------------------------------- 1 | """插件基类定义""" 2 | from abc import ABC, abstractmethod 3 | from typing import Any, Dict 4 | 5 | class BasePlugin(ABC): 6 | """所有插件的基类""" 7 | 8 | def __init__(self, config: Dict[str, Any] = None): 9 | """初始化插件 10 | 11 | Args: 12 | config: 插件配置参数 13 | """ 14 | self.config = config or {} 15 | 16 | @abstractmethod 17 | def process(self, data: Any) -> Any: 18 | """处理数据的抽象方法 19 | 20 | Args: 21 | data: 输入数据 22 | 23 | Returns: 24 | 处理后的数据 25 | """ 26 | pass 27 | 28 | def validate_config(self) -> bool: 29 | """验证配置是否有效 30 | 31 | Returns: 32 | 配置是否有效 33 | """ 34 | return True -------------------------------------------------------------------------------- /frontend/src/i18n/locales/zh/annotation.json: -------------------------------------------------------------------------------- 1 | { 2 | "imageAnnotation": "图片标注", 3 | "videoAnnotation": "视频标注", 4 | "qa": "问答标注", 5 | "caption": "图片描述", 6 | "transcript": "视频字幕", 7 | "question": "问题", 8 | "answer": "答案", 9 | "confidence": "置信度", 10 | "newQuestion": "新问题", 11 | "newAnswer": "新答案", 12 | "addQA": "添加问答", 13 | "questionPlaceholder": "请输入问题...", 14 | "answerPlaceholder": "请输入答案...", 15 | "captionPlaceholder": "请输入图片描述...", 16 | "transcriptPlaceholder": "请输入视频字幕...", 17 | "aiAssist": "AI 辅助标注", 18 | "aiAssistTitle": "AI 辅助标注", 19 | "aiPrompt": "提示词", 20 | "aiPromptPlaceholder": "请输入提示词,帮助 AI 生成更准确的标注...", 21 | "generate": "生成标注", 22 | "aiAssistSuccess": "AI 辅助标注成功", 23 | "aiAnnotationsGenerated": "AI 已生成标注,置信度:{confidence}", 24 | "aiAssistFailed": "AI 辅助标注失败", 25 | "aiAnnotationsFailed": "AI 生成标注失败,请重试" 26 | } -------------------------------------------------------------------------------- /frontend/src/i18n/locales/en/index.ts: -------------------------------------------------------------------------------- 1 | import common from './common.json'; 2 | import navigation from './navigation.json'; 3 | import overview from './overview.json'; 4 | import settings from './settings.json'; 5 | import rawData from './rawData.json'; 6 | import datasets from './datasets.json'; 7 | import tasks from './tasks.json'; 8 | import smartDatasetCreator from './smartDatasetCreator.json'; 9 | import dataPreview from './dataPreview.json'; 10 | import libraryDetails from './libraryDetails.json'; 11 | import time from './time.json'; 12 | import actions from './actions.json'; 13 | import auth from './auth.json'; 14 | 15 | export default { 16 | common, 17 | navigation, 18 | overview, 19 | settings, 20 | rawData, 21 | datasets, 22 | tasks, 23 | smartDatasetCreator, 24 | dataPreview, 25 | libraryDetails, 26 | time, 27 | actions, 28 | auth 29 | }; -------------------------------------------------------------------------------- /frontend/src/i18n/locales/ja/index.ts: -------------------------------------------------------------------------------- 1 | import common from './common.json'; 2 | import navigation from './navigation.json'; 3 | import overview from './overview.json'; 4 | import settings from './settings.json'; 5 | import rawData from './rawData.json'; 6 | import datasets from './datasets.json'; 7 | import tasks from './tasks.json'; 8 | import smartDatasetCreator from './smartDatasetCreator.json'; 9 | import dataPreview from './dataPreview.json'; 10 | import libraryDetails from './libraryDetails.json'; 11 | import time from './time.json'; 12 | import actions from './actions.json'; 13 | import auth from './auth.json'; 14 | 15 | export default { 16 | common, 17 | navigation, 18 | overview, 19 | settings, 20 | rawData, 21 | datasets, 22 | tasks, 23 | smartDatasetCreator, 24 | dataPreview, 25 | libraryDetails, 26 | time, 27 | actions, 28 | auth 29 | }; -------------------------------------------------------------------------------- /frontend/src/screens/Datasets/SmartDatasetCreator/components/ErrorMessage.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Card } from '../../../../components/ui/card'; 3 | import { AlertCircle } from 'lucide-react'; 4 | import { useSmartDatasetCreatorStore } from '../store/useSmartDatasetCreatorStore'; 5 | 6 | export const ErrorMessage: React.FC = () => { 7 | const error = useSmartDatasetCreatorStore(state => state.error); 8 | 9 | if (!error) return null; 10 | 11 | return ( 12 | 13 |
14 |
15 | 16 | 错误 17 |
18 |

{error}

19 |
20 |
21 | ); 22 | }; -------------------------------------------------------------------------------- /frontend/README.md: -------------------------------------------------------------------------------- 1 | # Anima Project 2 | 3 | Welcome! This project has been automatically generated by [Anima](https://animaapp.com/). 4 | 5 | ## Getting started 6 | 7 | > **Prerequisites:** 8 | > The following steps require [NodeJS](https://nodejs.org/en/) to be installed on your system, so please 9 | > install it beforehand if you haven't already. 10 | 11 | To get started with your project, you'll first need to install the dependencies with: 12 | 13 | ``` 14 | npm install 15 | ``` 16 | 17 | Then, you'll be able to run a development version of the project with: 18 | 19 | ``` 20 | npm run dev 21 | ``` 22 | 23 | After a few seconds, your project should be accessible at the address 24 | [http://localhost:5173/](http://localhost:5173/) 25 | 26 | 27 | If you are satisfied with the result, you can finally build the project for release with: 28 | 29 | ``` 30 | npm run build 31 | ``` 32 | -------------------------------------------------------------------------------- /frontend/src/components/ui/textarea.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { cn } from "../../lib/utils"; 3 | 4 | export interface TextareaProps 5 | extends React.TextareaHTMLAttributes {} 6 | 7 | const Textarea = React.forwardRef( 8 | ({ className, ...props }, ref) => { 9 | return ( 10 |