feat: 初始化项目结构并添加核心功能模块

- 新增文档模板和导航结构
- 实现服务器基础API路由和控制器
- 添加扩展插件配置和前端框架
- 引入多租户和权限管理模块
- 集成日志和数据库配置
- 添加核心业务模型和类型定义
This commit is contained in:
2026-03-17 22:07:19 +08:00
parent c0870dce50
commit 136c2fa579
728 changed files with 107690 additions and 5614 deletions

12
extension/index.html Normal file
View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>TEMU 卖家助手</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/popup/index.tsx"></script>
</body>
</html>

47
extension/manifest.json Normal file
View File

@@ -0,0 +1,47 @@
{
"manifest_version": 3,
"name": "Crawlful: 全球电商增长助手",
"version": "1.0.0",
"description": "集全网采集、AI 语义标准化、多平台自动化铺货于一体的跨境电商增长中台。",
"action": {
"default_popup": "index.html"
},
"permissions": [
"storage",
"activeTab",
"scripting",
"notifications"
],
"host_permissions": [
"https://agentseller.temu.com/*",
"https://seller.temu.com/*",
"https://*.tiktok.com/*",
"https://shopee.com.my/*",
"https://shopee.tw/*",
"https://shopee.vn/*",
"https://shopee.ph/*",
"https://shopee.co.th/*",
"https://shopee.com.br/*",
"http://localhost:3003/*",
"http://localhost:8080/*"
],
"background": {
"service_worker": "src/background/index.ts",
"type": "module"
},
"content_scripts": [
{
"matches": [
"https://agentseller.temu.com/*",
"https://*.tiktok.com/*",
"https://shopee.com.my/*",
"https://shopee.tw/*",
"https://shopee.vn/*",
"https://shopee.ph/*",
"https://shopee.co.th/*",
"https://shopee.com.br/*"
],
"js": ["src/content/index.ts"]
}
]
}

5271
extension/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

49
extension/package.json Normal file
View File

@@ -0,0 +1,49 @@
{
"name": "temu-seller-assistant",
"private": true,
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"start": "npm run dev",
"build": "tsc && vite build",
"build:watch": "vite build --watch",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"zip": "npm run build && node ./scripts/zip.js",
"clean": "rimraf dist out"
},
"dependencies": {
"@tanstack/react-query": "^5.90.21",
"@tanstack/react-query-devtools": "^5.91.3",
"axios": "^1.6.0",
"clsx": "^2.0.0",
"dexie": "^4.3.0",
"dexie-react-hooks": "^4.2.0",
"lucide-react": "^0.292.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tailwind-merge": "^2.0.0",
"zustand": "^4.4.0"
},
"devDependencies": {
"@crxjs/vite-plugin": "^2.0.0-beta.21",
"@types/chrome": "^0.0.250",
"@types/node": "^25.3.3",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vitejs/plugin-react": "^4.0.0",
"adm-zip": "^0.5.16",
"autoprefixer": "^10.4.16",
"eslint": "^8.45.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"postcss": "^8.4.31",
"rimraf": "^6.1.3",
"tailwindcss": "^3.3.5",
"typescript": "^5.0.0",
"vite": "^5.0.0"
}
}

View File

@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

View File

@@ -0,0 +1,11 @@
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}

25
extension/tsconfig.json Normal file
View File

@@ -0,0 +1,25 @@
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": false,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
}

View File

@@ -0,0 +1,11 @@
{
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"types": ["node"]
},
"include": ["vite.config.ts"]
}

24
extension/vite.config.ts Normal file
View File

@@ -0,0 +1,24 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { crx } from '@crxjs/vite-plugin';
import manifest from './manifest.json';
import { resolve } from 'path';
export default defineConfig({
plugins: [
react(),
crx({ manifest }),
],
resolve: {
alias: {
'@': resolve(__dirname, './src'),
},
},
server: {
port: 5173,
strictPort: true,
hmr: {
port: 5173,
},
},
});