Contributing to Flowers
December 10, 2025 ยท View on GitHub
First off, thank you for considering contributing to Flowers! It's people like you that make Flowers such a great tool.
๐ Table of Contents
- Code of Conduct
- Getting Started
- Development Workflow
- Coding Standards
- Commit Guidelines
- Pull Request Process
- Project Structure
- Testing
- Documentation
๐ Code of Conduct
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
๐ Getting Started
Prerequisites
- Node.js >= 18.0.0
- npm or pnpm
- Git
- A code editor (VS Code recommended)
Setting Up Development Environment
-
Fork and Clone
git clone https://github.com/YOUR_USERNAME/flowers.git cd flowers -
Install Dependencies
# Backend cd backend npm install # Frontend cd ../frontend npm install -
Configure Environment
cp backend/env.yaml.example backend/env.yaml # Edit env.yaml with your API keys -
Start Development
# Terminal 1: Backend cd backend npm run dev # Terminal 2: Frontend cd frontend npm run dev
๐ Development Workflow
Branch Strategy
main- Stable production codedevelop- Integration branch for featuresfeat/*- New featuresfix/*- Bug fixesdocs/*- Documentation updatesrefactor/*- Code refactoringtest/*- Test additions/updates
Workflow Steps
-
Create a Branch
git checkout -b feat/your-feature-name -
Make Changes
- Write code
- Add tests
- Update documentation
-
Test Locally
npm run lint npm run test npm run build -
Commit Changes
git add . git commit -m "feat: add amazing feature" -
Push and Create PR
git push origin feat/your-feature-name
๐ป Coding Standards
TypeScript/JavaScript
- Use TypeScript for all new code
- Follow ESLint rules (run
npm run lint) - Use Prettier for formatting
- Prefer functional components in React
- Use async/await over promises
Code Style
// โ
Good
export async function translateText(text: string, targetLang: string): Promise<string> {
const result = await llmClient.translate({ text, targetLang });
return result;
}
// โ Bad
export function translateText(text, targetLang) {
return llmClient.translate({ text, targetLang }).then(result => result);
}
React Components
// โ
Good
interface ButtonProps {
label: string;
onClick: () => void;
variant?: 'primary' | 'secondary';
}
export function Button({ label, onClick, variant = 'primary' }: ButtonProps) {
return (
<button className={cn('btn', `btn-${variant}`)} onClick={onClick}>
{label}
</button>
);
}
// โ Bad
export function Button(props) {
return <button onClick={props.onClick}>{props.label}</button>;
}
File Naming
- Components:
PascalCase.tsx(e.g.,NoteCard.tsx) - Utilities:
camelCase.ts(e.g.,formatDate.ts) - Hooks:
use*.ts(e.g.,useNotes.ts) - Types:
types.tsor*.types.ts
๐ Commit Guidelines
We follow Conventional Commits.
Format
<type>(<scope>): <subject>
<body>
<footer>
Types
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Examples
feat(chat): add streaming response support
Implement streaming for chat responses to improve UX.
Users can now see responses as they are generated.
Closes #123
fix(popover): correct width calculation on mobile
The popover was extending beyond viewport on small screens.
Changed max-width calculation to account for padding.
๐ Pull Request Process
Before Submitting
- Code follows project style guidelines
- All tests pass (
npm run test) - Linter passes (
npm run lint) - Documentation is updated
- Commits follow conventional format
- Branch is up to date with
main
PR Template
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
How was this tested?
## Screenshots (if applicable)
Add screenshots here
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Comments added for complex code
- [ ] Documentation updated
- [ ] No new warnings generated
- [ ] Tests added/updated
- [ ] All tests passing
Review Process
- Automated Checks - CI/CD runs tests and linting
- Code Review - Maintainers review code
- Feedback - Address review comments
- Approval - At least one maintainer approval required
- Merge - Squash and merge to main
๐ Project Structure
Backend
backend/src/
โโโ agent/ # Workflow orchestration
โโโ services/ # Core services (LLM, RAG, prompts)
โโโ storage/ # Data persistence
โโโ config/ # Configuration
โโโ utils/ # Utilities
Frontend
frontend/src/
โโโ components/ # React components
โโโ background/ # Service worker
โโโ content/ # Content scripts
โโโ sidepanel/ # Main workspace
โโโ shared/ # Shared code (API, store, hooks)
๐งช Testing
Running Tests
# All tests
npm run test
# Watch mode
npm run test:watch
# Coverage
npm run test:coverage
Writing Tests
import { describe, it, expect } from 'vitest';
import { translateText } from './translate';
describe('translateText', () => {
it('should translate English to Chinese', async () => {
const result = await translateText('Hello', 'zh');
expect(result).toBe('ไฝ ๅฅฝ');
});
it('should handle empty input', async () => {
const result = await translateText('', 'zh');
expect(result).toBe('');
});
});
๐ Documentation
Code Comments
/**
* Translates text using the configured LLM
* @param text - Text to translate
* @param targetLang - Target language code (e.g., 'zh', 'en')
* @returns Translated text
* @throws {APIError} If translation fails
*/
export async function translateText(text: string, targetLang: string): Promise<string> {
// Implementation
}
README Updates
- Update README.md for new features
- Add examples for new APIs
- Update screenshots if UI changes
Changelog
- Add entry to CHANGELOG.md
- Follow Keep a Changelog format
๐ Reporting Bugs
Before Reporting
- Check existing issues
- Try latest version
- Gather reproduction steps
Bug Report Template
**Describe the bug**
Clear description of the bug
**To Reproduce**
1. Go to '...'
2. Click on '...'
3. See error
**Expected behavior**
What you expected to happen
**Screenshots**
If applicable
**Environment**
- OS: [e.g., Windows 11]
- Browser: [e.g., Chrome 120]
- Extension Version: [e.g., 1.0.0]
๐ก Feature Requests
We welcome feature requests! Please:
- Check if feature already requested
- Describe use case clearly
- Explain why it's valuable
- Provide examples if possible
๐ Getting Help
- GitHub Discussions - For questions and discussions
- GitHub Issues - For bugs and feature requests
- Email - For private inquiries
๐ Thank You
Your contributions make Flowers better for everyone. We appreciate your time and effort!
Happy Coding! ๐ธ