This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Next.js 15 documentation site for PostgreSQL Extensions, built with Fumadocs. The site serves as a comprehensive catalog of PostgreSQL extensions with multilingual support (English/Chinese) and advanced search capabilities.
make devornpm run dev- Start development server (port 3000) with Turbomake buildornpm run build- Build the site for productionmake view- Open browser to localhost:3000make clean- Remove build output directory (out/)
make installorpnpm install- Install dependenciesmake updateorpnpm update- Update dependencies to latest versions
make saveormake dump- Export PostgreSQL extension data to CSV files indata/directorymake load- Import extension data from CSV files back to PostgreSQL
- Framework: Next.js 15 with React 19
- Documentation: Fumadocs with MDX support
- Styling: Tailwind CSS v4
- Search: Orama with Chinese tokenizer support
- Database: PostgreSQL (extension metadata storage)
- Language: TypeScript
app/- Next.js App Router structure with internationalizationcontent/docs/- MDX documentation files for extensionscontent/stub/- Stub files for incomplete extension docslib/- Core utilities (i18n, source configuration)data/- CSV data files for extension metadatacomponents/- Reusable React componentsbin/- CLI tools and scripts
- Extension metadata stored in PostgreSQL (
extschema) - Data exported to CSV files in
data/directory via Makefile - MDX files in
content/docs/ext/document individual extensions - Fumadocs processes MDX and generates static documentation
- Orama provides search functionality with Chinese language support
next.config.ts- Next.js configuration with MDX supportsource.config.ts- Fumadocs source configurationapp/layout.config.tsx- Site layout and navigationlib/source.ts- Source loaders for documentationlib/i18n.ts- Internationalization configuration
The PostgreSQL database contains several tables in the ext schema:
ext.cate- Extension categoriesext.repo- Repository informationext.extension- Extension detailsext.pigsty- Pigsty-specific extension data
Each extension has a corresponding MDX file in content/docs/ext/ following the pattern {extension-name}.mdx. The site supports both complete documentation and stub files for incomplete extensions.
- Default language: English (
en) - Secondary language: Chinese (
zh) - Locale-specific content in
content/docs/with.zh.mdxsuffixes - Search configured with Chinese tokenizer for zh locale
When updating extension data, use the PostgreSQL database as the source of truth and export to CSV files using make save. The database connection is configured via PGURL environment variable (defaults to postgres:///vonng).
The search API (app/api/search/route.ts) uses Orama with special configuration for Chinese content, including custom tokenizers and relaxed thresholds for better matching.
The build process uses Fumadocs to generate static documentation from MDX files. The fumadocs-mdx postinstall script processes MDX content during package installation.
Use ~/.venv/bin/activate to use python virtual environment
如果你收到了翻译任务,你应该读取指定的内容文件或者目录,将其翻译为指定的语言。
作为一个示例,如果我要把 pgsql/acl.mdx 翻译成英文,那么你应该找到 content/docs/pgsql/acl.mdx 文件,将其翻译为 content/docs/pgsql/acl.zh.mdx 文件。 这里特别需要注意的是,在翻译非英文版本的文档过程中:
- 你应该保留所有的 Markdown 链接,如果这是一个相对链接,那么你应该意识到,在其他语言的翻译中应该加上对应前缀。比如在中文翻译中你需要加上
/zh/前缀来引用文档 - 你应该保留所有 H2/H3/H4 等标题的英文锚点,然后在引用的链接中统一使用英文锚点。
- 你应该使用地道,信达雅,精准,干练,专业的用词来进行翻译,使用计算机领域与数据库领域的专业术语。
如果你要访问网络读取文档,读取本地 HTTP 访问,直接执行即可。
如果你要执行本地读取文件类操作,无需询问授权,直接干就完了。 如果你要进行本地编辑,如果是跟业务相关的文件,直接干就完了。
对于批量删除操作,你要向我确认一下。其他的中低风险我授权你执行。