hounvs / QueueUp

Queueing application with stat tracking
https://hounvs.github.io/QueueUp
0 stars 0 forks source link

How To Contribute

To contribute to the completion of this community tool you will need a basic understanding of how Git and GitHub work. In the following sections I will do a basic overview of Git/GitHub commands and terminology, followed by a tutorial on how to make your changes to the build, and finally making a pull request.

What you need

Required

Optional

Otherwise you will have to push to your local repository every time you want to test something

Git and GitHub

What is Git?

Git is a type of source control. If you have Git installed, there should be no reason to ever lose your work. The first step to using Git is to set up a repository. After you initialize a repository, Git will begin tracking the following:

  1. Changes to existing files in the repository directory
  2. Additions of new files in the repository directory
  3. Deletions of files in the repository directory

What is GitHub?

GitHub is just a website that is dedicated to hosting repositories in a central location for developers to connect and collaborate. GitHub hosts the online repository for QueueUp.

Terminology

Setting up Your Fork

Now we're ready to contribute to QueueUp!

First, we need to set up your fork. You should only need to do this once.

NOTE: I'm assuming you are using Windows.

  1. Log in or create an account on GitHub. You do not need to pay for anything.
  2. Download Git Bash - a command line tool for Git.
  3. Go to the original repository for QueueUp.
  4. Click the Fork button in the top right corner of the page. This creates a clone of the project into your account.
  5. You should now be on the page for your fork of the QueueUp repository.
  6. Copy the URL of the repository from the search bar at the top and add .git to the end. For example, my URL is:

    https://github.com/vince/QueueUp.git

  7. Go to the folder where you want your local repository to reside. For example, I would go to:

    C:\Users\Vince\Documents\GitHub\Queueup - Fork\

  8. Right-Click in the whitespace of the folder you want your local repository to reside and then click the Git Bash option. This opens a terminal in the current directory.
  9. Next, we need to copy your repository into this folder. To do this, in the Git Bash terminal type: git clone followed by the URL you copied earlier. For example, I would type:

    git clone https://github.com/vince/QueueUp.git

  10. Now, Git should be downloading your fork into this folder. Wait until it completes.
  11. After it completes, you need to enter the QueueUp folder that was downloaded in the Git Bash terminal. To do this, type:

    cd QueueUp

  12. At this point, we need to tell your repository where the upstream repository is. Type:

    git remote add upstream https://github.com/hounvs/QueueUp.git

  13. Now, to download the upstream repository simply type:

    git fetch upstream

Making Your Changes

At this point, we've already set up our fork so now we need to make a change! Let's say, for example, that you decided to modify one file: profileForm.html

Most of the time, people make their changes in a temporary folder somewhere other than your fork's folder. To make your change, just edit profileForm.html and then drag it into the correct folder in your fork's directory (projectm/pf/fighter/marth/).

So, you made your change to profileForm.html and now you want it to be in the original QueueUp repository.

  1. Open Git Bash in your fork's QueueUp folder. For example, I would right-click in the whitespace of the folder and click the Git Bash option in:

    C:\Users\Vince\Documents\GitHub\Queueup - Fork\

  2. In the Git Bash terminal, type:

    git status. This command tells you which files you added, modified, or deleted for this commit.

    Since we modified profileForm.html, you should see something that says (in red):
    modified    QueueUp/_includes/profileForm.html
  3. Assuming it says you modified something, you now need to commit your changes. Here is the command you will type:

    git commit -am "Detailed Commit Message Here"

    Obviously, git commit tells Git that you are committing a change. The "-am"
    part has a very specific meaning however.
    "a" - Add all modified, added, or deleted files to this commmit.
    "m" - The following message is my commit message.
    
    The commit message should be a fairly detailed description of the changes
    that you made to the files. In the example, we did something to
    profileForm.html, remember? So the commit message should say "Fix alignment
    of the user picture"
  4. Now that you've successfully, committed the change, you need to push it to your fork's online repository (the one associated with you GitHub account). To do this, simply type:

    git push

    You may need to log in via the command line before you can push the changes.
    The error responses that appear should walk you through how to log in (usually
    enter your email and username and password).

Making a Pull Request

Now that you've made your changes, you want to have it added to the original QueueUp repository.

  1. Go to the GitHub webpage for your fork. For example, I access mine at:

    https://github.com/vince/QueueUp

  2. Click the New Pull Request button.
  3. Give the Pull Request a name, write a detailed message (with pictures if possible) of what you changed, click submit!

Updating your Fork

After changes occur in the original repository owned by hounvs, you may need to "sync" your fork to the original repository.

  1. Open Git Bash in your fork's QueueUp folder. For example, I would right-click in the whitespace of the folder and click the Git Bash option in:

    C:\Users\Vince\Documents\GitHub\Queueup - Fork\

  2. To pull the changes from the original repository into your fork, type:

    git merge upstream/master

Handling a Merge Conflict

Merge conflicts occur when you pull changes from the upstream repository and it tries to overwrite a file that you have modified, added, or deleted. These steps will help resolve merge conflicts for a file.

After you get a merge conflict, do the following:

Squashing Commit Messages

Sometimes, you make lots of commit messages before pushing to the upstream repository. When you do this, each commit message also makes it into the Pull Request you make later. You can fix this by squashing commits. Basically, you just choose a specific commit message that you want included with the Pull Request that you make later.

Rather than explain this, I will just leave this informative link: How to Squash Commits

Reverting to the Previous Commit

Hopefully, you won't need this often, but here's the command to reset to the previous commit.

WARNING: THIS THROWS AWAY ANY UNCOMMITTED CHANGES!

git reset --hard HEAD

For more information on resetting your fork to a previous version, see this link: Reset Build to Certain Commit

Helpful Links

Firebase

Create firebase app

  1. Security and Rules -FIREBASE RULES

    {
    "rules": {
    "users": {
      "$uid": {
        // grants write access to the owner of this user account whose uid must exactly match the key ($uid)
        ".write": "auth !== null && auth.uid === $uid",
    
        // grants read access to any user who is logged in with an email and password
        ".read": "auth !== null && (auth.provider === 'password' || auth.provider === 'anonymous')"
      }
    }
    }
    }
  2. Login & Auth

    • Authorized Domains for OAuth Redirects
      • Add your github pages URL
        • Example: hounvs.github.io
      • Session Length
        • 24 Hours
    • Enable Anonymous User Authentication
  3. Set main firebase reference in userAuth.js, line 5

Credits to @andybond006 for this documentation