monkeytype/CONTRIBUTING.md
2021-03-11 12:08:12 -05:00

2.2 KiB

Contributing

Technologies

  • NodeJS v10
  • Firebase

Prerequisite - Firebase Setup

  1. Create a new Firebase project.

    • The project name doesn't really matter, but just name it monkeytype.
    • Google Analytics is not necessary.
  2. Install the Firebase CLI

  3. Run firebase login on your terminal to log in to the same google account as you just used to create the project.

  4. Git clone this project.

  5. Rename .firebaserc_example to .firebaserc and change the project name of default to the firebase project id you just created.

    • If .firebaserc_example does not exist after cloning, create your own with:
     {
         "projects": {
             "default": "your-firebase-project-id"
         }
     }
    
    • Run firebase projects:list to find your firebase project id.
  6. Generate a Firebase Admin private key

    • In your Firebase console, go to Project Settings > Service Accounts
    • Click "Generate New Private Key"
    • Save as serviceAccountKey.json in the functions/ directory
  7. Enable Firebase Authentication

    • In the Firebase console, go to Authentication
    • Click on Email/Password, enable it and save
    • Click on Google, add a support email and save
  8. Enable Firebase Firestore

    • In the Firebase console, go to Cloud Firestore
    • Create database
    • Start in test mode
    • Select default location and enable

Building and Running

  1. Run npm install in the project root directory to install dependencies.
  2. Run npm run start:dev to start a local dev server on port 5000. It will watch for changes and rebuild when you edit files in src/ or public/. Use ctrl+c to stop it.
    • Run firebase use <your-project-id> if you run into any errors for this.

Standards and Conventions

  1. Code style is enforced by Prettier, which is automatically run every time you git commit (if you've followed the above instructions properly).

Questions

If you run into any problems, let me know on GitHub or Discord in the #development channel.