Thank you for your interest in contributing to NoteHand! As an open-source project, we welcome improvements, bug fixes, features, and documentation enhancements.
Following these guidelines helps ensure a smooth, efficient process for everyone.
By participating in this project, you agree to maintain a respectful, welcoming, and professional environment. Please read and follow our Code of Conduct in all interactions.
To set up your local development environment, follow these steps:
- Fork the Repository: Fork NoteHand to your own GitHub account.
- Clone Locally:
git clone https://github.com/YOUR_USERNAME/NoteHand.git cd NoteHand - Install Dependencies:
npm install
- Configure environment files:
Create a local configuration file:
cp .env.example .env.local
- Run Development Server:
The application will be running at
npm run dev
http://localhost:3000.
We use a simple branching model. Always create a branch off the main branch before editing code. Use prefixes to identify the type of changes:
feature/— Add a new capability (e.g.,feature/shape-auto-snapping).fix/— Fix a bug or issue (e.g.,fix/pinch-zoom-ios-deadlock).docs/— Documentation updates (e.g.,docs/add-contributing-guide).refactor/— Code cleanup or structural changes (e.g.,refactor/zod-schema-definitions).perf/— Performance enhancements (e.g.,perf/canvas-render-loops).
git checkout -b feature/your-feature-nameWe enforce the Conventional Commits standard for clear, readable project histories:
<type>(<scope>): <short summary>
[optional body description]
feat: A new feature.fix: A bug fix.docs: Documentation only changes.style: Code formatting changes (spaces, semicolons) that do not affect functionality.refactor: Code changes that neither fix a bug nor add a feature.perf: A code change that improves performance.test: Adding missing tests or correcting existing tests.chore: Build process or auxiliary tool updates.
feat(canvas): add shape auto-recognition logicfix(touch): prevent stale pointer entries on iOS Chromedocs(readme): add self-hosting instructions
Before opening a new issue, please search the existing issues to see if it has already been reported.
- For bug reports, use the Bug Report Template.
- For feature suggestions, use the Feature Request Template.
- For general help or setup assistance, open a thread in GitHub Discussions.
When you are ready to submit your changes:
- Rebase & Lint: Ensure your code is up to date with the latest
mainbranch, is formatted correctly, and compiles with zero TypeScript errors:npm run lint npm run build
- Push to your fork:
git push origin feature/your-feature-name
- Submit a Pull Request (PR): Open a PR against NoteHand's
mainbranch. - Use the PR Template: Fill out the generated PR Template completely, describing the bug/feature, testing performed, and checking off the pre-merge checklist.
- Review: Maintainers will review your PR and guide you if changes are needed before merging.
To maintain code quality across NoteHand, please follow these guidelines:
- TypeScript: Write fully-typed code. Avoid using
anytype signatures. - React Concurrent Rules: Ensure hooks, refs, and state are optimized. Do not bypass React render logic unless optimizing high-frequency render paths (like drawing overlays).
- Performance: Check for layout reflows and memory leaks (such as unremoved event listeners in
useEffect). - Security: Validate external parameters or storage data using the Zod validation schemas in
src/security/validation.ts. Sanitize any media usingprocessAndSanitizeImageinsrc/security/sanitizer.ts.
Before submitting a Pull Request, you must verify your changes:
- Type check validation: Run
npm run lint(tsc --noEmit) to verify that the TypeScript compiler finds no issues. - Production build check: Run
npm run buildto verify the asset bundler and code splitting operate without compilation warnings or errors. - Manual Test Matrix: Verify responsiveness across mobile, tablet, and desktop viewports, and confirm rendering in both light and dark appearance modes.