Skip to content

Development

Wang Xinyi edited this page Aug 27, 2024 · 10 revisions

Setup

  1. Fork the Repository: Start by forking the CRISP repository to your own GitHub account.

  2. Clone Your Fork: Clone your fork to your local machine:

    git clone https://github.com/<your-username>/CRISP.git
  3. Install Dependencies: Navigate to both the frontend and backend directories and install the necessary packages using npm

    cd CRISP/multi-git-dashboard
    npm install
    
    cd ../backend
    npm install
  4. Environment Setup: Set up your .env.development files. Check home for more details.

  5. Run the Development Servers: For the frontend and backend, run the development servers:

    // For multi-git-dashboard
    npm run dev
    
    // For backend
    npm run dev

Commit Guideline

Write clear and detailed commit messages. A commit message consists of a header, a body, and a footer. The header has a special format that includes a type, a scope, and a subject:

<type>(<optional scope>): <description>

<optional body>

<optional footer>

Types

  • API relevant changes
    • feat Commits, that adds or remove a new feature
    • fix Commits, that fixes a bug
  • refactor Commits, that rewrite/restructure your code, however does not change any API behaviour
    • perf Commits are special refactor commits, that improve performance
  • style Commits, that do not affect the meaning (white-space, formatting, missing semi-colons, etc)
  • test Commits, that add missing tests or correcting existing tests
  • docs Commits, that affect documentation only
  • build Commits, that affect build components like build tool, ci pipeline, dependencies, project version, ...
  • ops Commits, that affect operational components like infrastructure, deployment, backup, recovery, ...
  • chore Miscellaneous commits e.g. modifying .gitignore

Example commit message:

feat(authentication): implement OAuth2 login flow

Implemented the OAuth2 login flow using the passport library. This includes
routes for redirecting to the OAuth provider, callback routes, and user session
management.

Resolves #123

Pull Request (PR) Guideline

Once you're ready to share your contributions, follow these steps to submit a Pull Request using the forking workflow:

  1. Create a New Branch: Create a new branch for your changes based on the main branch on your GitHub fork.

    git checkout -b feature/my-new-feature main
  2. Make Your Changes: Implement your feature or fix and commit your changes using the provided format.

  3. Keep Your Branch Updated: Regularly pull the latest changes from the upstream repository and merge them into your branch to keep it up to date.

    git fetch upstream
    git rebase upstream/main
  4. Run the code formatter: Run the Prettier script in both the frontend and the backend

    cd multi-git-dashboard
    npm run prettier-format
    cd ../backend
    npm run prettier-format
  5. Push Your Changes: Push your branch and changes to your GitHub fork.

    git push origin feature/my-new-feature
  6. Open a Pull Request (PR): Go to your fork on GitHub and create a new Pull Request against the staging branch of the upstream repository. Make sure to fill out the PR template with the necessary details.

Clone this wiki locally