A web app that scans book covers with AI and catalogs them into a Notion database. Built for the Berlin Chinese Books Community Library (柏林精神卫生中心).
Upload a photo of a book cover, and the app will extract the title, author, publisher, category, and language — then save it directly to your Notion library database.
- Frontend: Static HTML/CSS/JS
- Backend: Cloudflare Pages Functions
- AI: Google Gemini 3.1 Flash (vision)
- Database: Notion API
npm installCopy the example file and fill in your keys:
cp .dev.vars.example .dev.varsYou need:
- Google Gemini API key(s) from Google AI Studio
- Notion integration token from notion.so/my-integrations
- Notion database ID — the database must have these properties:
- 书名 (title)
- 书籍拥有者 (rich_text)
- 作者 (rich_text)
- 借阅状态 (status: 可借 / 已借出)
- 出借周期 (rich_text)
- 出版信息 (rich_text)
- 分类 (select)
- 联系方式 (rich_text)
- 语言 (select)
npm run devOpens at http://localhost:8788.
npx wrangler pages project create book-botSet secrets:
npx wrangler pages secret put GOOGLE_API_KEY --project-name book-bot
npx wrangler pages secret put NOTION_TOKEN --project-name book-botAlso set NOTION_DB_ID in wrangler.toml.
Deploy:
npm run deployMIT