Skip to content

Latest commit

 

History

History
202 lines (165 loc) · 6.03 KB

File metadata and controls

202 lines (165 loc) · 6.03 KB

Contributing to CSES TritonSpend

First off, thank you for considering contributing to TritonSpend! 🎉 We welcome all contributions and are excited to see what you'll bring to the project.

Table of Contents

Code of Conduct

By participating in this project, you agree to uphold the Code of Conduct. Please read it to understand what actions will and will not be tolerated.

Getting Started

Setting Up the Environment

Note: You may have to restart terminal after installing each environment.

Downloading Git (and Git Bash)

  1. Download git and git bash by following this link.
  2. Set up Git Bash as the shell for running command line prompts (in VSCode or directly openning Git Bash)
  3. Run:
    git -v
    This should output something like this:
    git version 2.46.0.windows.1

Downloading Node.JS

  1. Download nvm (Node Version Manager). Follow the instructions on in this link for the details.
  2. Run:
    nvm -v
    This should output the version of nvm you installed.
  3. Install Node.js v18.20.4:
    nvm install v18.20.4**
  4. Switch to the installed version:
    nvm use v18.20.4**
  5. Run:
    node -v
    npm -v
    The results should be something like:
    v18.20.4
    10.7.0

Setting Up the Local Repository

  1. Fork the repository to your GitHub account.
  2. Clone the origin repository locally:
    git clone https://github.com/CSES-Open-Source/TritonSpend.git
  3. Create a remote repository:
    git remote add [your-username] https://github.com/[your-username]/TritonSpend.git
  4. Run:
    git remote -v
    The output should be something like the following:
    [your-username]    https://github.com/[your-username]/TritonSpend.git (fetch)
    [your-username]    https://github.com/[your-username]/TritonSpend.git (push)
    origin  https://github.com/CSES-Open-Source/TritonSpend.git (fetch)
    origin  https://github.com/CSES-Open-Source/TritonSpend.git (push)

Installing Dependencies

  1. Open an instance of git bash and run:
    cd frontend
  2. Install frontend libraries:
    npm install
  3. Open another instance of git bash and run:
    cd backend
  4. Install backend libraries:
    npm install

Setting Up the Local Development Database

  1. Go to postgresql.org/download/ and download PostgreSQL for your OS.
  2. Open the installer, and follow the on screeen instructions.

Running the Backend and Frontend

  1. Open an instance of git bash and run:
    cd frontend
  2. Install frontend libraries:
    npm start
  3. Open another instance of git bash and run:
    cd backend
  4. Install backend libraries:
    npm start

Phew... That was a lot of setting up. But you are good to go now!

How to Contribute

Reporting Bugs

  1. Open the CSES Opensource TritonSpend Github Repo.
  2. Click on the issues tab (next to code).
  3. Create a new issue.
  4. Select Bug report as the type of issue.
  5. Fill in the title and description and submit the issue.

Suggesting Features

  1. Open the CSES Opensource TritonSpend Github Repo.
  2. Click on the issues tab (next to code).
  3. Create a new issue.
  4. Select Feature request as the type of issue.
  5. Fill in the title and description and submit the issue.

Improving Documentation

Submitting a Pull Request

  1. Create a new branch for the current issue you are working on:
    git checkout -b origin/main [name-of-branch]
  2. Make changes to the branch and commit changes. I would recomment using VSCode version control or GitHub Desktop for making commits.
  3. Run lint in respective frontend and backend directories:
    npm run lint-check
    Make sure to fix all lint errors before pushing your code.
  4. Push the commits to your forked repository:
    git push [your-username] HEAD
    [your-username] is whatever you chose to set the name of your remote repository as. To check this type:
    git remote -v
  5. Go to your forked repository and make a pull request to the main branch of the original repository. Make sure to fill in the title and description of the pull request.

Development Guidlines

Code Style

Please follow these coding style guidelines:

  • We recommend using Prettier to format on save, and then running ESLint before making a pull request.
  • Indent with tabs and use a 2-space indentation.
  • Use semicolons and the end of each line.
  • Write clear, concise comments where necessary.
  • Use meaningful variable and function names.

Commit Messages

Please write a rough description for the changes made in each commits

Contact

For any issues or questions, please contact Shree Venkatesh (s1venkatesh@ucsd.edu) or UC San Diego CSES (cses@ucsd.edu).