diff --git a/apps/web/index.html b/apps/web/index.html new file mode 100644 index 000000000..8805a8961 --- /dev/null +++ b/apps/web/index.html @@ -0,0 +1,13 @@ + + + + + + + 小虾 SaaS - 自动化视频剪辑平台 + + +
+ + + diff --git a/apps/web/package.json b/apps/web/package.json index 4c5dbf067..60aa007ea 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -2,23 +2,34 @@ "name": "@xiaoxia/web", "private": true, "version": "0.1.0", + "type": "module", "scripts": { - "dev": "next dev -p 3000", - "build": "next build", - "start": "next start -p 3000", - "lint": "next lint" + "dev": "vite", + "build": "tsc && vite build", + "preview": "vite preview", + "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0" }, "dependencies": { - "next": "14.2.5", - "react": "18.3.1", - "react-dom": "18.3.1" + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-router-dom": "^6.24.0", + "antd": "^5.18.0", + "zustand": "^4.5.2", + "axios": "^1.7.2", + "@tanstack/react-query": "^5.45.0", + "react-hook-form": "^7.52.0", + "zod": "^3.23.8" }, "devDependencies": { - "typescript": "5.5.4", - "@types/node": "22.7.4", - "@types/react": "18.3.3", - "@types/react-dom": "18.3.0", - "eslint": "8.57.1", - "eslint-config-next": "14.2.5" + "@types/react": "^18.3.3", + "@types/react-dom": "^18.3.0", + "@vitejs/plugin-react": "^4.3.1", + "typescript": "^5.5.3", + "vite": "^5.3.1", + "eslint": "^8.57.0", + "@typescript-eslint/eslint-plugin": "^7.13.0", + "@typescript-eslint/parser": "^7.13.0", + "eslint-plugin-react-hooks": "^4.6.2", + "eslint-plugin-react-refresh": "^0.4.7" } } diff --git a/apps/web/src/App.css b/apps/web/src/App.css new file mode 100644 index 000000000..d82b09dc3 --- /dev/null +++ b/apps/web/src/App.css @@ -0,0 +1,14 @@ +.App { + max-width: 1280px; + margin: 0 auto; + padding: 2rem; + text-align: center; +} + +.card { + padding: 2em; +} + +.read-the-docs { + color: #888; +} diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx new file mode 100644 index 000000000..f6939bbc9 --- /dev/null +++ b/apps/web/src/App.tsx @@ -0,0 +1,23 @@ +import { useState } from 'react' +import './App.css' + +function App() { + const [count, setCount] = useState(0) + + return ( +
+

小虾 SaaS

+

自动化视频剪辑平台

+
+ +
+

+ Phase 6: 前端开发中... +

+
+ ) +} + +export default App diff --git a/apps/web/src/index.css b/apps/web/src/index.css new file mode 100644 index 000000000..f376d2ac7 --- /dev/null +++ b/apps/web/src/index.css @@ -0,0 +1,36 @@ +:root { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', + 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; + line-height: 1.5; + font-weight: 400; + + color-scheme: light dark; + color: rgba(255, 255, 255, 0.87); + background-color: #242424; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + margin: 0; + display: flex; + place-items: center; + min-width: 320px; + min-height: 100vh; +} + +#root { + width: 100%; + margin: 0 auto; + padding: 2rem; + text-align: center; +} diff --git a/apps/web/src/main.tsx b/apps/web/src/main.tsx new file mode 100644 index 000000000..3d7150da8 --- /dev/null +++ b/apps/web/src/main.tsx @@ -0,0 +1,10 @@ +import React from 'react' +import ReactDOM from 'react-dom/client' +import App from './App.tsx' +import './index.css' + +ReactDOM.createRoot(document.getElementById('root')!).render( + + + , +) diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.json index d65eb8588..fb8f04880 100644 --- a/apps/web/tsconfig.json +++ b/apps/web/tsconfig.json @@ -1,20 +1,31 @@ { "compilerOptions": { "target": "ES2020", - "lib": ["dom", "dom.iterable", "es2020"], - "allowJs": false, + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", "skipLibCheck": true, - "strict": true, - "noEmit": true, - "esModuleInterop": true, - "module": "esnext", + + /* Bundler mode */ "moduleResolution": "bundler", + "allowImportingTsExtensions": true, "resolveJsonModule": true, "isolatedModules": true, - "jsx": "preserve", - "incremental": true, - "plugins": [{ "name": "next" }] + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, + + /* Path alias */ + "baseUrl": ".", + "paths": { + "@/*": ["./src/*"] + } }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], - "exclude": ["node_modules"] + "include": ["src"], + "references": [{ "path": "./tsconfig.node.json" }] } diff --git a/apps/web/tsconfig.node.json b/apps/web/tsconfig.node.json new file mode 100644 index 000000000..42872c59f --- /dev/null +++ b/apps/web/tsconfig.node.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "composite": true, + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "bundler", + "allowSyntheticDefaultImports": true + }, + "include": ["vite.config.ts"] +} diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts new file mode 100644 index 000000000..13a51846d --- /dev/null +++ b/apps/web/vite.config.ts @@ -0,0 +1,21 @@ +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [react()], + server: { + port: 3000, + proxy: { + '/api': { + target: 'http://localhost:8000', + changeOrigin: true, + }, + }, + }, + resolve: { + alias: { + '@': '/src', + }, + }, +})