MCPcopy Index your code
hub / github.com/zu1k/book-searcher

github.com/zu1k/book-searcher @main

repository ↗ · DeepWiki ↗ · + Follow
72 symbols 209 edges 33 files 0 documented · 0% updated 4mo ago★ 6,304
README

Book Searcher

GitHub stars GitHub forks Release GitHub issues GitHub license

English

简单而超快的图书搜索器,创建并搜索您的私人图书馆。

Book Searcher可以在一分钟内索引超过1000万本书的元数据,并以30微秒的速度进行搜索。

使用方式

我们目前提供桌面版和命令行版本两种选择。 对于个人用户,我们建议使用桌面版。

桌面版

1. 从Release页面下载预编译的桌面版安装程序

或者您也可以自行编译。请参考下面的从源代码构建部分的说明。

  • Windows: Book-Searcher-desktop_version_x64.msi
  • macOS: Book-Searcher-desktop_version_x64.dmg
  • Linux:
    • Deb: Book-Searcher-desktop_version_amd64.deb
    • AppImage: Book-Searcher-desktop_version_amd64.AppImage

2. 准备 index

请参考准备index 部分的说明。

3. 运行book-searcher-desktop

在设置菜单中指定index文件夹的路径。

命令行版

1. 从Release页面下载预编译的二进制文件

或者您也可以自行编译。请参考从源代码构建部分的说明。

2. 准备 index

请参考准备index 部分的说明。

3. 运行 book-searcher run

它将监听 127.0.0.1:7070

访问 http://127.0.0.1:7070/ 来使用 Web 用户界面,或者您可以使用原始搜索API

使用 Docker 部署

mkdir book-searcher && cd book-searcher
wget https://raw.githubusercontent.com/book-searcher-org/book-searcher/master/docker-compose.yml
# 准备索引:将 csv 文件放在目录中,然后运行以下命令创建索引
docker-compose run --rm -v "$PWD:$PWD" -w "$PWD" book-searcher /book-searcher index -f *.csv
# 启动 book-searcher
docker-compose up -d

现在,book-searcher将监听0.0.0.0:7070

原始搜索Api

您可以通过以下字段进行搜索:

  • title
  • author
  • publisher
  • extension
  • language
  • isbn
  • id

示例:

  • /search?limit=30&title=TITLE
  • /search?limit=30&title=TITLE&author=AUTHOR
  • /search?limit=30&isbn=ISBN
  • /search?limit=30&query=title:TITLE extension:epub publisher:PUBLISHER

现在我们有两种搜索模式:/search?limit=30&mode=explore&title=TITLE&author=AUTHOR

  • filter:结果需要满足所有限制条件,这是默认模式。
  • explore:结果只需要满足一定的限制条件。

从源代码构建

构建命令行版

1. 构建前端

make frontend_preinstall frontend

2. 构建 book-searcher

TARGET=release make

# 将编译后的二进制文件移动到项目根目录
mv target/release/book-searcher .

构建桌面版

1. 安装前端依赖

make frontend_preinstall

2. 构建 book-searcher-desktop

cargo tauri build

准备 index

1. 准备原始数据

准备原始图书元数据并将csv文件保存到项目根目录。

原始数据用于生成index,请参考原始数据部分获取详细信息。

2. 创建 index

您可能需要先执行rm -rf index命令。

book-searcher index -f *.csv

最终的文件夹结构应该如下所示:

book_searcher_dir
├── index
│   ├── some index files...
│   └── meta.json
└── book-searcher

原始数据

这些原始数据用于生成index,应该是一个包含以下字段的csv文件:

id, title, author, publisher, extension, filesize, language, year, pages, isbn, ipfs_cid, cover_url, md5

您需要导出并维护自己购买的图书的元信息,因为该项目只提供快速搜索功能。

许可证

book-searcher © The Book Searcher Authors, 根据BSD-3-Clause发布。

Extension points exported contracts — how you extend this code

ColumnMeta (Interface)
(no doc)
frontend/src/components/DataTable.tsx
DataTableProps (Interface)
(no doc)
frontend/src/components/DataTable.tsx
SearchInputProps (Interface)
(no doc)
frontend/src/components/SearchInput.tsx
SearchSelectProps (Interface)
(no doc)
frontend/src/components/SearchInput.tsx
DescriptionProps (Interface)
(no doc)
frontend/src/components/BookDetailCard.tsx

Core symbols most depended-on inside this repo

getDownloadLinkFromIPFS
called by 5
frontend/src/scripts/ipfs.ts
getCoverImageUrl
called by 4
frontend/src/scripts/cover.ts
getMd5CoverImageUrl
called by 4
frontend/src/scripts/cover.ts
renderer
called by 3
frontend/src/components/BooksView.tsx
getIpfsGateways
called by 3
frontend/src/scripts/ipfs.ts
rendererTag
called by 2
frontend/src/components/BookCardList.tsx
parseIpfsGateways
called by 2
frontend/src/scripts/ipfs.ts
compareBreakpoints
called by 1
frontend/src/components/DataTable.tsx

Shape

Function 48
Interface 24

Languages

TypeScript100%

Modules by API surface

frontend/src/components/Preview.tsx8 symbols
frontend/src/scripts/ipfs.ts4 symbols
frontend/src/scripts/download.ts4 symbols
frontend/src/components/Settings-tauri.tsx4 symbols
frontend/src/components/SearchInput.tsx4 symbols
frontend/src/components/DataTable.tsx4 symbols
frontend/src/components/BooksView.tsx4 symbols
frontend/src/components/BookDetailCard.tsx4 symbols
frontend/src/scripts/searcher.ts3 symbols
frontend/src/components/Settings.tsx3 symbols
frontend/src/components/Search.tsx3 symbols
frontend/src/components/Pagination.tsx3 symbols

Dependencies from manifests, versioned

@babel/core7.23.2 · 1×
@chakra-ui/icons2.1.1 · 1×
@chakra-ui/react2.8.1 · 1×
@chakra-ui/skip-nav2.1.0 · 1×
@chakra-ui/system2.6.1 · 1×
@darkobits/vite-plugin-favicons0.3.0 · 1×
@emotion/react11.11.1 · 1×
@emotion/styled11.11.0 · 1×
@tanstack/react-query4.36.1 · 1×
@tanstack/react-table8.10.7 · 1×
@tanstack/table-core8.10.7 · 1×
@tauri-apps/apinext · 1×

For agents

$ claude mcp add book-searcher \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact