Skip to content

Update from task c4549c58-25aa-4aad-a102-bde08323a5fe - #1

Open
guyue55 wants to merge 4 commits into
devfrom
qwen-code-c4549c58-25aa-4aad-a102-bde08323a5fe
Open

Update from task c4549c58-25aa-4aad-a102-bde08323a5fe#1
guyue55 wants to merge 4 commits into
devfrom
qwen-code-c4549c58-25aa-4aad-a102-bde08323a5fe

Conversation

@guyue55

@guyue55 guyue55 commented Mar 2, 2026

Copy link
Copy Markdown
Owner

This PR was created by qwen-chat coder for task c4549c58-25aa-4aad-a102-bde08323a5fe.

- **新增**: `REFACTOR_PLAN.md` - 详细记录重构目标、技术栈升级与分阶段实施步骤
- **新增**: `pyproject.toml` - 使用 Poetry 管理依赖,集成类型检查、格式化与测试配置
- **新增**: `src/soulbook/` 目录结构 - 按功能分层(API、模型、服务、数据库、爬虫等),实现清晰的模块化设计
- **新增**: `src/soulbook/api/v1/*.py` - 实现基于 FastAPI 的版本化路由,支持认证、小说管理与用户接口
- **新增**: `src/soulbook/models/*.py` - 使用 SQLAlchemy 2.0 定义异步数据模型,包含用户、小说与书签关系
- **新增**: `src/soulbook/schemas/*.py` - 基于 Pydantic v2 定义请求/响应模式,提供完整类型提示与验证
- **新增**: `src/soulbook/database/crud/*.py` - 分离业务逻辑,实现统一的 CRUD 操作与事务管理
- **新增**: `src/soulbook/utils/security.py` - 提供密码哈希、JWT 认证与令牌生成能力
- **修改**: `.gitignore` - 更新忽略规则,适配 Poetry 与现代 Python 工具链
- **修改**: `README.md` - 更新项目说明,突出现代化技术栈与重构价值

整体实现从旧有 Sanic + MongoDB 架构向 FastAPI + SQLAlchemy + PostgreSQL 的现代化迁移,显著提升代码可维护性、类型安全与测试覆盖率。
@vercel

vercel Bot commented Mar 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
soul-book Ready Ready Preview, Comment Mar 6, 2026 2:19am

…lementation

**Key features implemented:**
- Added Alembic configuration and migration environment for database schema management
- Implemented data migration script to transfer user and novel data from MongoDB to PostgreSQL
- Created database initialization script to set up tables and sample data
- Developed base crawler interface with retry mechanism and error handling
- Implemented Qidian and Zongheng crawlers with search, novel info, chapter list, and content extraction
- Built comprehensive service layer with CRUD operations for users, novels, bookmarks, and recommendations
- Added integration tests for API endpoints and unit tests for models and services
- Enhanced .gitignore to exclude database files, virtual environments, and test coverage artifacts

**Summary:** The core backend infrastructure is now fully functional with complete database migration, robust crawling capabilities, comprehensive service layer, and thorough test coverage. The system is ready for Docker deployment and can handle user authentication, novel management, and content discovery.

@guyue55 guyue55 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pass

- Added new file: test.txt with content "测试"
- Updated .gitignore to exclude common build, log, and temporary files (no changes needed for test.txt as it's not a build artifact)

The addition of test.txt supports basic verification workflows, while the .gitignore remains optimized for excluding unnecessary artifacts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants