mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-12-29 03:20:46 +08:00
2.9 KiB
2.9 KiB
Contributing
Technologies
- NodeJS < 14
- Firebase
Prerequisite - Firebase Setup
-
Create a new Firebase project.
- The project name doesn't really matter, but just name it
monkeytype. - Google Analytics is not necessary.
- The project name doesn't really matter, but just name it
-
Run
firebase loginon your terminal to log in to the same google account as you just used to create the project. -
Git clone this project.
-
Duplicate
.firebaserc_example, rename the new file to.firebasercand change the project name of default to the firebase project id you just created.- If
.firebaserc_exampledoes not exist after cloning, create your own with:
{ "projects": { "default": "your-firebase-project-id" } }- Run
firebase projects:listto find your firebase project id.
- If
-
Generate a Firebase Admin private key
- In your Firebase console, go to Project Settings > Service Accounts
- Click "Generate New Private Key"
- Save as
serviceAccountKey.jsonin thefunctions/directory
-
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
Prerequisite - Mongo Setup
-
Install Mongodb Community Edition and ensure that it is running
-
Optional - Install Mongodb-compass. This tool can be used to see and manipulate your data visually.
- To connect, type
mongodb://localhost:27017in the connection string box and press connect. The monkeytype database will be created and shown` after the server is started.
- To connect, type
Building and Running
- Run
npm installin the project root directory to install dependencies. - Run
npm run start:devto start a local dev server on port 5000. It will watch for changes and rebuild when you edit files insrc/orpublic/directories. Use control c to abort it.- Run
firebase use {your-project-id}if you run into any errors for this.
- Run
Standards and Conventions
- Code style is enforced by Prettier, which is automatically ran every time you
git commit(if you've followed the above instructions properly). - If you are unsure of the best practices and conventions of Javascript, please take a look at the JavaScript Best Practices and JavaScript Coding Conventions
Questions
If you run into any problems, let me know on GitHub or Discord in the #development channel.