tech-stack
Use when discussing architecture, adding features, or understanding fancai project structure. Provides technology overview and conventions.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
fancai Technology Stack
Overview
Web application for reading fiction with AI-generated images from book descriptions.
Frontend (frontend/)
- Framework: React 19 + TypeScript 5.7
- State: TanStack Query 5.90 (server), Zustand 5 (client)
- EPUB: epub.js 0.3.93 with CFI navigation
- Styling: Tailwind CSS 3.4, shadcn/ui
- Build: Vite 6
Key Directories
-
src/components/Reader/— EPUB reader (15 files) -
src/hooks/api/— TanStack Query hooks -
src/hooks/epub/— EPUB functionality (22 files) -
src/services/— IndexedDB caching
Backend (backend/)
- Framework: FastAPI 0.125 + Python 3.11
- Database: PostgreSQL 15 + SQLAlchemy 2.0
- Cache: Redis 7.4
- Background: Celery 5.4
- Migrations: Alembic 1.14
Key Services
-
app/services/book_parser.py— EPUB/FB2 parsing -
app/services/gemini_extractor.py— Description extraction -
app/services/imagen_generator.py— Image generation -
app/core/retry.py— Exponential backoff
AI Integration
- Extraction: Google Gemini 3.0 Flash (~$0.02/book)
- Generation: Google Imagen 4 ($0.04/image)
Commands
# Frontend
cd frontend && npm run dev # Development
cd frontend && npm test # Tests
cd frontend && npm run build # Build
# Backend
cd backend && pytest -v # Tests
cd backend && alembic upgrade head # Migrations
Conventions
TypeScript
- Functional components with hooks
- TanStack Query for all API calls
- No direct fetch() — use query hooks
- CFI for EPUB position tracking
Python
- Type hints required
- Pydantic for validation
- Repository pattern for DB
- tenacity for retries
Commits
<type>(<scope>): <subject>
Types: feat, fix, docs, style, refactor, test, chore
Production
- URL: https://fancai.ru
- Deploy:
docker-compose.lite.yml
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!