Thank you for your interest in contributing to DocChat!
DocChat is a RAG-based application that allows users to chat with documentation. Contributions are welcome across the entire stack—frontend UX/UI, backend APIs, crawling, text processing, vector search, and documentation.
- Guides: Refer to the Architecture Guide and Troubleshooting Guide for local environment setup.
- Pull Request Template: .github/pull_request_template.md
- Issue Templates:
- Report a bug: Bug Report Template
- Propose a feature: Feature Request Template
To keep our repository organized, please name your branches following these prefixes:
feat/short-description— for new features or capabilities.fix/short-description— for bug fixes or errors.docs/short-description— for changes or improvements to documentation.refactor/short-description— for codebase rewrites that do not add features or fix bugs.perf/short-description— for changes that improve indexing speeds or response latencies.
Fork the repository on GitHub, and then clone your fork locally:
git clone https://github.com/avishek0769/DocChat.git
cd DocChatInstall packages in both directories:
# Install frontend packages (at root)
pnpm install
# Install backend packages
cd backend
pnpm install
cd ..Always work on a separate, descriptive branch created from the latest main:
git checkout -b feat/my-new-featureBefore committing any changes, verify that the project builds and runs without errors.
DocChat contains backend integration and unit tests using Vitest. Make sure all tests pass before proposing a PR:
cd backend
pnpm testTo run tests in watch mode:
pnpm dlx vitestVerify that eslint runs successfully:
# Run lint check from the root directory
pnpm run lint
pnpm run build- Commit with a clear message following the Conventional Commits format:
git commit -m "feat: add dark mode toggle"
git commit -m "fix: resolve session expiration race condition"- Push your branch:
pnpm run build
---
## PR Guidelines
- Comment on the issue you want to work on and wait until it is assigned before starting.
- PRs without prior issue discussion/assignment may be closed.
- Keep each PR focused on one issue.
- Start with a short summary of what changed and why.
- Link the assigned issue.
- Add screenshots or a short video in PRs when possible. (Explanatory visuals are highly appreciated)
- Ensure the app runs without errors.
- Avoid bundling unrelated changes in one PR.
Note: Please do not open a PR without a corresponding issue assignment.
---
## Commit Messages
DocChat enforces [Conventional Commits](https://www.conventionalcommits.org/) via a `commit-msg` hook. Non-conforming commits are rejected automatically.
### Format
[optional scope]:
[optional body]
[optional footer(s)]
### Allowed Types
| Type | When to use |
|------|-------------|
| `feat` | New feature |
| `fix` | Bug fix |
| `docs` | Documentation changes only |
| `style` | Formatting, whitespace (no logic change) |
| `refactor` | Code restructure without feature or fix |
| `perf` | Performance improvement |
| `test` | Adding or fixing tests |
| `build` | Build system or dependency changes |
| `ci` | CI/CD configuration changes |
| `chore` | Maintenance tasks |
| `revert` | Reverting a previous commit |
### Rules
- Use **imperative mood**: "add" not "added" or "adds"
- Keep the description **under 72 characters**
- Start description with **lowercase**
- No period at the end
- Scope is optional but must be **kebab-case** when used
### Good Examples
```bash
feat: add pagination to chat history
fix(auth): prevent redirect loop on token expiry
docs: update environment variable setup steps
refactor(retrieval): extract chunking logic to separate module
perf: cache user session data to reduce DB queries
ci: add lint check to GitHub Actions workflow
# No type prefix
added dark mode
# Wrong tense
feat: added dark mode
# Too vague
fix: fixed bug
# Uppercase start
feat: Add dark mode
# Period at end
fix: resolve login issue.
# Multiple unrelated changes in one message
feat: add dark mode and fix auth bug and update readme
# WIP or placeholder messages
WIP
temp
misc changes
update stuffAdd ! after the type, or include a BREAKING CHANGE footer:
feat(api)!: change response format to JSON:API
BREAKING CHANGE: All API responses now use camelCase keys.
Update client-side parsers accordingly.Link issues in the footer:
fix(upload): handle empty file gracefully
Fixes #142- Write clean, readable, maintainable code.
- Keep changes minimal and targeted.
- Avoid unnecessary new dependencies.
- Follow existing project structure and style.
- Do not log or expose API keys or secrets.
If you are new, look for issues labeled good first issue.
- Open an issue: GitHub Issues
- Join Discord: Discord Server
- Prior Discussion: We prefer that contributions map to an open issue. Please comment on the issue you wish to resolve and wait for maintainer assignment before starting work.
- Focus: Keep PRs small and focused. Avoid mixing unrelated bug fixes or cosmetic styling edits with feature implementations.
- Checklist Documentation: Fill out the Pull Request Template fields completely when opening your PR.
- Visual Demonstrations: If your changes affect the user interface, attach screenshots or a short screen recording demonstrating the modified states.
- No Exposure of Credentials: Do not push or log active API keys, encryption secrets, or local configuration files (
.envis excluded in.gitignore).