
一个不断生长的多语言文档索引。找到就直接读,找不到就交给后台生成,下一次所有人都能打开。
Docs in the language you think in.
1Doc is an open-source multilingual documentation mirror. It turns public documentation sites into fast, static, translated mirrors that can be searched, shared, revisited, and reused without translating the same pages again.

LLM.txt index for every translated documentation site.doc_sites project./sites/{siteSlug}/{lang}/....LLM.txt file from the generated pages.parse5 for DOM-safe HTML transformationnpm install
cp .env.example .env.local
npm run dev
Open http://localhost:3000.
See .env.example.
ARK_API_KEY=
ARK_MODEL=doubao-seed-1-6-flash-250615
ARK_BASE_URL=https://ark.cn-beijing.volces.com/api/v3
ARK_TIMEOUT_MS=60000
SUPABASE_URL=
SUPABASE_SERVICE_ROLE_KEY=
INNGEST_EVENT_KEY=
INNGEST_SIGNING_KEY=
INNGEST_DEV=
SITE_BASE_URL=http://localhost:3000
MIRROR_PAGE_CONCURRENCY=8
MIRROR_LANG_CONCURRENCY=2
MIRROR_RENDERED_DISCOVERY_LIMIT=50
MIRROR_EXPANDED_DISCOVERY_LIMIT=20
TRANSLATE_BATCH_CONCURRENCY=2
TRANSLATE_BATCH_ITEMS=12
TRANSLATE_BATCH_CHARS=3000
BROWSERLESS_WS_URL=
TRANSLATE_API_TOKEN=
Notes:
ARK_MODEL can be a model name or an Ark endpoint ID such as ep-....MIRROR_PAGE_CONCURRENCY defaults to 8 and is capped at 16.MIRROR_LANG_CONCURRENCY controls per-page target-language parallelism and defaults to 2.MIRROR_RENDERED_DISCOVERY_LIMIT caps how many pages use browser-rendered link discovery per site.MIRROR_EXPANDED_DISCOVERY_LIMIT caps how many pages use browser-rendered discovery after safe UI expansion per site.TRANSLATE_BATCH_CONCURRENCY controls parallel model batches and defaults to 2.BROWSERLESS_WS_URL is optional. When configured, 1Doc can use rendered and expanded discovery for JavaScript-heavy pages.SUPABASE_SERVICE_ROLE_KEY must only be used on the server. Do not expose it to browser code.Run supabase/schema.sql in the Supabase SQL editor.
The schema includes:
doc_sites: mirror projects and language configuration.source_pages: discovered source pages and fetch status.mirrored_pages: generated translated HTML.translation_segments: reusable text segment cache.generation_jobs and generation_locks: job progress and duplicate prevention.job_events: timeline and debug events.site_votes: public ranking votes.site_llm_texts: generated LLM.txt artifacts.npm run dev
npm run typecheck
npm run build
Production currently runs on Sealos from a Docker image. The GitHub Actions workflow builds and pushes the image to Docker Hub whenever a Git tag is pushed. It publishes both the version tag and latest.
supabase/schema.sql.SITE_BASE_URL to your production URL.npm run typecheck
npm run build
git tag v0.1.4
git push origin main
git push origin v0.1.4
Publish Docker image workflow to finish.your-dockerhub-user/1Doc:v0.1.4, then redeploy.Without Inngest, local development can still run generation inline. For real public usage, Inngest or another durable worker system is recommended.
Use fixed version tags for production releases instead of relying on latest. If the Sealos app is configured to use latest, pushing a tag will update the Docker image, but the app usually still needs to be restarted or redeployed in Sealos.
app/ Next.js routes and UI
app/api/sites/ Site creation, progress, votes, refresh, LLM.txt APIs
lib/mirror/ Discovery, generation, storage, jobs, URL handling
lib/docir/ Document-oriented extraction and translation helpers
supabase/schema.sql Database schema
public/ Static assets
If 1Doc helps you, you can support continued development on Afdian: Sponsor 1Doc.
Issues and pull requests are welcome. Useful areas to improve:
See CONTRIBUTING.md before opening a pull request.
Please report vulnerabilities privately. See SECURITY.md.
MIT. See LICENSE.