Getting Started
Before you begin contributing, make sure you have the development environment set up properly.Set up development environment
Install dependencies and start the development server:Refer to the Building from Source guide for detailed setup instructions.
Load the extension in your browser
Load the unpacked extension from the
build/ folder in Chrome or Firefox to test your changes.See the Building from Source guide for browser-specific instructions.Development Workflow
Making Changes
- Make your changes in the
src/directory - Test thoroughly by loading the extension in your browser
- Run code formatting before committing:
The project uses Prettier for consistent code formatting across JavaScript, TypeScript, JSON, CSS, SCSS, and Markdown files.
Testing Your Changes
Since this is a browser extension with webcam integration, testing requires manual verification:Test the Options page
- Open the extension’s Options page
- Grant camera permissions if prompted
- Wait for the MoveNet model to load and start tracking
- Verify that pose detection is working correctly
- Set a “good posture” baseline
Test the content script
- Navigate to any website
- Ensure the blur effect applies when you deviate from good posture
- Verify the blur disappears when you return to good posture
- Test on multiple websites to ensure compatibility
Test the popup
- Click the extension icon in the browser toolbar
- Test the “Reset Good Posture” functionality
- Verify the popup UI displays correctly
Hot Reload Behavior
When making changes:- Options/Popup pages: Changes auto-reload
- Content script: Requires manual extension reload in
chrome://extensions/ - Background service worker: Requires manual extension reload
- Manifest changes: Requires manual extension reload
Code Style Guidelines
JavaScript and TypeScript
- Use TypeScript for new files when possible
- Follow the existing code style (enforced by ESLint)
- Use functional components and React Hooks
- Add type annotations for function parameters and return types
File Organization
- Place new components in the appropriate
src/pages/subdirectory - Keep utility functions in separate modules (e.g.,
modules/draw_utils.ts) - Use descriptive file names that reflect the component or functionality
React Best Practices
- Use React 17 patterns (the project uses React 17.0.2)
- Prefer hooks over class components
- Keep components focused and single-purpose
- Extract reusable logic into custom hooks
Submitting Changes
Before Submitting
Test thoroughly
- Test all affected functionality
- Test in both Chrome and Firefox if possible
- Create a production build and test it
Creating a Pull Request
- Go to the original repository on GitHub
- Click “New Pull Request”
- Select your fork and branch
- Provide a clear title and description:
- What changes did you make?
- Why are these changes needed?
- How did you test the changes?
- Submit the pull request
Pull Request Guidelines
- One feature per PR: Keep pull requests focused on a single feature or fix
- Descriptive titles: Use clear, concise titles that summarize the changes
- Detailed descriptions: Explain what, why, and how
- Screenshots/videos: Include visual evidence for UI changes
- Test results: Describe how you tested the changes
Feature Ideas and Roadmap
The project has several potential enhancements:Current TODOs
- User adjustable posture deviation range
- Additional configuration options
- Improved visual feedback
- Performance optimizations
Suggesting New Features
Before implementing a new feature:- Check existing issues to see if it’s already been discussed
- Open an issue to discuss the feature with maintainers
- Wait for feedback before investing significant development time
- Implement the feature once approved
Privacy and Security
Privacy Commitment
- No analytics: The extension does not include any analytics or tracking libraries
- No data collection: User data never leaves the extension
- Local processing: All pose detection happens locally using TensorFlow.js
- No external requests: The extension does not make network requests
- Do not add analytics or tracking code
- Do not collect or transmit user data
- Keep all processing local to the browser
- Do not add dependencies that compromise privacy
License
By contributing to this project, you agree that your contributions will be licensed under the MIT License.MIT License Summary
The project is licensed under the MIT License, which allows:- Commercial use
- Modification
- Distribution
- Private use
- License and copyright notice must be included
- Software is provided “as is” without warranty
Getting Help
- Documentation: Review the Project Structure for codebase organization
- Issues: Check GitHub Issues for known problems
- Questions: Open a new issue with the “question” label
Recognition
Contributors are recognized in the project’s commit history and GitHub contributors list. Thank you for helping improve Posture!Posture!Posture!Technology Resources
Familiarize yourself with the key technologies:- React Documentation
- TypeScript Documentation
- Chrome Extension Manifest V3
- TensorFlow.js MoveNet
- Webpack 5 Documentation
The extension uses React 17, which has a different API than React 18. Be sure to reference React 17 documentation when working with the codebase.