Thank you for your interest in contributing to WebPify! This document provides guidelines and instructions for contributing to the project.
Before you begin, ensure you have:
- Node.js (v18 or higher) and npm
- Python (3.8 or higher) and pip
- Git for version control
- A GitHub account
-
Fork the repository on GitHub
-
Clone your forked repository:
git clone https://github.com/YOUR-USERNAME/WebPify.git cd WebPify -
Set up the backend:
cd server python -m venv venv # On Windows venv\Scripts\activate # On macOS/Linux source venv/bin/activate pip install -r requirements.txt
-
Set up the frontend:
cd ../client npm install -
Optional: Create a
.envfile inclient/for custom configuration:# client/.env VITE_API_URL=http://localhost:8000/api/convert
-
Create a new branch for your changes:
git checkout -b feature/your-feature-name
-
Make your changes and test thoroughly
-
Follow the coding standards (see below)
-
Commit your changes with clear, descriptive commit messages:
git commit -m "feat: add support for AVIF format"
We follow the Conventional Commits specification:
feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
Examples:
feat: add batch processing for large file setsfix: resolve memory leak in image conversiondocs: update API documentation
Backend Testing:
cd server
python start.pyVisit http://localhost:8000/docs to test the API endpoints.
Frontend Testing:
cd client
npm run dev
# or
npm startVisit http://localhost:3000 (or the next available port) to test the UI.
-
Push your branch to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request on GitHub:
- Go to the original repository
- Click "New Pull Request"
- Select your fork and branch
- Fill out the PR template (if available)
- Submit the PR
-
Wait for review and respond to any feedback
- Follow PEP 8 style guidelines
- Use type hints where appropriate
- Add docstrings to functions and classes
- Keep functions focused and single-purpose
- Maximum line length: 100 characters
Example:
def convert_to_webp(image_data: bytes, quality: int = 85) -> bytes:
"""
Convert image data to WebP format.
Args:
image_data: Raw image bytes
quality: WebP quality (1-100)
Returns:
Converted WebP image bytes
"""
# Implementation here
pass- Use modern ES6+ syntax
- Follow React best practices
- Use meaningful variable and function names
- Keep components small and focused
- Add comments for complex logic
Example:
const FileUpload = ({ onFileSelect, maxFiles }) => {
const handleChange = (e) => {
const files = Array.from(e.target.files).slice(0, maxFiles);
onFileSelect(files);
};
return (
<input
type="file"
multiple
onChange={handleChange}
className="file-input"
/>
);
};Note: With Vite, files containing JSX must use the .jsx extension instead of .js for proper module resolution.
- Use Tailwind CSS utility classes
- Maintain consistent spacing and colors
- Ensure responsive design
- Follow existing design patterns
- All files containing JSX must use
.jsxextension - Use
import.meta.env.VITE_*for environment variables (notprocess.env) - Leverage Vite's fast HMR for rapid development iteration
- Build output goes to
build/directory (configurable invite.config.js)
server/
├── main.py # FastAPI application and routes
├── start.py # Server startup script
├── requirements.txt # Python dependencies
└── utils/
├── __init__.py
└── image_converter.py # Image processing logic
client/
├── src/
│ ├── App.jsx # Main application component
│ ├── index.jsx # Entry point
│ ├── index.css # Global styles
│ └── components/
│ ├── FileUpload.jsx
│ ├── ConversionProgress.jsx
│ ├── ConversionResults.jsx
│ ├── Features.jsx
│ ├── Header.jsx
│ └── Footer.jsx
├── public/
│ ├── fav.png
│ └── manifest.json
├── index.html # Vite HTML template
├── vite.config.js # Vite configuration
├── package.json
├── tailwind.config.js
└── postcss.config.js
We welcome contributions in various areas:
- Add support for more image formats (ICO, AVIF, etc.)
- Implement image resizing/optimization
- Add drag-and-drop support
- Implement progressive WebP loading
- Add batch download progress for large files
- Create a CLI tool version
- Add PWA support for offline functionality
- Implement image preview before conversion
- Performance optimizations
- Better error handling
- Enhanced UI/UX
- Accessibility improvements
- Internationalization (i18n)
- Dark mode support
- API documentation improvements
- Add code examples
- Create video tutorials
- Improve README
- Add architecture diagrams
- Add unit tests
- Add integration tests
- Add E2E tests
- Improve test coverage
- Report bugs using GitHub Issues
- Include steps to reproduce
- Provide error messages and screenshots
When reporting issues, please include:
- Description of the issue
- Steps to reproduce the problem
- Expected behavior
- Actual behavior
- Screenshots (if applicable)
- Environment details:
- OS and version
- Node.js version
- Python version
- Browser (for frontend issues)
- Be respectful and inclusive
- Welcome newcomers and help them learn
- Give constructive feedback
- Focus on what is best for the community
- Use welcoming language
- Be respectful of differing viewpoints
- Accept constructive criticism gracefully
- Show empathy towards other community members
- Harassment or discriminatory language
- Personal attacks or trolling
- Publishing others' private information
- Other conduct that could be considered inappropriate
If you have questions about contributing, please:
- Open a GitHub Discussion
- Create an issue with the "question" label
- Contact the maintainers
By contributing to WebPify, you agree that your contributions will be licensed under the MIT License.
Contributors will be recognized in:
- README.md (Contributors section)
- Release notes (for significant contributions)
- GitHub Contributors page
Thank you for contributing to WebPify! 🎉