feat: add admin panel, Replicate AI translation, and document translation

- Admin panel (/admin) with JWT auth: configure Replicate API token,
  JigsawStack API key, model version, enable/disable AI translation,
  change admin password. Settings persisted in data/settings.json.

- Replicate AI translation: POST /api/translate/replicate uses
  JigsawStack text-translate model via Replicate API. Main page
  switches to client-side AI translation when enabled.

- Document translation tab: supports PDF, DOCX, XLSX, XLS, CSV.
  Excel/Word formatting fully preserved (SheetJS + JSZip XML manipulation).
  PDF uses pdf-parse extraction + pdf-lib reconstruction.
  Column selector UI for tabular data (per-sheet, All/None toggles).

- Updated README with full implementation documentation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-10 07:43:54 +01:00
parent 0190ea5da9
commit 0799101da3
23 changed files with 18595 additions and 261 deletions

View File

@@ -3,6 +3,7 @@ import Head from "next/head";
import NextLink from "next/link";
import { Flex, HStack, IconButton, Link, useColorModeValue } from "@chakra-ui/react";
import { FaGithub } from "react-icons/fa";
import { FiSettings } from "react-icons/fi";
import Image from "next/image";
import { ColorModeToggler } from ".";
@@ -40,6 +41,15 @@ const Header: FC<Props> = (props) => (
<ColorModeToggler
variant={useColorModeValue("outline", "solid")}
/>
<NextLink href="/admin" passHref={true}>
<IconButton
as={Link}
aria-label="Admin settings"
icon={<FiSettings />}
colorScheme="lingva"
variant={useColorModeValue("outline", "solid")}
/>
</NextLink>
<IconButton
as={Link}
href="https://github.com/thedaviddelta/lingva-translate"