Skip to content

Contributing Guidelines

This document provides guidelines for contributing to the Elome Frontend project.

Getting Started

  1. Fork the repository: Start by forking the repository to your GitHub account.
  2. Clone the repository: Clone your fork to your local machine.
    git clone https://github.com/your-username/peachfuzz-frontend.git
    cd peachfuzz-frontend
    
  3. Install dependencies: Install the project dependencies.
    bun install
    
  4. Create a branch: Create a new branch for your contribution.
    git checkout -b feature/your-feature-name
    

Development Workflow

Code Style

The project uses ESLint for code linting. Make sure your code follows the project's style guidelines by running:

npx eslint .

Commit Guidelines

We follow the Conventional Commits specification for commit messages:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Types include:

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation changes
  • style: Changes that do not affect the meaning of the code (formatting, etc.)
  • refactor: Code changes that neither fix a bug nor add a feature
  • perf: Performance improvements
  • test: Adding or correcting tests
  • chore: Changes to the build process or auxiliary tools

Examples:

feat(cart): add ability to remove items from cart
fix(checkout): resolve issue with payment processing
docs: update README with new setup instructions

Pull Request Process

  1. Update your fork: Make sure your fork is up to date with the main repository.
    git remote add upstream https://github.com/original-owner/peachfuzz-frontend.git
    git fetch upstream
    git merge upstream/main
    
  2. Push your changes: Push your changes to your fork.
    git push origin feature/your-feature-name
    
  3. Create a pull request: Create a pull request from your fork to the main repository.
  4. Describe your changes: Provide a clear description of the changes you've made.
  5. Address review comments: Make any requested changes and push them to your branch.

Testing

All new features and bug fixes should include tests. Run the tests to make sure your changes don't break existing functionality:

bun run test

Documentation

Update documentation to reflect any changes you make:

  1. Code comments: Add JSDoc comments to functions, methods, and classes.
  2. README: Update the README if your changes affect setup or usage.
  3. API documentation: Update API documentation if you change GraphQL queries or mutations.
  4. Component documentation: Update component documentation if you add or modify components.

Component Development

When developing new components:

  1. Place components in the appropriate directory
  2. Include proper documentation
  3. Write tests for the component
  4. Follow the project's naming conventions

Store Development

When working with stores:

  1. Keep stores focused on a specific domain
  2. Implement proper error handling
  3. Add TypeScript types for state and actions
  4. Write tests for store actions and getters

Best Practices

Performance

  • Minimize component re-renders
  • Use computed properties for derived state
  • Implement lazy loading for components and routes
  • Optimize images and assets

Accessibility

  • Use semantic HTML elements
  • Add ARIA attributes where necessary
  • Ensure keyboard navigation works
  • Maintain sufficient color contrast

Security

  • Validate user input
  • Sanitize data from external sources
  • Use HTTPS for all API requests
  • Don't store sensitive information in client-side storage

Code Review Checklist

Before submitting a pull request, make sure your code meets these criteria:

  • Code follows the project's style guidelines
  • All tests pass
  • New features include tests
  • Documentation is updated
  • No console errors or warnings
  • No unused variables or imports
  • Commit messages follow the conventional commits format

Getting Help

If you need help or have questions:

  1. Check the existing documentation
  2. Look for similar issues in the issue tracker
  3. Ask for help in the pull request
  4. Contact the project maintainers

License

By contributing to this project, you agree that your contributions will be licensed under the project's license.