Thank you for your interest in contributing to SymChat! This document provides guidelines and instructions for contributing.
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/sympchat.git - Install dependencies:
npm install - Create a branch:
git checkout -b feature/your-feature-name
- Make sure Ollama is installed and running
- Install at least one model:
ollama pull llama2 - Copy
.env.exampleto.envand configure if needed - Start the dev server:
npm run dev
We use ESLint and TypeScript for code quality:
npm run lintPlease ensure your code:
- Follows TypeScript best practices
- Uses functional components with hooks
- Includes proper type definitions
- Has meaningful variable/function names
- Includes comments for complex logic
-
Place in appropriate directory:
- UI components:
src/components/ui/ - Feature components:
src/components/ - Hooks:
src/hooks/ - Utils:
src/lib/
- UI components:
-
Use TypeScript interfaces for props:
interface MyComponentProps {
title: string
onClick: () => void
}
export function MyComponent({ title, onClick }: MyComponentProps) {
// Component logic
}- Export from component file:
export { MyComponent }- Use Tailwind CSS utility classes
- Use
cn()utility for conditional classes - Follow shadcn/ui patterns for consistency
- Support dark mode using CSS variables
Example:
<div className={cn(
"base-classes",
isActive && "active-classes",
className
)}>- Check existing issues/PRs to avoid duplicates
- Create an issue to discuss major changes
- Get feedback on your approach
- Create a new branch from
main - Implement your feature with tests
- Update documentation
- Submit a pull request
Your PR should:
- Have a clear title and description
- Reference related issues
- Include screenshots for UI changes
- Pass all CI checks
- Be reviewed by at least one maintainer
PR Template:
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Tested locally
- [ ] Added/updated tests
- [ ] No new warnings
## Screenshots
(if applicable)
## Related Issues
Closes #issue-numberCurrently we don't have automated tests, but please:
- Test your changes thoroughly locally
- Test in both light and dark modes
- Test responsive design on mobile
- Verify Ollama integration works
- Check browser console for errors
Update documentation when:
- Adding new features
- Changing existing functionality
- Adding new configuration options
- Updating dependencies
Files to update:
README.md- User-facing documentationDEPLOYMENT.md- Deployment instructionsCONTRIBUTING.md- This file- Code comments - For complex logic
Before adding a new dependency:
- Check if existing libraries can solve the problem
- Verify the package is actively maintained
- Check bundle size impact
- Discuss in an issue first for major dependencies
Follow conventional commits format:
type(scope): description
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation onlystyle: Code style changesrefactor: Code refactoringperf: Performance improvementstest: Adding testschore: Maintenance tasks
Examples:
feat(chat): add support for image uploads
fix(ui): resolve dark mode toggle issue
docs(readme): update installation instructions
sympchat/
├── src/
│ ├── components/ # React components
│ │ ├── ui/ # shadcn/ui components
│ │ └── ... # Feature components
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utilities and API clients
│ ├── App.tsx # Main app component
│ └── main.tsx # Entry point
├── public/ # Static assets
├── CONTRIBUTING.md # This file
├── DEPLOYMENT.md # Deployment guide
└── README.md # Main documentation
When reporting bugs, include:
- Description: Clear description of the issue
- Steps to reproduce: Detailed steps
- Expected behavior: What should happen
- Actual behavior: What actually happens
- Environment:
- OS and version
- Browser and version
- Ollama version
- Node.js version
- Screenshots: If applicable
- Console logs: Error messages
When requesting features:
- Check if it already exists or is planned
- Describe the use case
- Explain why it would be useful
- Suggest possible implementation (optional)
- Be respectful and inclusive
- Welcome newcomers
- Provide constructive feedback
- Focus on the best solution for the project
- Respect others' time and effort
- Open an issue for questions
- Join discussions in existing issues
- Check README and documentation first
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to SymChat! 🎉