Add PDF translation API, utilities, docs, and config

Introduces core backend and frontend infrastructure for a PDF translation interface. Adds API endpoints for translation, PDF testing, and AI provider testing; implements PDF text extraction, cost tracking, and pricing logic in the lib directory; adds reusable UI components; and provides comprehensive documentation (SDD, environment setup, Claude instructions). Updates Tailwind and global styles, and includes a sample test PDF and configuration files.
This commit is contained in:
2025-10-15 23:34:44 +08:00
parent c899702d51
commit 39a4788cc4
21 changed files with 11041 additions and 251 deletions

View File

@@ -4,12 +4,14 @@
"private": true,
"scripts": {
"build": "next build",
"dev": "next dev",
"dev": "next dev --port 3000",
"lint": "eslint .",
"start": "next start"
},
"dependencies": {
"@ai-sdk/openai": "^2.0.52",
"@hookform/resolvers": "^3.10.0",
"@pdf-lib/fontkit": "^1.1.1",
"@radix-ui/react-accordion": "1.2.2",
"@radix-ui/react-alert-dialog": "1.1.4",
"@radix-ui/react-aspect-ratio": "1.1.1",
@@ -40,6 +42,7 @@
"@vercel/analytics": "latest",
"ai": "latest",
"autoprefixer": "^10.4.20",
"canvas": "^3.2.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "1.0.4",
@@ -50,20 +53,29 @@
"lucide-react": "^0.454.0",
"next": "15.2.4",
"next-themes": "latest",
"pdf-lib": "^1.17.1",
"pdf-parse": "^2.3.11",
"pdf-poppler": "^0.2.3",
"pdf2json": "^4.0.0",
"pdf2pic": "^3.2.0",
"pdfjs-dist": "^5.4.296",
"pdfkit": "^0.17.2",
"react": "^19",
"react-day-picker": "9.8.0",
"react-dom": "^19",
"react-hook-form": "^7.60.0",
"react-resizable-panels": "^2.1.7",
"recharts": "2.15.4",
"sharp": "^0.34.4",
"sonner": "^1.7.4",
"tailwind-merge": "^2.5.5",
"tailwindcss-animate": "^1.0.7",
"tesseract.js": "^6.0.1",
"vaul": "^0.9.9",
"zod": "3.25.76"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.1.9",
"@tailwindcss/postcss": "^4.1.14",
"@types/node": "^22",
"@types/react": "^19",
"@types/react-dom": "^19",
@@ -72,4 +84,4 @@
"tw-animate-css": "1.3.3",
"typescript": "^5"
}
}
}