Skip to content

DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.

update docs

Bingxi Zhao (Frank)6a99ba721c1c
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 0ec57968d..2347e6c2f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,147 +1,220 @@
-Contributing to DeepTutor πŸš€
-Thank you for your interest in contributing to DeepTutor! We are committed to building a smooth and robust intelligent learning companion, and we welcome developers of all skill levels to join us.
-Join our community for discussion, support, and collaboration:
+# Contributing to DeepTutor
+
+Thank you for your interest in contributing to DeepTutor! We welcome developers of all skill levels to help build the next-generation intelligent learning companion.
+
<p align="center">
<a href="https://discord.gg/eRsjPgMU4t"><img src="https://img.shields.io/badge/Discord-Join_Community-5865F2?style=for-the-badge&logo=discord&logoColor=white" alt="Discord"></a>&nbsp;
<a href="https://github.com/HKUDS/DeepTutor/issues/78"><img src="https://img.shields.io/badge/WeChat-Join_Group-07C160?style=for-the-badge&logo=wechat&logoColor=white" alt="WeChat"></a>&nbsp;
<a href="./Communication.md"><img src="https://img.shields.io/badge/Feishu-Join_Group-00D4AA?style=for-the-badge&logo=feishu&logoColor=white" alt="Feishu"></a>
</p>
+---
+
## Table of Contents
-- [Contribution Requirements](#️-contribution-requirements)
-- [Code Quality & Security](#-code-quality--security)
-- [Security Best Practices](#-security-best-practices)
-- [Coding Standards](#-coding-standards)
-- [Development Setup](#-development-setup)
-- [Commit Message Format](#-commit-message-format)
-- [How to Get Started](#-how-to-get-started)
-
-## ⚠️ Contribution Requirements
-[!IMPORTANT]
-All contributions must be based on the `dev` branch!
-1. Fork the repository and clone it locally.
-2. **Synchronize**: Always pull from the `dev` branch before starting:
- ```bash
- git checkout dev && git pull origin dev
- ```
-3. **Branch**: Create your feature branch from `dev`:
- ```bash
- git checkout -b feature/your-feature-name
- ```
-4. **PR Target**: Submit your Pull Request to the `dev` branch (not `main`).
-5. **Validation**: Ensure all pre-commit checks pass before submitting.
-
-## πŸ› οΈ Code Quality & Security
-We use a suite of automated tools to maintain high standards of code quality and security. These are configured via `pyproject.toml` and `.pre-commit-config.yaml`.
-
-### Our Toolstack
-- **Ruff**: High-performance Python linting and formatting.
-- **Prettier**: Consistent formatting for frontend and configuration files.
-- **detect-secrets**: Scans for high-entropy strings and hardcoded secrets.
-- **pip-audit**: Scans dependencies for known vulnerabilities (V3.x compatible).
-- **Bandit**: Analyzes code for common security issues.
-- **MyPy**: Static type checking to ensure code reliability.
-- **Interrogate**: Reports docstring coverage. While it won't block your commit, please aim for high coverage.
-
-[!TIP]
-Before submitting a PR, you MUST run:
+
+- [Maintainers](#maintainers)
+- [Branching Strategy](#branching-strategy)
+- [Quick Start for Contributors](#quick-start-for-contributors)
+- [Development Setup](#development-setup)
+- [Code Quality & Security](#code-quality--security)
+- [Coding Standards](#coding-standards)
+- [Commit Message Format](#commit-message-format)
+- [Security Best Practices](#security-best-practices)
+
+---
+
+## Maintainer
+
+[@pancacake](https://github.com/pancacake) β€” Currently just me!
+
+---
+
+## Branching Strategy
+
+We use a multi-branch model to keep development organized:
+
+| Branch | Purpose | Stability |
+|---|---|---|
+| `dev` | General development | May have bugs or breaking changes |
+| `multi-user` | Multi-user scenario development | Experimental, focused on multi-tenant features |
+
+> [!IMPORTANT]
+> Please do **not** submit PRs directly to `main`. All contributions should target `dev` or `multi-user`.
+
+### Which Branch Should I Target?
+
+**Target `dev`** if your PR includes:
+
+- New features or functionality
+- Refactoring that may affect existing behavior
+- Changes to APIs or configuration
+- General bug fixes
+
+**Target `multi-user`** if your PR includes:
+
+- Multi-user / multi-tenant related features
+- Session isolation, user management, or permission changes
+- Collaborative or shared workspace functionality
+
+> [!NOTE]
+> When in doubt, target `dev` β€” it is the default development branch.
+
+---
+
+## Quick Start for Contributors
+
+1. **Fork & Clone** the repository.
+2. **Sync** with the target branch before starting:
+
+```bash
+git checkout dev && git pull origin dev
+```
+
+3. **Create** your feature branch from the target branch:
+
+```bash
+git checkout -b feature/your-feature-name
+```
+
+4. **Develop** your changes, following the coding standards below.
+5. **Validate** by running pre-commit checks:
+
```bash
pre-commit run --all-files
```
-While local pre-commit hooks are configured to be lenient and may only show warnings, the CI will perform strict checks and will automatically reject PRs that fail.
-## πŸ”’ Security Best Practices
-### File Uploads
-- **Size Limits**: General files are capped at 100MB; PDFs are capped at 50MB to prevent resource exhaustion.
-- **Validation**: We enforce multi-layer validation (Extension + MIME type + Content sanitization).
-- **Sanitization**: All filenames are sanitized to prevent path traversal attacks.
+6. **Submit** your Pull Request to the correct target branch (not `main` unless it's a hotfix or docs-only change).
-### Development Standards
-- **Subprocesses**: Always use `shell=False` when calling subprocesses to prevent command injection.
-- **Pathing**: Use `pathlib.Path` for all operations to ensure cross-platform (Windows/Linux/macOS) compatibility.
-- **Line Endings**: LF (Unix) line endings are enforced for critical scripts via `.gitattributes`.
-
-## πŸ’» Coding Standards
-To keep the codebase maintainable, please follow these guidelines:
-### Python Guidelines
-- Use Type Hints for all function signatures.
-- Prefer f-strings for string formatting.
-- Follow PEP 8 (mostly enforced by Ruff/Black).
-- Keep functions small and focused on a single responsibility.
+> [!TIP]
+> Browse our [Issues](https://github.com/HKUDS/DeepTutor/issues) for tasks labeled `good first issue` to find a great starting point. Comment on the issue to let others know you're working on it.
-### Documentation
-- Every new module, class, and public function should have a docstring.
-- Use the Google Python Style Guide for docstring formatting.
-- Update `README.md` if your change introduces new features or configuration variables.
+---
+
+## Development Setup
-## βš™οΈ Development Setup
<details>
-<summary><b>Setting Up Your Environment (Recommended)</b></summary>
+<summary><b>Setting Up Your Environment</b></summary>
**Step 1: Create a virtual environment**
+
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```
**Step 2: Install dependencies**
+
```bash
pip install -e ".[all]"
```
+
</details>
<details>
<summary><b>Setting Up Pre-commit (First Time Only)</b></summary>
**Step 1: Install pre-commit**
+
```bash
-# Using pip
pip install pre-commit
-
-# Or using conda
-conda install -c conda-forge pre-commit
+# Or: conda install -c conda-forge pre-commit
```
**Step 2: Install Git hooks**
+
```bash
pre-commit install
```
-Hooks will now run automatically on every commit.
**Step 3: Initialize the Secrets Baseline**
-If you encounter new "false positive" secrets (like API hash placeholders), update the baseline:
+
+If you encounter false-positive secrets (like API hash placeholders), update the baseline:
+
```bash
detect-secrets scan > .secrets.baseline
```
+
</details>
### Common Commands
-| Task | Command |
-|-------------------|------------------------------------------------|
-| Check all files | `pre-commit run --all-files` |
-| Check quietly | `pre-commit run --all-files -q` |
-| Update tools | `pre-commit autoupdate` |
-| Emergency skip | `git commit --no-verify -m "message"` (Not recommended) |
-
-## πŸ“‹ Commit Message Format
-We follow a structured commit format to maintain a clean history:
+
+| Task | Command |
+|---|---|
+| Check all files | `pre-commit run --all-files` |
+| Check quietly | `pre-commit run --all-files -q` |
+| Update tools | `pre-commit autoupdate` |
+| Emergency skip | `git commit --no-verify -m "message"` *(not recommended)* |
+---
+
+## Code Quality & Security
+
+We use automated tools (configured via `pyproject.toml` and `.pre-commit-config.yaml`) to maintain high standards:
+
+| Tool | Purpose |
+|---|---|
+| **Ruff** | Python linting and formatting |
+| **Prettier** | Frontend & config file formatting |
+| **detect-secrets** | Hardcoded secret scanning |
+| **pip-audit** | Dependency vulnerability scanning |
+| **Bandit** | Security issue analysis |
+| **MyPy** | Static type checking |
+| **Interrogate** | Docstring coverage reporting |
+
+> [!IMPORTANT]
+> Local pre-commit hooks may only show warnings, but **CI will perform strict checks** and automatically reject PRs that fail.
+
+---
+
+## Coding Standards
+
+### Python
+
+- Use **type hints** for all function signatures.
+- Prefer **f-strings** for string formatting.
+- Follow **PEP 8** (enforced by Ruff).
+- Keep functions **small and focused** on a single responsibility.
+
+### Documentation
+
+- Every new module, class, and public function should have a **docstring** (Google Python Style Guide format).
+- Update `README.md` if your change introduces new features or configuration.
+
+---
+
+## Commit Message Format
+
```
<type>: <short description>
[optional body]
```
-- `feat`: A new feature (corresponds to a MINOR version bump).
-- `fix`: A bug fix (corresponds to a PATCH version bump).
-- `docs`: Documentation only changes.
-- `style`: Changes that do not affect the meaning of the code (formatting, missing semi-colons, etc).
-- `refactor`: A code change that neither fixes a bug nor adds a feature.
-- `test`: Adding missing tests or correcting existing tests.
-- `chore`: Routine tasks (updating build processes, etc).
-
-## πŸ’‘ How to Get Started
-1. Browse our [Issues](https://github.com/HKUDS/DeepTutor/issues) for tasks labeled `good first issue`.
-2. Comment on the issue to let others know you're working on it.
-3. Follow the process above and submit your PR!
-
-Questions? Reach out on Discord.
-Let's build the future of AI tutoring together! πŸš€
+
+| Type | Description |
+|---|---|
+| `feat` | A new feature (MINOR version bump) |
+| `fix` | A bug fix (PATCH version bump) |
+| `docs` | Documentation only changes |
+| `style` | Formatting, no logic changes |
+| `refactor` | Code restructuring, no new features or fixes |
+| `test` | Adding or correcting tests |
+| `chore` | Build process, tooling, or dependency updates |
+
+---
+
+## Security Best Practices
+
+### File Uploads
+
+- **Size Limits**: General files capped at 100 MB; PDFs capped at 50 MB.
+- **Validation**: Multi-layer validation (extension + MIME type + content sanitization).
+- **Sanitization**: All filenames are sanitized to prevent path traversal.
+
+### Development Standards
+
+- **Subprocesses**: Always use `shell=False` to prevent command injection.
+- **Pathing**: Use `pathlib.Path` for cross-platform compatibility.
+- **Line Endings**: LF (Unix) line endings enforced for critical scripts via `.gitattributes`.
+
+---
+
+Questions? Reach out on [Discord](https://discord.gg/eRsjPgMU4t). Let's build the future of AI tutoring together!
diff --git a/README.md b/README.md
index 8a5a40596..ae6244c09 100644
--- a/README.md
+++ b/README.md
@@ -24,6 +24,8 @@
---
+> 🀝 **We welcome any kinds of contributing!** See our [Contributing Guide](CONTRIBUTING.md) for branching strategy, coding standards, and how to get started.
+
### πŸ“¦ Releases
> **[2026.4.22]** [v1.2.2](https://github.com/HKUDS/DeepTutor/releases/tag/v1.2.2) β€” User-authored Skills system (CRUD + chat integration), chat input performance overhaul with state colocation, `response_format` auto-fallback for incompatible providers, LAN remote access fix, sidebar version badge, Deep Solve image attachments, TutorBot WebSocket auto-start, Book Library UI, and visualization fullscreen mode.