Skip to content

Developer Guide

Sahar Mehrpour edited this page Sep 13, 2024 · 8 revisions

Thank you for your interest in contributing to our project! In our project, contributions are made through pull requests. You can refer to this article on how to make a pull request.

Node.js Version Compatibility

This codebase is compatible with Node.js version 16. To manage and switch between different Node.js versions without downgrading your system's Node version, it is recommended to use the nvm (Node Version Manager) library.

Setting up the environment

  1. Install srcML as instructed here
  2. Install the IDE plugin as instructed here.
  3. Open your Java project:
  • Open your desired java projects in the IDE (IntelliJ or VS Code).
    • Make sure only ONE project is open in the IDE.
    • If more projects are open, close all and re-open one project.
  • Download spmf.jar.
    • This file is a library which is essential for the process of extracting design rules from the codebase.
  • Copy spmf.jar to the root directory of the project.
    • Note: spmf.jar should be added for all java projects you wish to work on.

Setting up the project

  1. Fork https://github.com/ourcodeinc/ActiveDocumentation-webapp repository (Refer to this article on how to fork a repository).
  2. Clone the forked project on your system.
  3. Navigate to the cloned directory.
  4. Install the dependencies by running npm install
  5. To start the Project, depending on your operating system, run one of the following commands (See package.json for the details):
    • macOS:
      npm run start-Mac
    • Linux:
      npm run start-Linux
    • Windows:
      npm run start-Windows
  6. To start the app, open Chrome and visit:
http://localhost:9010/

Coding Style

We employed ESLint to ensure that submitted code adheres to our coding standards. You can check if your code follows our coding style by running ESLint locally.

  • Run ESLint on your code:
    npx eslint .
  • Fix any issues reported by ESLint. Some issues can be automatically fixed by running:
    npx eslint . --fix

You can temporarily disable eslint on your local machine by adding DISABLE_ESLINT_PLUGIN=true to .env file. But keep in mind that your PR is going to be checked against the same eslint rules.

Code Quality and Best Practices

  • Run ESLint: Always run ESLint locally before submitting your PR to ensure your code adheres to our coding standards. Fix any linting errors.
  • Avoid Unnecessary Changes: Ensure that your PR only includes relevant changes. Avoid unnecessary modifications such as extra spaces, empty lines, or other formatting changes that do not contribute to the functionality or readability of the code.
  • Descriptive Commits: Use descriptive commit messages to explain the purpose of your changes.
  • Descriptive PR: Please mention the issue you are fixing in the description of your PR.
  • Focused PR: Try to address a single issue in one PR.

Thank you for contributing!