Docs
Contribution Guide

Contributing to Our Project

Thank you for your interest in contributing to our project! We have two main repositories: one for the frontend and one for the backend. This guide will help you contribute to both.

Project Structure

Our project is divided into two main repositories:

  1. Frontend: https://github.com/m2b3/SciCommons-frontend (opens in a new tab)
  2. Backend: https://github.com/m2b3/SciCommons-backend (opens in a new tab)

Code of Conduct

By participating in this project, you are expected to uphold our Code of Conduct in both repositories.

Getting Started

For Frontend Development

  1. Fork the frontend repository
  2. Clone your fork:
    git clone https://github.com/m2b3/SciCommons-frontend.git
  3. Set up the development environment:
    cd frontend
    yarn install
  4. Create a branch for your changes:
    git checkout -b your-branch-name

For Backend Development

  1. Fork the backend repository
  2. Clone your fork:
    git clone https://github.com/m2b3/SciCommons-backend.git
  3. Set up the development environment:
    cd backend
    Follow the instructions in the README.md file to set up the backend environment.
  4. Create a branch for your changes:
    git checkout -b your-branch-name

How to Contribute

Reporting Bugs

Before creating bug reports, please check both repositories' issue trackers. When creating a bug report, please include as many details as possible and use the following template:

## Description
[A clear and concise description of what the bug is.]

## Steps To Reproduce
1. [First Step]
2. [Second Step]
3. [and so on...]

## Expected behavior
[What you expect to happen]

## Actual behavior
[What actually happens]

## Repository
[Specify whether this is a frontend or backend issue]

## Additional context
[Add any other context about the problem here.]

Suggesting Enhancements

We welcome enhancement suggestions for both frontend and backend. Please use the following template:

## Is your feature request related to a problem? Please describe.
[A clear and concise description of what the problem is.]

## Describe the solution you'd like
[A clear and concise description of what you want to happen.]

## Repository
[Specify whether this is for the frontend or backend]

## Describe alternatives you've considered
[A clear and concise description of any alternative solutions or features you've considered.]

## Additional context
[Add any other context or screenshots about the feature request here.]

Pull Requests

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a build.
  2. Update the README.md in the relevant repository with details of changes.
  3. Increase the version numbers in any examples files and the README.md to the new version that this Pull Request would represent.
  4. You may merge the Pull Request once you have the sign-off of two other developers, or if you do not have permission to do that, you may request the second reviewer to merge it for you.

Style Guidelines

Git Commit Messages

  • Use the present tense ("Add feature" not "Added feature")
  • Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
  • Limit the first line to 72 characters or less
  • Reference issues and pull requests liberally after the first line

Frontend Style Guide

We use Husky and lint-staged to enforce our frontend code style:

  • ESLint is configured to catch and fix JavaScript/TypeScript issues
  • TypeScript compiler checks for type errors
  • Prettier ensures consistent code formatting

These checks run automatically on staged files when you commit. If there are any issues, the commit will be blocked until you fix them.

Backend Style Guide

We use pre-commit hooks to maintain our backend code quality:

  • Flake8 checks for Python code style and quality issues
  • Black automatically formats Python code
  • isort sorts Python imports

Before committing, run the following command to apply these checks to all files:

pre-commit run --all-files

This will ensure your code adheres to our style guidelines before you commit.

General Guidelines

  • Write clear, readable, and self-documenting code
  • Include comments for complex logic, but prefer clear code over excessive comments
  • Write unit tests for new features and bug fixes

Testing

  • For frontend, run tests with: yarn test
  • For backend, run tests with: poetry run python manage.py test

Ensure all tests pass before submitting a pull request.

Additional Notes

Issue and Pull Request Labels

Label nameDescription
bugConfirmed bugs or reports that are very likely to be bugs
enhancementFeature requests
frontendRelated to the frontend repository
backendRelated to the backend repository
good first issueGood for newcomers

Recognition

Contributors will be recognized in both repositories' CONTRIBUTORS.md files. We value every contribution, whether it's to the frontend or backend!

Thank you for contributing to our project! 🎉