-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #668 from LollipopsAndWine/dev
feat: 集成前端界面,配置一键启动
- Loading branch information
Showing
430 changed files
with
71,212 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,8 @@ ocr_demo | |
source.dev.env | ||
|
||
tmp | ||
|
||
projects/web/node_modules | ||
projects/web/dist | ||
|
||
projects/web_demo/web_demo/static/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# MinerU web | ||
|
||
## Table of Contents | ||
- [Local Frontend Development](#local-frontend-development) | ||
- [Technology Stack](#technology-stack) | ||
|
||
## Local Frontend Development | ||
|
||
### Prerequisites | ||
- Node.js 18.x | ||
- pnpm | ||
|
||
### Installation Steps | ||
|
||
1. Install Node.js 18 | ||
- Visit the [Node.js official website](https://nodejs.org/) to download and install Node.js version 18.x | ||
|
||
2. Install pnpm | ||
```bash | ||
npm install -g pnpm | ||
3. Clone the repository | ||
```git clone https://github.com/opendatalab/MinerU | ||
cd ./projects/web | ||
``` | ||
4. Install dependencies | ||
``` | ||
pnpm install | ||
``` | ||
5. Run the development server | ||
``` | ||
pnpm run dev | ||
``` | ||
6. ⚠️ Note: This command is for local development only, do not use for deployment! | ||
Open your browser and visit http://localhost:5173 (or another address output in the console) | ||
|
||
7. Ensure that the backend service in ./projects/web_demo is running | ||
|
||
8. If you encounter an error when executing `pnpm install`, you can switch to an alternative package manager. | ||
``` | ||
npm install -g yarn | ||
yarn | ||
yarn start | ||
``` | ||
## Building the Project | ||
``` | ||
pnpm run build | ||
``` | ||
## Technology Stack | ||
- React | ||
- Tailwind CSS | ||
- typeScript | ||
- zustand | ||
- ahooks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# MinerU web | ||
|
||
|
||
## 目录 | ||
- [前端本地开发](#前端本地开发) | ||
- [技术栈](#技术栈) | ||
## 前端本地开发 | ||
|
||
### 前置条件 | ||
- Node.js 18.x | ||
- pnpm | ||
|
||
### 安装步骤 | ||
|
||
1. 安装 Node.js 18 | ||
- 访问 [Node.js 官网](https://nodejs.org/) 下载并安装 Node.js 18.x 版本 | ||
|
||
2. 安装 pnpm | ||
```bash | ||
npm install -g pnpm | ||
``` | ||
3. 克隆仓库 | ||
``` | ||
1. git clone https://github.com/opendatalab/MinerU | ||
2. cd ./projects/web | ||
``` | ||
|
||
4. 安装依赖 | ||
``` | ||
pnpm install | ||
``` | ||
|
||
5. 运行开发服务器 | ||
``` | ||
pnpm run dev | ||
``` | ||
|
||
6. ⚠️ 注意:此命令仅用于本地开发,不要用于部署! | ||
打开浏览器访问 http://localhost:5173(或控制台输出的其他地址) | ||
构建项目 | ||
要构建生产版本,请执行以下命令: | ||
|
||
``` | ||
pnpm run build | ||
``` | ||
7. 请确保./projects/web_demo后端服务启动 | ||
|
||
8. 如果pnpm install执行error,可更换包管理器 | ||
``` | ||
npm install -g yarn | ||
yarn | ||
yarn start | ||
``` | ||
|
||
## 技术栈 | ||
|
||
- React | ||
- Tailwind CSS | ||
- typeScript | ||
- zustand | ||
- ahooks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import js from '@eslint/js' | ||
import globals from 'globals' | ||
import reactHooks from 'eslint-plugin-react-hooks' | ||
import reactRefresh from 'eslint-plugin-react-refresh' | ||
import tseslint from 'typescript-eslint' | ||
|
||
export default tseslint.config( | ||
{ ignores: ['dist'] }, | ||
{ | ||
extends: [js.configs.recommended, ...tseslint.configs.recommended], | ||
files: ['**/*.{ts,tsx}'], | ||
languageOptions: { | ||
ecmaVersion: 2020, | ||
globals: globals.browser, | ||
}, | ||
plugins: { | ||
'react-hooks': reactHooks, | ||
'react-refresh': reactRefresh, | ||
}, | ||
rules: { | ||
...reactHooks.configs.recommended.rules, | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
], | ||
}, | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/logo.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>MinerU</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.