Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
- Make sure to follow the [languages documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LANGUAGES.md)
- [ ] Add language to `packages/schemas/src/languages.ts`
- [ ] Add language to exactly one group in `frontend/src/ts/constants/languages.ts`
- [ ] Add language json file to `frontend/static/languages`
- [ ] Add language json file to `frontend/static/languages`
- [ ] Adding a theme?
- Make sure to follow the [themes documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/THEMES.md)
- [ ] Add theme to `packages/schemas/src/themes.ts`
- [ ] Add theme to `frontend/src/ts/constants/themes.ts`
- [ ] Add theme css file to `frontend/static/themes`
- [ ] Add some screenshots of the theme, especially with different test settings (colorful, flip colors) to your pull request
- [ ] Add some screenshots of the theme, especially with different test settings (colorful, flip colors) to your pull request
- [ ] Adding a layout?
- [ ] Make sure to follow the [layouts documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LAYOUTS.md)
- [ ] Add layout to `packages/schemas/src/layouts.ts`
- [ ] Add layout json file to `frontend/static/layouts`
- [ ] Add layout json file to `frontend/static/layouts`
- [ ] Adding a font?
- Make sure to follow the [themes documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/FONTS.md)
- [ ] Add font file to `frontend/static/webfonts`
- [ ] Add font file to `frontend/static/webfonts`
- [ ] Add font to `packages/schemas/src/fonts.ts`
- [ ] Add font to `frontend/src/ts/constants/fonts.ts`
- [ ] Check if any open issues are related to this PR; if so, be sure to tag them below.
Expand Down
4 changes: 2 additions & 2 deletions docker/BUILD.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Build locally

From root directoy:
From root directoy:

```
docker buildx build --progress=plain --no-cache -t monkeytype/monkeytype-backend:latest . -f ./docker/backend/Dockerfile
docker buildx build --progress=plain --no-cache -t monkeytype/monkeytype-frontend:latest . -f ./docker/frontend/Dockerfile
```
```
23 changes: 11 additions & 12 deletions docs/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Contributor Covenant Code of Conduct

## Our Pledge
Expand All @@ -18,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community includes:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
- Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of
- The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct that could reasonably be considered inappropriate in a
- Other conduct that could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand All @@ -60,7 +59,7 @@ representative at an online or offline event.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
reported to the community leaders responsible for enforcement at
jack@monkeytype.com.
All complaints will be reviewed and investigated promptly and fairly.

Expand Down
6 changes: 2 additions & 4 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ Below is a set of general guidelines for different types of changes.

### Pull Request Naming Guidelines

We use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) for our pull request titles (and commit messages on the master branch) and also include the author name at the end inside parenthesis. Please follow the guidelines below when naming pull requests.

We use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) for our pull request titles (and commit messages on the master branch) and also include the author name at the end inside parenthesis. Please follow the guidelines below when naming pull requests.

For types, we use the following:

Expand Down Expand Up @@ -62,7 +61,7 @@ Before submitting a theme make sure...
- your theme has been added to the `_list` file and the `textColor` property is the theme's main color
- your theme is clear and readable with both `flip test colors` and `colorful mode` enabled and disabled

If you want to contribute themes but don't know how, check [THEMES.md](/docs/THEMES.md)
If you want to contribute themes but don't know how, check [THEMES.md](/docs/THEMES.md)

### Language Guidelines

Expand All @@ -84,7 +83,6 @@ If you want to contribute languages but don't know how, check [LANGUAGES.md](/do
- For quotes not in English, please include translations of quotes in the description of your pull request. This assists in the verification process to ensure the integrity of the quotes.
- Remember to name your pull request properly. For example, if you are adding new quotes for the language `French`, your pull request should be named `impr(quotes): add French quotes`.


If you want to contribute quotes but don't know how, check [QUOTES.md](/docs/QUOTES.md)

### Layout Guidelines
Expand Down
23 changes: 9 additions & 14 deletions docs/CONTRIBUTING_ADVANCED.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ This contribution guide is for cases in which you need to test the functionality

### Git


> [!WARNING]
> **If you are on Windows, run `git config --global core.autocrlf false` before cloning this repo to prevent CRLF errors.**
> **If you are on Windows, run `git config --global core.autocrlf false` before cloning this repo to prevent CRLF errors.**

Git is optional but we recommend you utilize it. Monkeytype uses the Git source control management (SCM) system for its version control. Assuming you don't have experience typing commands in the command line, we suggest installing [Sourcetree](https://www.sourcetreeapp.com/). You will be able to utilize the power of Git without needing to remember any cryptic commands. Using a Git client such as Sourcetree won't give you access to the full functionality of Git, but provides an easy-to-understand graphical user interface (GUI). Once you have downloaded Sourcetree, run the installer. While installing Sourcetree, keep your eyes peeled for the option to also install Git with Sourcetree. This is the option you will need to look for in order to install Git. **Make sure to click yes in the installer to install Git with Sourcetree.**

Expand All @@ -51,26 +50,22 @@ The account system will not let you create an account without a Firebase project

1. Create a Firebase account if you already haven't done so.
1. [Create a new Firebase project.](https://console.firebase.google.com/u/0/)

- The project name doesn't matter, but the name `monkeytype` would be preferred.
- Google Analytics is not necessary.

1. Enable Firebase Authentication

- In the Firebase console, go to `Build > Authentication > Sign-in method`
- Click on `Email/Password`, enable it, and save
- Click on `Google`, add a support email, and save

1. Generate a Firebase Admin private key (optional, only needed if you want to work on the backend)

- In your Firebase console, go to Project Settings > Service Accounts
- Click "Generate New Private Key"
- Save as `serviceAccountKey.json` inside the `backend/src/credentials/` directory.

1. Run `pnpm add -g firebase-tools` to install the Firebase Command Line Interface.
1. Run `firebase login` on your terminal to log in to the same Google account you just used to create the project.
1. Within the `frontend` directory, duplicate `.firebaserc_example`, rename the new file to `.firebaserc` and change the project name to the firebase project id you just created.

- Run `firebase projects:list` to find your firebase project ID.
- If `.firebaserc_example` does not exist after cloning, create your own with:

Expand Down Expand Up @@ -109,8 +104,8 @@ Follow these steps if you want to work on anything involving the database/accoun

2. Setup the database server

| Manual | Docker (recommended) |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Manual | Docker (recommended) |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <ol><li>Install [MongoDB Community Edition](https://docs.mongodb.com/manual/administration/install-community/)</li><li>Install [Redis](https://redis.io/docs/latest/operate/oss_and_stack/install/install-stack/)</li><li>Make sure both are running</li></ol> | <ol><li>Install [Docker](http://www.docker.io/gettingstarted/#h_installation) on your machine</li><li>Run `npm run docker-db-only` from the `./backend` directory</li></ol> |

3. (Optional) Install [MongoDB-compass](https://www.mongodb.com/try/download/compass?tck=docs_compass). This tool can be used to see and manipulate your database visually.
Expand All @@ -134,15 +129,15 @@ npm run dev

### Backend only

| Manual | Docker |
| --------------------------- | ------------------------------ |
| `npm run dev-be` | `cd backend && npm run docker` |
| Manual | Docker |
| ---------------- | ------------------------------ |
| `npm run dev-be` | `cd backend && npm run docker` |

### Frontend only

| Manual | Docker |
| ---------------------------- | ------------------------------- |
| `npm run dev-fe` | `cd frontend && npm run docker` |
| Manual | Docker |
| ---------------- | ------------------------------- |
| `npm run dev-fe` | `cd frontend && npm run docker` |

These commands will start a local development website on [port 3000](http://localhost:3000) and a local development server on [port 5005](http://localhost:5005). They will automatically rebuild the website/server when you make changes in the `src/` directory. Use <kbd>Ctrl+C</kbd> to stop them.

Expand Down
5 changes: 2 additions & 3 deletions docs/FONTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ First, you will have to make a personal copy of the Monkeytype repository, also

## Adding Fonts

Once you have forked the repository you can now add your font. Place the font file in `./frontend/static/webfonts` e.g. `My-Font.woff2`.
Once you have forked the repository you can now add your font. Place the font file in `./frontend/static/webfonts` e.g. `My-Font.woff2`.

> [!NOTE]
> Your font needs to be in the `.woff2` format. Your filename cannot include spaces or start with a number.
Expand All @@ -29,7 +29,7 @@ const KnownFontNameSchema = z.enum(
"My_Font",
```

Call it whatever you want but make sure you replace spaces with underscores and the font does not start with a number.
Call it whatever you want but make sure you replace spaces with underscores and the font does not start with a number.

Then, go to `./frontend/src/ts/constants/fonts.ts` and add the following code to the _end_ of the `Fonts` object near to the very end of the file:

Expand All @@ -54,4 +54,3 @@ Create a pull request:
## Language Guidelines

Make sure your language follows the [Language guidelines](./CONTRIBUTING.md#language-guidelines).

10 changes: 4 additions & 6 deletions docs/LANGUAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,20 @@ The contents of the file should be as follows:
```

It is recommended that you familiarize yourselves with JSON before adding a language. For the `name` field, put the name of your language. `rightToLeft` indicates how the language is written. If it is written right to left then put `true`, otherwise put `false`.
`ligatures` A ligature occurs when multiple letters are joined together to form a character [more details](<https://en.wikipedia.org/wiki/Ligature_(writing)>). If there's joining in the words, which is the case in languages like (Arabic, Malayalam, Persian, Sanskrit, Central_Kurdish... etc.), then set the value to `true`, otherwise set it to `false`. For `bcp47` put your languages [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag). If the words you're adding are ordered by frequency (most common words at the top, least at the bottom) set the value of `orderedByFrequency` to `true`, otherwise `false`. Finally, add your list of words to the `words` field.
`ligatures` A ligature occurs when multiple letters are joined together to form a character [more details](<https://en.wikipedia.org/wiki/Ligature_(writing)>). If there's joining in the words, which is the case in languages like (Arabic, Malayalam, Persian, Sanskrit, Central_Kurdish... etc.), then set the value to `true`, otherwise set it to `false`. For `bcp47` put your languages [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag). If the words you're adding are ordered by frequency (most common words at the top, least at the bottom) set the value of `orderedByFrequency` to `true`, otherwise `false`. Finally, add your list of words to the `words` field.

Then, go to `packages/schemas/src/languages.ts` and add your new language name at the _end_ of the `LanguageSchema` enum. Make sure to end the line with a comma. Make sure to add all your language names if you have created multiple word lists of differing lengths in the same language.
Then, go to `packages/schemas/src/languages.ts` and add your new language name at the _end_ of the `LanguageSchema` enum. Make sure to end the line with a comma. Make sure to add all your language names if you have created multiple word lists of differing lengths in the same language.

```typescript
export const LanguageSchema = z.enum([
"english",
"english_1k",
...
"your_language_name",
..."your_language_name",
"your_language_name_10k",
]);
```

Then, go to `frontend/src/ts/constants/language.ts` and add your new language name to the `LanguageGroups` map. You can either add it to an existing group or add a new one. Make sure to add all your language names if you have created multiple word lists of differing lengths in the same language.
Then, go to `frontend/src/ts/constants/language.ts` and add your new language name to the `LanguageGroups` map. You can either add it to an existing group or add a new one. Make sure to add all your language names if you have created multiple word lists of differing lengths in the same language.

```typescript
export const LanguageGroups: Record<string, Language[]> = {
Expand All @@ -68,4 +67,3 @@ Create a pull request:
## Language Guidelines

Make sure your language follows the [Language guidelines](./CONTRIBUTING.md#language-guidelines).

31 changes: 13 additions & 18 deletions docs/LAYOUTS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### **Table of Contents**

- [Forking Monkeytype](#forking-monkeytype)
- [Creating Layouts](#creating-layouts )
- [Creating Layouts](#creating-layouts)
- [Committing Layouts](#committing-layouts)

### Forking Monkeytype
Expand Down Expand Up @@ -79,36 +79,31 @@ The contents of the file should be as follows:
"row5": [[" "]]
}
}


```

It is recommended that you familiarize yourselves with JSON before adding a layout.

`keymapShowTopRow` indicates whether to always show the first row of the layout.
`type` can be `ansi` or `iso`.
`type` can be `ansi` or `iso`.

In `keys` you need to specify `row1` to `row5`. Add the keys within the row as string-array. The string-array can have up to four character. The character define unshifted, shifted, alt-gr and shifted alt-gr character in this order. For example `["e","E","€"]` defines `e` on regular key press, `E` if `shift` is held and `€` if `alt-gr` is held.
In `keys` you need to specify `row1` to `row5`. Add the keys within the row as string-array. The string-array can have up to four character. The character define unshifted, shifted, alt-gr and shifted alt-gr character in this order. For example `["e","E","€"]` defines `e` on regular key press, `E` if `shift` is held and `€` if `alt-gr` is held.

**Note:** Quote and backslash characters need to be escaped: `\"` and `\\`.
**Note:** Quote and backslash characters need to be escaped: `\"` and `\\`.

For ansi layouts the number of keys need to be exactly thirteen for `row1` and `row2`, eleven for `row3`, ten for `row4` and one or two for `row5`.

For iso the number of keys need to be exactly thirteen for `row1`, twelve for `row2` and `row3`, eleven for `row4` and one or two for `row5`.

For iso the number of keys need to be exactly thirteen for `row1`, twelve for `row2` and `row3`, eleven for `row4` and one or two for `row5`.


In addition to the layout file you need to add your layout to the `packages/schemas/src/layouts.ts` file. Just append your layout name (without the `.json`) at the __end__ of the `LayoutNameSchema`. Remember to add a comma like this:
In addition to the layout file you need to add your layout to the `packages/schemas/src/layouts.ts` file. Just append your layout name (without the `.json`) at the **end** of the `LayoutNameSchema`. Remember to add a comma like this:

```ts
export const LayoutNameSchema = z.enum([
"qwerty",
"dvorak",
"colemak",
...
"your_layout_name",
export const LayoutNameSchema = z.enum([
"qwerty",
"dvorak",
"colemak",
..."your_layout_name",
]);
```
```

### Committing Layouts

Expand All @@ -124,4 +119,4 @@ Make sure your PR title follow the syntax `feat(layout): add <YOUR_LAYOUT> layou

## Layout Guidelines

Make sure your layout follows the [Layout guidelines](./CONTRIBUTING.md#layout-guidelines).
Make sure your layout follows the [Layout guidelines](./CONTRIBUTING.md#layout-guidelines).
1 change: 0 additions & 1 deletion docs/QUOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ Create a pull request:
## Quote Guidelines

Make sure your quote(s) follows the [Quote guidelines](./CONTRIBUTING.md#quote-guidelines).

Loading
Loading