Commit graph

77 commits

Author SHA1 Message Date
Christian Fehmer 1c9dbccfa3
chore: update vitest to 2.0.5 (@fehmer) (#5770) 2024-08-12 20:18:22 +02:00
Christian Fehmer c6e8f413fc
impr: use tsrest for leaderboard endpoints (@fehmer) (#5717)
!nuf
2024-08-12 14:08:17 +02:00
Miodec 4995f042ac chore: fix eslint in dev script 2024-08-09 22:03:01 +02:00
Christian Fehmer f6ec006507
impr: use tsrest for psa endpoints (@fehmer) (#5712)
!nuf
2024-08-08 15:10:26 +02:00
dependabot[bot] dfdf3fc6cd
chore(deps-dev): bump typescript from 5.3.3 to 5.5.4 (@dependabot) (#5734) 2024-08-08 12:44:22 +02:00
dependabot[bot] c413cbd364
chore(deps): bump nodemon from 3.0.1 to 3.1.4 (@dependabot) (#5733)
Bumps [nodemon](https://github.com/remy/nodemon) from 3.0.1 to 3.1.4.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v3.0.1...v3.1.4)

---
updated-dependencies:
- dependency-name: nodemon
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jack <jack@monkeytype.com>
2024-08-06 12:28:03 +02:00
dependabot[bot] 35379383a0
chore(deps): bump uuid and @types/uuid (@dependabot) (#5735)
Bumps [uuid](https://github.com/uuidjs/uuid) and [@types/uuid](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/uuid). These dependencies needed to be updated together.

Updates `uuid` from 9.0.1 to 10.0.0
- [Changelog](https://github.com/uuidjs/uuid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/uuidjs/uuid/compare/v9.0.1...v10.0.0)

Updates `@types/uuid` from 8.3.4 to 10.0.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/uuid)

---
updated-dependencies:
- dependency-name: uuid
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: "@types/uuid"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-06 12:24:15 +02:00
Nad Alaba 8bc47960ef
build(backend): activate inspector to allow attaching debugger (@NadAlaba) (#5704) 2024-08-01 12:47:07 +02:00
Jack 2720c07664
chore: switch from npm to pnpm (#5690)
* pnpm

* v4, pnpm lock

* checkout, node setup

* cache dir

* path, name

* store path

* name

* setup pnpm, get store then check cache

* unnecessary if

* missing dependencies

* fix docker

* lock file name

* remove prop

* wip

* fix

* reduce image sizes

* save exact

* correct command

* lock

---------

Co-authored-by: Christian Fehmer <cfe@sexy-developer.com>
2024-07-30 22:36:19 +02:00
Miodec 47438fa8d1 chore(lint): enable no unsafe return 2024-07-30 22:10:30 +02:00
Jack 1110248f7b
chore: upgrade node to 20.16.0 (#5688)
* nooOoOoOOoOoode

* ci

* nvm

* env is back baby, cache

* cache name, restore keys

* remove restore keys

* package lock

* conditional node setup

* unnecessary assertion

* update rule

* lock
2024-07-30 18:44:35 +02:00
dependabot[bot] ccc483226d
chore(deps-dev): bump @types/bcrypt from 5.0.0 to 5.0.2 (#5677)
Bumps [@types/bcrypt](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/bcrypt) from 5.0.0 to 5.0.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/bcrypt)

---
updated-dependencies:
- dependency-name: "@types/bcrypt"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-30 12:33:10 +02:00
Miodec 471e844c6b chore: remove hard npm version requirement 2024-07-29 11:49:28 +02:00
Christian Fehmer 7f9f704dcd
impr: use tsrest/zod for config endpoints (@fehmer) (#5649)
!nuf
2024-07-29 11:31:14 +02:00
Miodec 642a2b22a1 chore: update backend out dir 2024-07-25 19:59:05 +02:00
dependabot[bot] d717ae0058
chore(deps): bump express from 4.17.3 to 4.19.2 in /backend (#5650)
* chore(deps): bump express from 4.17.3 to 4.19.2 in /backend

Bumps [express](https://github.com/expressjs/express) from 4.17.3 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.17.3...4.19.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* lock update

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Miodec <jack@monkeytype.com>
2024-07-25 11:16:48 +02:00
Miodec 8de977a45f chore: bump ua-parser 2024-07-22 16:56:50 +02:00
Jack 3e88ac2f12
refactor: restructure project to a true monorepo (#5626)
* split ts files

* packages

* nomore workspace?

* blah

* build, exports

* declaration

* blargh

* turrrrbo

* fix fontawesome paths

* allow file in eslint, fix ts errors

* optimise package, update tsconfig

* fix ts

* update turbo config

* eslint split

* fix imports

* fix types

* lock

* add turbo task

* script

* test task

* pretty scripts

* update prettier ignore

* no cache for tests

* lint task

* turbo

* no out

* depend on env

* fix mono breaking things

* odl

* fix version dependency of mongodb-memory-server

* Revert "fix version dependency of mongodb-memory-server"

This reverts commit 52ffac47b1.

* update vitest-mongodb

* release scripts

* update ci

* update dev script

* ignore issues around firebase config

* add check ts tasks

* import isaxioserror

* shared types package

* replace tsnodedev with tsx

* fix import

* shared types

* module

* backend imports

* declaration

* node version

* test code

* assert json

* verbatim

* type

* lodash

* ts ver

* fix fix fix?

* remove assert

* remove module and resolution

* cleanup

* tsconfig

* fix frontend

* remove unecessary props

* more unused

* remove skiplib

* declaration map, dev script

* remove install scripts

* fix regex

* move shared types to package

* dont include shared types

* remove path

* update scripts

* test code

* test code

* fix backend types

* fully fix backend

* fix frontend d.ts

* add .js to imports

* remove module

* revert add .js

* update tsconfig

* use bundler module resolution

* almost all frontend types

* mooore

* date fns

* fix backend docker

* fix ape keys

* fix type

* clean rimraf type

* fix shared-types in workspace

* fix import resolving

* fix docker builds

* ignore type problems on slim-select until new version is released

* turrrrbo

* fix npm ci

* fix lint task

* expose env variables needed by frontend build

* fix dependencies

* package-lock

* backend watch ts and lint

* add fe and be build scripts to root

* fix dev not building packages

* shared-types missing eslint

* move shared types back to dev-deps

* add packages to labeler

* add packages step to ci

* typo

* filter update

* remove concurrently from root

* add scripts

* abbreviate

* rename

* yeet

* fixed path

* test pkg

* consistent ordering

* rename

* Revert "backend imports"

This reverts commit d715198829.

* fix missing imports, remove last .js

* remove test package

---------

Co-authored-by: Christian Fehmer <cfe@sexy-developer.com>
2024-07-22 15:08:11 +02:00
Jack 8f4d291fcf
Revert "impr: use tsrest/zod for type-safety on both ends (@fehmer) (#5479)" (#5619)
This reverts commit 4c9e949f10.
2024-07-16 17:29:09 +02:00
Christian Fehmer 4c9e949f10
impr: use tsrest/zod for type-safety on both ends (@fehmer) (#5479)
!nuf
2024-07-16 15:24:06 +02:00
Christian Fehmer 4589bbf679
feat: maintain hashed blocklist of banned usernames, emails and discordids (fehmer) (#5371)
* feat: maintain blocklist of banned usernames and email (fehmer)

* update privacy policy

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2024-05-20 12:21:14 +02:00
Christian Fehmer 59615fb02c
feat(account page): add test activity graph (fehmer, Singh233) (#5309)
* wip

* wip frontend

* cleanup

* wip

* refactoring

* wip

* first working version

* wip

* update calendar with new result

* add migration script

* dates are hard

* fix naming inconsistencies

* requested changes on migration

* timezones

* update date-fns, use date-fns/utc

* resolve cyclic dependency by extracting test activity calender into new file

* cleanup

* fix increment

* fix

* tests

* test coverage

* test migration

* migration more logging

* migration add unique index on uid if missing

* update legend styling

* 53 columns

* wip

* move dropdown and legend to the top
add dropdown border
yeet hotpink
invisible filler boxes
remove year from month format

* responsive update

* lowercase months

* handle current year, fix tests

* handle year change

* make days square again

* handle newly created users correctly

* move css

* add wrapper for easier styling
rework some font sizes/widths
reorder styles

* media queries

* align

* rework styling once more

* dont commit debug

* add days full to fill the space a bit

* show partial months

* hover on 0 tests

* start dynamic calendar on sunday

* no activity

* hover

* remove label on fillers

* remove label on fillers

* fix months, update tests for months

* adjust tests to new requirements

* cleanup

* fix migration

* impr(commandline): add "add/remove quote to favorites" commands

closes #5368

* chore: remove daily lb which is no longer in the backend

* fix: dropdown element flashing for couple frames on page load

* feat(language): add japanese romaji 1k (nthngnssmnnglss)

* fix: optional chaining

!nuf

* fix(words generator): infinite custom text tests not working correctly

* chore: missing languages in list and group files

* fix(language): remove duplicates

!nuf

* add readline sync to confirm

* gh action complaints

* unnecessary check

* premium only

* add years to drop down only if premium

* Update setup-tests.ts

* test fix

* cleanup

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2024-05-15 15:23:36 +02:00
Christian Fehmer 059c9e271b
test: update to vitest 1.6.0, use v8 coverage provider (#5389) 2024-05-13 13:25:21 +02:00
Christian Fehmer 0dab2ecd7e
impr: build docker images for linux/arm64 on release (#5369)
!nuf
2024-05-13 11:53:46 +02:00
Christian Fehmer 9bdbf5c595
test: replace jest with vitest on backend (fehmer) (#5314)
* test: replace jest with vitest on backend

* fix
2024-04-17 13:39:10 +02:00
Nad Alaba bdc19de2ec
build(backend): fix dev script flags not being processed (NadAlaba) (#5296) 2024-04-09 11:58:28 +02:00
Christian Fehmer b4af0917b2
chore: improve docker files for local development (#5157) 2024-03-04 16:10:22 +01:00
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
Christian Fehmer 6cf2e4f5f5
chore: update node version to 18.19.1 (#5060) 2024-02-15 21:23:29 +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 b8cc17a12b chore: upgrade typescript version 2024-01-31 12:36:13 +01:00
Christian Fehmer 4b3059bdc7
refactor: Import shared types back into MonkeyTypes namespace (fehmer) (#4800)
* impr: Import shared types back into MonkeyTypes namespace, partially reverts #4769

* down to 6 errors

* fixes

* cleanup
2023-11-20 14:56:28 +00:00
Miodec 205b0f8f90 chore: bump nodemon 2023-10-17 12:56:11 +01:00
Miodec 289c81e9fa chore: bump firebase-admin version 2023-10-17 12:53:41 +01:00
Bruce Berrios a79a6be8b5
chore: update tsconfig and docker compose (#4530)
* config changes

* add types

* ebadengine
2023-08-12 16:41:36 +02:00
Bruce Berrios bb65a6bb9b chore: upgrade types to node 18 (#4529) 2023-08-12 14:59:11 +02:00
Miodec 17cfb2ad7b build: resolve ts-node-dev compile errors 2023-08-11 16:28:20 +02:00
Miodec db2386300c build: add typescript as backend dev dependency
also updated frontend typescript verison to match
2023-08-11 13:35:35 +02:00
Miodec 0b69b2e1e3 added knip to find unused exports 2023-08-10 18:32:33 +02:00
Miodec 38a316715b moved to node 18.17.1 lts 2023-08-10 17:38:27 +02:00
Miodec c12852eef2 updated bullmq 2023-04-20 13:27:41 +02:00
Miodec 5fbc14c73c cron version bump 2023-04-20 13:13:08 +02:00
Miodec 2d8a4a7651 update firebase admin 2023-04-20 13:08:53 +02:00
Jack 1ca0fd1b23
Custom email (#3964)
* added nodemailer and mjml

* added email template

* basic email util file

* added email queue

* email worker

* renamed folder

* showing which queues and workers were initialized

* initializing email on server boot
added some test code

* renamed to email worker

* type fix

* renamed queue

* added queue to list

* added worker to list

* logging when config was verified

* handling send mail result

* not minifying (not supported anymore)
using .html property
returning correct value

* dont send me emails

* added port to .env

* updated example

* updated test email

* using env email

* parseint base

* message

* refactor

* message

* rename

* moved email templates

* using async file read

* typo

* using mustache

* moved file
renamed to email client

* logging with prometheus

* added social links

* line

* using stronger types (object instead of array of any[])
moved prometheus logging into email client
added function to send mail using a template

* fixed templates not working

* removed console log

* name change

* rename

* moved templates

* rename

* string interpolation

* string interpolation

* moved to dev dependencies, exact versions

* moved types

* removed function, remove unnecessary if

* update template params

* updated name

* fixed button not clickable

* throwing

* moved template metadata to one place

* rename

* sending email on account creation

* removed test code
removed await

* fixed button

* not stopping the server if email client validation failed

* added metric for queue lengths

* exposing getjobcounts

* added job to log queue lengths

* added endpoint to request verification email

* using send verification email that calls api instead of firebase built in

* updated route

* renamed function

* recording time to complete

* returning 400 if email already verified

* setting transport initialized to true earlier, setting it to false if caught error

* moved forgot password flow to a simple popup, added new endpoint to ape

* added forgotpasswordemail route

* added email tempalte

* setting transport to false if caught error

* added email queue function

* moved try higher

* fixed log
2023-02-13 13:24:43 +01:00
Jack 59b252389e
fix: backend/package.json & backend/package-lock.json to reduce vulnerabilities (#3945)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-SIMPLEGIT-3177391

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-01-25 23:21:53 +01:00
Miodec 7c34fa2591 upgraded swagger stats 2022-12-28 15:42:12 +01:00
Snyk bot 6813c707a0
fix: backend/package.json & backend/package-lock.json to reduce vulnerabilities (#3860)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-JSONWEBTOKEN-3180020
- https://snyk.io/vuln/SNYK-JS-JSONWEBTOKEN-3180022
- https://snyk.io/vuln/SNYK-JS-JSONWEBTOKEN-3180024
- https://snyk.io/vuln/SNYK-JS-JSONWEBTOKEN-3180026
2022-12-28 15:37:37 +01:00
Snyk bot 829a68b3e7
fix: backend/package.json & backend/package-lock.json to reduce vulnerabilities (#3814)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-GOT-2932019
- https://snyk.io/vuln/SNYK-JS-QS-3153490
2022-12-07 15:52:48 +01:00