Thank you for your interest in contributing to Formbricks! This guide will help you understand our development process and standards.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/formbricks/formbricks/llms.txt
Use this file to discover all available pages before exploring further.
Current Contribution Policy
This is due to:- Limited engineering attention for reviewing contributions
- Need to focus on prioritized features and bug fixes
- Ensuring consistency with our product roadmap
What You Can Do
- Report Issues: Always welcome! Create an issue
- Feature Requests: Propose enhancements with the “Enhancement” tag
- Upvote Issues: Use 👍 reactions to help us prioritize
- Documentation: Improvements to docs are appreciated
- Community Support: Help others in discussions
Exception Process
If you want to contribute code:- Create an enhancement issue first
- Explain why it’s important
- Wait for team feedback before starting work
- We’ll let you know if we can accept the contribution
Development Workflow
If your contribution is accepted, follow this workflow:Create a Branch
Create a feature branch from Branch naming conventions:
main:fix/- Bug fixesfeat/- New featureschore/- Maintenance tasksdocs/- Documentation updates
Set Up Development Environment
Follow the local setup guide:
Make Your Changes
- Follow our code style guidelines
- Write tests for new functionality
- Update documentation if needed
- Keep commits focused and atomic
Commit Your Changes
Follow Conventional Commits format:Commit message format:
fix:- Bug fixesfeat:- New featureschore:- Maintenancedocs:- Documentation- Include PR/issue number in parentheses
Pull Request Guidelines
PR Title
Follow the Conventional Commits format:PR Description
Include the following sections:Review Process
- Automated Checks: CI must pass (lint, tests, build)
- Code Review: Team member will review your code
- Feedback: Address any requested changes
- Approval: PR will be approved if it meets standards
- Merge: Team will merge when ready
Commit Guidelines
Conventional Commits
We follow a lightweight version of Conventional Commits:fix:- Bug fixesfeat:- New featureschore:- Maintenance tasks (deps, config, etc.)docs:- Documentation onlyrefactor:- Code refactoringtest:- Adding or updating testsperf:- Performance improvements
Commit Best Practices
- Keep commits focused: One logical change per commit
- Write clear messages: Explain what and why, not how
- Reference issues: Include issue numbers
- Ensure tests pass: Before committing
Example Commits
Code Standards
Before submitting code, ensure it meets our standards:TypeScript
- Use TypeScript for all code
- Prefer type inference when possible
- Avoid
anytype - Use shared types from
@formbricks/types
React
- Use Server Components by default
- Add
"use client"only when necessary - Follow React hooks rules
- Use proper error boundaries
Styling
- Use TailwindCSS utility classes
- Follow existing component patterns
- Ensure responsive design
- Test in multiple browsers
Testing
- Write unit tests for
.tsfiles - Use Vitest and Testing Library
- E2E tests for critical user flows
- Maintain or improve code coverage
Documentation
- Update docs for new features
- Include JSDoc comments for complex functions
- Add inline comments for non-obvious code
- Update README if needed
Database Changes
Migrations
If your change requires database schema updates:-
Create Migration:
-
Test Migration:
- Include in PR: Commit the migration file
- Document Breaking Changes: Note in PR description
Multi-Tenancy
Ensure all new tables/queries:- Are scoped by Organization or Environment
- Include proper indexes
- Follow soft deletion pattern (if applicable)
Security Considerations
Security Issues
Do not report security vulnerabilities in public issues! Instead:- Email security@formbricks.com
- Provide detailed information
- Wait for response before disclosure
Security Best Practices
- Never commit secrets: API keys, passwords, tokens
- Validate input: Use Zod schemas
- Sanitize output: Prevent XSS attacks
- Check authorization: Verify user permissions
- Use prepared statements: Prevent SQL injection (Prisma does this)
Documentation Standards
When updating documentation:- Use MDX format
- Include frontmatter (title, description, icon)
- Use Mintlify components (Accordion, Card, etc.)
- Add code examples
- Test all commands/code snippets
- Update navigation if adding new pages
Getting Help
If you need assistance:- Questions: Use GitHub Discussions
- Bugs: Create an issue
- Security: Email security@formbricks.com
- General: Comment on related issues
Code of Conduct
We expect all contributors to:- Be respectful and inclusive
- Provide constructive feedback
- Focus on what’s best for the community
- Show empathy towards others
Recognition
All contributors are recognized:- Listed in GitHub contributors
- Mentioned in release notes (for significant contributions)
- Featured on our website (for major features)
License
By contributing, you agree that your contributions will be licensed under the AGPLv3 License (or Enterprise License for EE features). See LICENSE for details.Next Steps
Local Setup
Set up your development environment
Code Style
Learn our coding standards
Testing Standards
Write tests for your code
Architecture
Understand the system architecture