The Code Quality section sends a new contributor to ./PRE_COMMIT.md, which is not in the repository, and then names Black and Prettier as the project's formatters. .pre-commit-config.yaml runs ruff, ruff-format and biome; neither Black nor Prettier is configured anywhere. Replaces the dead link with the install command and the config file itself, so the list of hooks cannot drift out of date again, and corrects the two formatter names.
7.3 KiB
Contributing to SurfSense
Hey! 👋 Thanks for checking out SurfSense. We're stoked that you're interested in helping improve the project. Whether it's fixing bugs, suggesting features, improving docs, or just joining the conversation — every bit helps.
🧠 Before You Start
Join Our Discord
Want to stay in the loop, ask questions, or get feedback before starting something?
Hop into the official SurfSense community:
👉 https://discord.gg/ejRNvftDp9
That's where the latest updates, internal discussions, and collaborations happen.
📌 What Can You Work On?
There are 3 main ways to contribute:
✅ 1. Pick From the Roadmap
We maintain a public roadmap with well-scoped issues and features you can work on:
🔗 SurfSense GitHub Project Roadmap
💡 Tip: Look for tasks in
BacklogorReadystatus.
💡 2. Propose Something New
Have an idea that's not on the roadmap?
- First, check for an existing issue
- If it doesn't exist, create a new issue explaining your feature or enhancement
- Wait for feedback from maintainers
- Once approved, you're welcome to start working on a PR!
🐞 3. Report Bugs or Fix Them
Found a bug? Create an issue with:
- Steps to reproduce the issue
- Expected vs actual behavior
- Environment details (OS, browser, version)
- Any relevant logs or screenshots
Want to fix it? Go for it! Just link the issue in your PR.
🌿 Branching Workflow
We follow a branch protection model to keep main stable:
| Branch | Purpose | Who can merge |
|---|---|---|
main |
Stable/release branch | Maintainers only (from dev) |
dev |
Active development & integration | Via approved PRs from contributors |
feature/*, fix/*, etc. |
Individual work branches | Contributors create PRs to dev |
Important Rules
- All contributor PRs must target the
devbranch. PRs targetingmainwill not be accepted. mainis updated exclusively by maintainers merging fromdevwhen a release is ready.- Always create your feature/fix branches from the latest
dev.
🛠️ Development Setup
Prerequisites
- Docker & Docker Compose (recommended) OR manual setup
- Node.js (v18+ for web frontend)
- Python (v3.11+ for backend)
- PostgreSQL with PGVector extension
- API Keys for external services you're testing
Quick Start
-
Fork and clone the repository
git clone https://github.com/<your-username>/SurfSense.git cd SurfSense -
Create your branch from
devgit checkout dev git pull origin dev git checkout -b feature/your-feature-name -
Choose your setup method:
- Docker Setup: Follow the Building from Source (Contributors) section of the Docker Installation guide
- Manual Setup: Follow the Installation Guide
-
Configure services:
- Set up PGVector & PostgreSQL
- Configure a file ETL service:
Unstructured.ioorLlamaIndex - Add API keys for external services
For detailed setup instructions, refer to our Installation Guide.
🏗️ Project Structure
SurfSense consists of three main components:
surfsense_backend/- Python/FastAPI backend servicesurfsense_web/- Next.js web applicationsurfsense_browser_extension/- Browser extension for data collection
🧪 Development Guidelines
Code Quality & Pre-commit Hooks
We use pre-commit hooks to maintain code quality, security, and consistency across the codebase. Before you start developing:
- Install and set up pre-commit hooks -
pip install pre-commit && pre-commit install - Understand the automated checks that will run on your code - every hook is listed in
.pre-commit-config.yaml; run them all withpre-commit run --all-files - Learn about bypassing hooks when necessary (use sparingly!)
Code Style
- Backend: Follow Python PEP 8 style guidelines
- Frontend: Use TypeScript and follow the existing code patterns
- Formatting: Use the project's configured formatters (Ruff for Python, Biome for TypeScript)
Commit Messages
Use clear, descriptive commit messages:
feat: add document search functionality
fix: resolve pagination issue in chat history
docs: update installation guide
refactor: improve error handling in connectors
Testing
- Write tests for new features and bug fixes
- Ensure existing tests pass before submitting
- Include integration tests for API endpoints
Branch Naming
Create branches from dev with descriptive names:
feature/add-document-searchfix/pagination-issuedocs/update-contributing-guide
🔄 Pull Request Process
Before Submitting
- Create an issue first (unless it's a minor fix)
- Fork the repository and create a branch from
dev - Make your changes following the coding guidelines
- Test your changes thoroughly
- Update documentation if needed
- Open a PR targeting the
devbranch
Note: PRs targeting
mainwill not be reviewed or merged. If you accidentally open a PR tomain, please retarget it todev.
PR Requirements
- Target the
devbranch — this is mandatory - One feature or fix per PR - keep changes focused
- Link related issues in the PR description
- Include screenshots or demos for UI changes
- Write descriptive PR title and description
- Ensure CI passes before requesting review
🔍 Code Review Process
- Automated checks must pass (CI/CD pipeline)
- At least one maintainer will review your PR
- Address feedback promptly and professionally
- Squash commits if requested to keep history clean
- Celebrate when your PR gets merged! 🎉
📚 Documentation
When contributing, please:
- Update relevant documentation for new features
- Add or update code comments for complex logic
- Update API documentation for backend changes
- Add examples for new functionality
🆘 Getting Help
Stuck? Need clarification? Here's how to get help:
- Check existing issues - your question might already be answered
- Search the docs - https://www.surfsense.com/docs/
- Ask in Discord - https://discord.gg/ejRNvftDp9
- Create an issue - if it's a bug or feature request
⭐ Other Ways to Contribute
Not ready to code? You can still help!
- Give us a star ⭐ on GitHub
- Share SurfSense with your community
- Provide feedback on Discord
- Help triage issues and validate bug reports
- Improve documentation and examples
- Write tutorials or blog posts about SurfSense
🎯 Recognition
We appreciate all contributions! Contributors will be:
- Acknowledged in release notes
- Listed in our contributors section
- Invited to join our contributors' Discord channel
- Eligible for special contributor badges
📄 License
By contributing to SurfSense, you agree that your contributions will be licensed under the same license as the project.
Thank you for contributing to SurfSense! 🚀
Together, we're building something awesome.