Commit graph

1109 commits

Author SHA1 Message Date
Paul Ebose
a0416d3eba
impr(dev): allow docker compose to start the backend server (plbstl, Miodec) (#4995)
* chore: allow backend docker compose to start the api-server alongside redis & mongodb

* chore: update node versions in docker compose

* chore: add an extra compose file in backend

* docs: update advanced contribution guide with docker compose changes

* add docker script
support server_open env variable

* move files

* npm scripts
rename file

* add docker ignore

* fix redis not working

* rename file

* mounting root instead

* update docs

* update docs table of contents

* restart on fail

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2024-02-28 14:17:09 +01:00
Miodec
a6cc2b5eff chore: throw if recaptcha secret is undefined 2024-02-27 00:43:17 +01:00
Miodec
c51e2a47e4 chore: missing field in example env 2024-02-27 00:42:06 +01:00
Sachin Kumar
1429c2ca8c
impr: save pbs for numbers mode separately (notreallystatic, miodec) (#4946) 2024-02-22 15:07:42 +01:00
Jack
01790d8a3a
refactor: shared user types (#5080)
* move user to shared definitions

this includes whatever user can have on it, tags, presets and so on

* profiles, mail and others

* fix logic

* yeet

* same as master for now

* tsc fixes

* remove comment

* fix tests

* chore: omit ips

* fix(language): remove some unnecessarily capitalised words in german 1k

* fix(typing): first space sometimes soft locking the website

* perf: speed up settings page loading

* fix: use selected typing speed unit on personal best popup (fehmer) (#5070)

* fix: Use selected typing speed unit on personal best popup

* refactor

* refactor

* test coverage

* use Format in more places

* Make config mockable

* dependency injection

* wip

* fix

* test

* touch

* fix(language): typos in russian_10k.json (kae) (#5082)

* Update russian_10k.json

- fixed typos
- removed duplicates

* - fixed extra typos

* remove duplicates

* fix(language): typos in russian_10k.json

* feat: add copy missed words to result screen (fehmer) (#5086)

* feat: Add copy missed words to result screen

* remove margin

* update icons

---------

Co-authored-by: Miodec <jack@monkeytype.com>

* impr(funbox): add 46 group languages to wikipedia funbox (RealCyGuy) (#5078)

* impr: provide all-time LB results during LB update (fehmer) (#5074)

Try to provide LB results during the LB update. There is a very small time-frame where
already running queries might fail during the update. For now we keep the 503 error in this
cases and monitor how often this happens on production.

* impr(funbox): add ` (grave accent, 96) and ~ (tilde, 126) to specials (#5073)

* impr: add testWords and wordsHistory to copy result stats (#5085)

* feat: add testWords and wordsHistory to copy result stats

* fix

* add fe ts dep

---------

Co-authored-by: Christian Fehmer <fehmer@users.noreply.github.com>
Co-authored-by: Andrey Kuznetsov <akuznetsov@outlook.com>
Co-authored-by: Cyrus Yip <cyruscmyip1@gmail.com>
Co-authored-by: fitzsim <fitzsim@fitzsim.org>
2024-02-19 17:15:15 +01:00
Christian Fehmer
bf2c4cc5bb
impr: provide all-time LB results during LB update (fehmer) (#5074)
Try to provide LB results during the LB update. There is a very small time-frame where
already running queries might fail during the update. For now we keep the 503 error in this
cases and monitor how often this happens on production.
2024-02-19 14:59:30 +01:00
Miodec
d6ab4bfb2c chore: omit ips 2024-02-19 00:43:35 +01:00
Miodec
6cb8f52cf2 chore: fix build error 2024-02-18 01:52:03 +01:00
Miodec
b7594ab684 chore: move withobjectid to backend types 2024-02-17 18:42:51 +01:00
Christian Fehmer
6cf2e4f5f5
chore: update node version to 18.19.1 (#5060) 2024-02-15 21:23:29 +01:00
Christian Fehmer
a72aa04c53
fix: leaderboard consistency being null (#5055) 2024-02-14 23:28:51 +01:00
Miodec
69683494e3 chore: upgrade jest-environment-node to fix tests not running 2024-02-14 14:43:35 +01:00
Miodec
41c625e266 chore: upgrade mongodb driver 2024-02-14 12:51:09 +01:00
Jack
8bf3edaeb2
fix: backend/package.json & backend/package-lock.json to reduce vulnerabilities (#5051)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-INFLIGHT-6095116
- https://snyk.io/vuln/SNYK-JS-NODEMAILER-6219989
- https://snyk.io/vuln/SNYK-JS-REQUEST-3361831
- https://snyk.io/vuln/SNYK-JS-TOUGHCOOKIE-5672873

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2024-02-14 12:13:39 +01:00
Miodec
ee3f9d43a8 chore: ignoring line
for some reason when i use ts-expect-error its saying unnecessary,
but when i remove it i get an error
2024-02-12 16:52:57 +01:00
Jack
084d42c62e
refactor: enable @typescript-eslint/strict (#5028)
* enable rule

* eslint --fix

* fixes

* --fix

* fixes

* fixes

* fixes

* extract into const
2024-02-12 16:46:56 +01:00
Christian Fehmer
5c725f7ee3
fix: leaderboard discord properties being null (fehmer) (#5032) 2024-02-12 13:04:05 +01:00
Miodec
e31613533c refactor(types): result types
move to shared types (#4774)
add types to ape client (#4786)
2024-02-08 17:57:45 +01:00
Miodec
15c697802d refactor(types): leaderboard types
move to shared types (#4774)
add types to ape client (#4786)
2024-02-08 17:44:46 +01:00
Miodec
2dfd7c2a04 chore: checking if key data is longer than 0 2024-02-08 15:34:03 +01:00
Miodec
4ea7cea0ce chore: add a quick way to emulate api delay on localhost 2024-02-08 15:14:55 +01:00
Jack
cdfc7833e3
refactor(types): shared config and preset types (#5024)
* build: include all shared types files instead of just one

* move config property value types to a shared file

* backend build issues

* shared preset and config types
preset and config ape types

* typo

* ignoring unused warnings

* fixed merge
2024-02-08 14:32:04 +01:00
Miodec
e7f021a37c build: fix backend build fail 2024-02-08 14:02:14 +01:00
Miodec
aa011b6b99 build: include all shared types files instead of just one 2024-02-08 13:49:11 +01:00
Absalon43
78bb715885
feat(sounds): add fist fight and rubber keys (Absalon43) (#4984)
* Add files via upload

* feat: add support for fist fight and plastic toy sounds

* feat: add support for fist fight and plastic toy sounds

* chore: remove extra semicolon

* feat: less busy punch sound

* feat: add punch misses as error sound

* fix: update punch sounds and make them less aggresive

* fix: Change name of plastic toy to rubber keys

---------

Co-authored-by: arthur-d42 <64164367+arthur-d42@users.noreply.github.com>
Co-authored-by: arthur-d42 <arthurdiness@gmail.com>
2024-02-08 12:01:18 +01:00
Miodec
4f5f28a92d refactor(types): ape keys types
move to shared types (#4774)
add types to ape client (#4786)
2024-02-07 23:13:10 +01:00
Miodec
efb972a659 refactor(types): public types
move to shared types (#4774)
add types to ape client (#4786)
2024-02-07 22:29:16 +01:00
Miodec
65120db1f0 refactor(types): PSA types
move to shared types (#4774)
add types to ape client (#4786)
2024-02-07 19:06:06 +01:00
Jack
f456e1e615
refactor: enable no-floating-promises rule (#5007)
* enable rule

* backend

* fixes

* more fixes

* mooore fixes

* fixes

* fixed double void

* change some voids to await

* await -> void

* remvoe void

* missing return

* awaiting config update
2024-02-07 18:49:12 +01:00
Christian Fehmer
848e851973
test: fix typescript setup in tests (#5014) 2024-02-07 16:32:48 +01:00
Miodec
020eb7b44e fix: fixing a fix where a previuos fix didnt fix the issue
completed event doesnt have isPb property, so the delete didnt work
2024-02-07 09:51:31 +01:00
Miodec
a11314f11c impr(server): not saving 503 errors to the database 2024-02-07 09:50:43 +01:00
Miodec
aa78b46bbf fix: incorrect test data 2024-02-07 09:35:45 +01:00
Miodec
ead765d57a fix(server): only saving isPb property in the database if the result was a pb
this was the previous behaviour but #4980 broke it
2024-02-07 09:28:54 +01:00
Miodec
f8109e0d98 chore: fix eslint error 2024-02-06 14:19:50 +01:00
Jack
83a4c0e6aa
refactor: enable strict-boolean-expressions rule (#4992) 2024-02-06 14:01:45 +01:00
Miodec
5cea19e299 chore: add todos 2024-02-05 12:37:30 +01:00
Jack
8b48347764
refactor: result types (#4980)
* further shared improvements
 - moved more types to shared
 - reworked the way results are typed

THIS COULD CHANGE LOGIC, TEST THIS

* removed comment

* update the way completed event is built on the client

* remove unnecessary property

* comment

* move hash check higher

* remove todo

* fix incorrect type

* updated type
remove field if undefined
2024-02-01 11:54:25 +01:00
Miodec
b8cc17a12b chore: upgrade typescript version 2024-01-31 12:36:13 +01:00
Jack
0751375ab6
refactor: shared types (miodec) (#4978)
* rework shared types

* revert one small change
2024-01-29 15:53:42 +01:00
Jack
ee629db5b5
build: enable noUncheckedIndexedAccess compiler rule (Miodec) (#4958)
* added rule to backend and fixed all the errors

* setup frontend and start fixing some warnings

* more fixes

* fixes

* fixes

* fixes

* more refactoring

* fixes

* pain

* more pain

* ouch

* mooore

* 10 hours later

* ugghhh

* another one

* last element can be undefined duh

* smol one

* absolute typescript gigachad

* moooore fixes

* chart stuff

* almost done

* its... done

* remove console log

* use for of instead
2024-01-29 13:27:36 +01:00
Miodec
f099ccfe3b fix: email enumeration vulnerability 2024-01-24 13:09:45 +01:00
Miodec
6ef1d165fd chore: fix tests being broken because of the new lint rules 2024-01-22 15:07:00 +01:00
Miodec
33d0812019 build(backend): enable more ts flags 2024-01-18 23:33:50 +01:00
Miodec
abbe77b01b build(backend): enable noPropertyAccessFromIndexSignature flag 2024-01-18 23:24:33 +01:00
Miodec
e1dcd29419 build: add ts compiler flag 2024-01-18 23:20:44 +01:00
Miodec
a41e241297 fix: removed non profane word 2023-12-18 12:13:30 +01:00
Christian Fehmer
b3ae78f413
perf: improve leaderboard aggregation (fehmer) (#4841)
* perf: improve leaderboard aggregation

Update the leaderboard and public speedStats directly in mongodb without importing the data in the nodejs process first

* Replace type on public collection with magic ids
2023-12-06 16:03:44 +00:00
Christian Fehmer
9e991f3641
test(leaderboard): add test coverage for leaderboard update (#4840) 2023-12-05 14:40:34 +00:00
Wisam Abbadi
962fbc8ae1
impr: remove non-profane word (#4828) 2023-12-05 13:43:31 +00:00