Thank you for your interest in contributing to Neurothumb! This document provides guidelines and instructions for contributing to the project.
We are committed to providing a welcoming and inclusive environment for all contributors. Please be respectful and constructive in all interactions.
If you find a bug, please create an issue on GitHub with:
- Clear title: Describe the bug concisely
- Description: Explain what happened and what you expected
- Steps to reproduce: Provide detailed steps to reproduce the issue
- Environment: Include OS, Python version, Node.js version, etc.
- Screenshots: If applicable, add screenshots or error messages
- Logs: Include relevant error logs or console output
Feature suggestions are welcome! Please create an issue with:
- Clear title: Describe the feature concisely
- Description: Explain the feature and why it would be useful
- Use cases: Provide specific use cases or examples
- Implementation ideas: If you have thoughts on how to implement it
-
Fork the repository and create a new branch:
git checkout -b feature/your-feature-name
-
Make your changes following the code style guidelines:
- Use consistent indentation (2 spaces for JavaScript, 4 for Python)
- Write clear, descriptive commit messages
- Add comments for complex logic
- Keep functions small and focused
-
Test your changes:
# Frontend tests pnpm test # Linting pnpm lint # Manual testing pnpm dev
-
Update documentation if needed:
- Update README.md for user-facing changes
- Update API documentation for endpoint changes
- Add comments to code for complex logic
-
Commit and push:
git add . git commit -m "Add: Brief description of changes" git push origin feature/your-feature-name
-
Create a Pull Request:
- Use a clear, descriptive title
- Reference any related issues
- Describe your changes and why they're needed
- Ensure CI/CD checks pass
- Node.js 18+
- Python 3.11+
- Modal account
- Supabase account
-
Clone the repository:
git clone https://github.com/sriharideveloper/neurothumb.git cd neurothumb -
Install dependencies:
pnpm install
-
Configure environment:
cp .env.example .env.local # Fill in your credentials -
Run development server:
pnpm dev
-
Open in browser:
http://localhost:3000
neurothumb/
├── app/ # Next.js app directory
│ ├── api/ # API routes
│ ├── login/ # Authentication
│ └── page.jsx # Main page
├── components/ # React components
├── lib/ # Utility functions
│ ├── byok-config.js # BYOK configuration
│ └── byok-server.js # Server-side config
├── modal_backend/ # Modal serverless backend
│ ├── backend.py # TRIBE v2 inference
│ └── requirements.txt # Python dependencies
├── scripts/ # Setup and utility scripts
├── docs/ # Documentation
└── public/ # Static assets
- Use ES6+ syntax
- Use functional components with hooks
- Use descriptive variable names
- Add JSDoc comments for functions
- Use const/let, avoid var
- Use async/await over .then()
Example:
/**
* Analyze a YouTube thumbnail
* @param {string} imageUrl - URL of the thumbnail
* @returns {Promise<Object>} Analysis results
*/
export async function analyzeThumbnail(imageUrl) {
const response = await fetch('/api/analyze', {
method: 'POST',
body: JSON.stringify({ image_url: imageUrl })
});
return response.json();
}- Follow PEP 8 style guide
- Use type hints
- Add docstrings to functions and classes
- Use descriptive variable names
- Keep functions focused and testable
Example:
def analyze_thumbnail(image_url: str) -> dict:
"""
Analyze a YouTube thumbnail using TRIBE v2 model.
Args:
image_url: URL of the thumbnail image
Returns:
Dictionary containing metrics and heatmap
"""
# Implementation
return results- Use BEM naming convention for classes
- Keep specificity low
- Use variables for colors and spacing
- Mobile-first responsive design
Example:
.thumbnail-card {
padding: var(--spacing-md);
&__image {
width: 100%;
border-radius: var(--radius-md);
}
&__title {
margin-top: var(--spacing-sm);
font-size: var(--font-size-lg);
}
}# Run all tests
pnpm test
# Run tests in watch mode
pnpm test:watch
# Run tests with coverage
pnpm test:coverage- Write tests for new features
- Aim for >80% code coverage
- Use descriptive test names
- Test both happy paths and edge cases
Example:
describe('analyzeThumbnail', () => {
it('should return metrics for valid image URL', async () => {
const result = await analyzeThumbnail('https://example.com/image.jpg');
expect(result).toHaveProperty('metrics');
expect(result).toHaveProperty('heatmap_base64');
});
it('should throw error for invalid URL', async () => {
await expect(analyzeThumbnail('invalid')).rejects.toThrow();
});
});- Keep it concise and well-organized
- Include examples for common tasks
- Link to detailed documentation
- Update table of contents if needed
- Document all endpoints
- Include request/response examples
- Explain error codes
- Add usage examples
- Comment why, not what
- Keep comments up-to-date
- Use JSDoc/docstrings for public APIs
- Avoid over-commenting obvious code
Use clear, descriptive commit messages:
Add: Brief description of what was added
Fix: Brief description of what was fixed
Update: Brief description of what was updated
Refactor: Brief description of refactoring
Docs: Brief description of documentation changes
Examples:
Add: BYOK configuration system for Modal, Supabase, Gemini
Fix: Modal endpoint extraction in setup script
Update: README with new API documentation
Refactor: Extract common utility functions
Docs: Add environment setup guide
Use descriptive branch names:
feature/byok-system
fix/modal-endpoint-extraction
docs/api-documentation
refactor/utility-functions
-
Code Review: Maintainers will review your PR for:
- Code quality and style
- Test coverage
- Documentation
- Performance implications
-
Feedback: Address any feedback or suggestions
-
Approval: Once approved, your PR will be merged
-
Release: Your changes will be included in the next release
Releases follow semantic versioning (MAJOR.MINOR.PATCH):
- MAJOR: Breaking changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes
- Check existing issues and discussions
- Read the documentation in
/docs - Ask questions in GitHub Discussions
- Join our community Discord (if available)
By contributing to Neurothumb, you agree that your contributions will be licensed under the MIT License.
Contributors will be recognized in:
- CONTRIBUTORS.md file
- Release notes
- Project README
Thank you for contributing to Neurothumb! 🥐