Hey there! Thanks for checking out PowerPulse and considering contributing! This guide will help you get started with the project. Don't worry, we're pretty laid back here.
- The Basics
- Getting Your Environment Set Up
- Making Changes
- Sending Your Changes Our Way
- Coding Style
- Commit Messages
- Testing Your Stuff
- Updating Docs
We have a Code of Conduct that boils down to "be nice to each other." Give it a quick read before jumping in.
- Fork the repo (click that Fork button at the top right of the GitHub page)
- Clone your fork to your computer:
git clone https://github.com/YOUR-USERNAME/powerpulse.git cd powerpulse
- Set up the original repo as "upstream" so you can stay up to date:
git remote add upstream https://github.com/blink-zero/powerpulse.git
- Install all the dependencies:
npm run install-all
- Create a branch for your awesome new feature:
git checkout -b cool-new-feature
- Make sure you're working with the latest code:
git fetch upstream git checkout main git merge upstream/main
- Branch off for your changes:
git checkout -b cool-new-feature
- Make your changes - go wild!
- Test things locally to make sure nothing broke
- Commit your changes (see commit message tips below)
- Push your branch to your fork:
git push origin cool-new-feature
- Head over to GitHub and create a Pull Request
When you're ready to submit a Pull Request (PR):
- Give it a clear title and description
- Mention any issues it fixes (like "Fixes #123")
- We'll review it as soon as we can and might suggest some tweaks
- Once everything looks good, we'll merge it in!
We're not super strict, but try to match the existing style:
- Use meaningful names for variables and functions
- Comment your code when it's doing something tricky
- Keep functions focused on doing one thing well
For React stuff:
- Functional components with hooks are our jam
- Destructure your props
- Use async/await for async operations
For CSS:
- We're using Tailwind CSS
- For custom CSS, follow BEM naming if possible
- Keep it simple!
We loosely follow the Conventional Commits style, but don't stress too much about it. The basic format is:
type: what you did
Common types are:
feat
: New featurefix
: Bug fixdocs
: Documentation changesstyle
: Formatting, missing semicolons, etc.refactor
: Code changes that don't add features or fix bugstest
: Adding or updating tests
We have a comprehensive testing setup with Jest for the server and Vitest for the client:
- Run client tests:
cd client && npm test
- Watch mode:
cd client && npm run test:watch
- Coverage report:
cd client && npm run test:coverage
- Run server tests:
cd server && npm test
- Watch mode:
cd server && npm run test:watch
- Coverage report:
cd server && npm run test:coverage
- Client tests go in
client/src/test
or alongside components with.test.jsx
extension - Server tests go in
server/tests
with.test.js
extension - Focus on testing functionality, not implementation details
- Don't worry about 100% coverage - just test the important parts
We use ESLint to maintain code quality:
- Lint client code:
cd client && npm run lint
- Fix client code:
cd client && npm run lint:fix
- Lint server code:
cd server && npm run lint
- Fix server code:
cd server && npm run lint:fix
We use GitHub Actions for our CI/CD pipeline:
- Every PR and push to main/develop branches triggers the pipeline
- The pipeline runs linting, tests, and builds the application
- All checks must pass before a PR can be merged
- Tagged releases are automatically built and prepared for deployment
When you submit a PR, check the GitHub Actions tab to see if your changes pass all checks.
If you're changing how something works:
- Update the README if needed
- Add JSDoc comments to functions if you can
- If you're changing an API, update the API.md file
That's it! Thanks for helping make PowerPulse better! 🎉