Commit graph

594 commits

Author SHA1 Message Date
Sondre Kjempekjenn
afd288a717
Testing - mock setup for redis (#2944) 2022-05-05 14:05:31 -04:00
Bruce Berrios
91220a5bdc
Move backend source files into src folder (#2943) 2022-05-05 19:27:00 +02:00
Bruce Berrios
38ed2f60aa
Remove await (#2941)
* Remove await

* Remove async

* Remove await server
2022-05-05 11:13:09 -04:00
Sondre Kjempekjenn
88a587c5c2
Feature/backend test (#2937) sondrekje
* Switch to ts-node-dev for development

* Minimal setup for backend testing

* Basic controller test

* __tests__ directory

* Delete old DB client

* Improve tests, ensure DB cleanup only runs for inMemory DB
2022-05-05 15:19:31 +02:00
Bruce Berrios
73f21c9cc5
Remove class syntax from george (#2935)
* Remove class syntax from george

* Remove boolean
2022-05-05 02:00:12 +02:00
Bruce Berrios
e5c295cfe4
Remove class syntax from db client (#2940) Bruception
Co-authored-by: Jack <jack@monkeytype.com>
2022-05-05 01:57:51 +02:00
Sondre Kjempekjenn
9634b93fc3
Add docker-compose and instructions to README (#2939) sondrekje 2022-05-05 01:52:17 +02:00
Miodec
bf8862fe74 not exiting in dev mode when redis connection failed
closes #2930
2022-05-04 19:27:34 +02:00
Miodec
8524646380 renamed folder dao to dal 2022-05-04 01:51:25 +02:00
Miodec
ec8ec49b71 Merge branch 'master' of https://github.com/Miodec/monkeytype 2022-05-04 01:48:29 +02:00
Bruce Berrios
6ee84b2484
DAO -> DAL (#2928)
* DAO -> DAL

* This what?

Co-authored-by: Jack <jack@monkeytype.com>
2022-05-04 01:47:51 +02:00
Miodec
de97d798eb moved data validation to anticheat repo 2022-05-04 01:44:13 +02:00
Miodec
b27f5c935b removed todo 2022-05-04 01:21:07 +02:00
Miodec
ca2c82db38 removed unused types 2022-05-04 01:20:26 +02:00
Jack
e6982f293d
Small Dao dals (#2927)
* converted preset dao to dal

* psa dao > dal

* typo

* config dao > dal

* public stats dao > dal

* fixed bad merge

* removed this

* removed comment
2022-05-04 00:43:58 +02:00
Bruce Berrios
9b7b5feb71
BotDAO -> BotDAL (#2926) bruception 2022-05-04 00:38:57 +02:00
Miodec
49befe4f76 unborked the code 2022-05-04 00:34:38 +02:00
Miodec
61292dfb8c fixed previous commit 2022-05-04 00:23:31 +02:00
Miodec
a4ca55cb73 converted report dao to dal 2022-05-04 00:17:34 +02:00
Bruce Berrios
12a63b1cb4
Ape keys dal (#2925) bruception
* Convert Ape-keys DAO to DAL

* Fix this reference
2022-05-04 00:13:48 +02:00
Miodec
a41bcad72d further stripping results of empty / zero values and then resetting them back to default when downloading results 2022-04-28 16:05:53 +02:00
Miodec
ebea7078bd removed quote length if result is not quote
closes #2898
2022-04-28 15:57:50 +02:00
Miodec
89e99fa668 added get last result to public api
closes #2893
2022-04-28 12:39:18 +02:00
Miodec
e419187d2c added get stats endpoint
closes #2892
2022-04-28 12:22:54 +02:00
Miodec
0b24ec2afb also serving at docs 2022-04-28 12:22:26 +02:00
Rizwan Mustafa
369f96691e
Refactor User DAL (#2857) rizwan
* Create romanian quotes (#2846) DKparadox

* Create romanian

* Add files via upload

* Rename romanian quotes.json to romanian.json

* Delete romanian

* Update romanian.json

* Update romanian.json (#2852) DKparadox

* Refactor User DAL

* Remove unnecessary check

* Add stack var in getUser

* removed unnecessary throw

* Fix error

Co-authored-by: DKparadox <93858181+DKparadox@users.noreply.github.com>
Co-authored-by: Miodec <bartnikjack@gmail.com>
2022-04-27 16:42:17 +02:00
Miodec
5f47133b31 added better error message
closes #2871
2022-04-27 16:08:03 +02:00
Jack
9ca477da54
Added tape mode (#2862)
* added config param for tape mode

* added settings section

* added commands

* moving caret to the correct place with tape mode is active

* only jumping line when not using tape mode

* prettier

* scrolling tape

* restarting test when tape mode changed

* showing one line when tape mode is active

* added function for scrolling words horizontally

* scrolling tape when layout emulator is enabled

* removed left margin when tape is active

* disable tape for some challenges

* fixed incorrect caret position when going back to a previous word

* ignoring no-this-alias

* fixed lines scrolling to often when tape mode was disabled

* storing caret width in a variable

* not allowing tape mode and show all lines together

* removed unnecessary comment
2022-04-24 17:04:46 +02:00
Evan
58505a9f31
Fix Collection Types (#2864) 2022-04-24 01:37:05 +02:00
Jack
b60e6905ce
Made username non optional (#2859)
* reduced code repetition

* throwing error when no name provided

* stopping signout if no current user

* expanded to 16 chars

* moved code to popup file

* added google sign up popup

* checking if name is available in the backend

* deleting account if popup was closed
uncommented sign up process
addd functions to enable and disable input

* added google sign up event to avoid circular dependency

* hiding by default

* name is no longer optional
user is deleted if its database object is not found

* using loader to indicate background activity
2022-04-23 19:46:41 +02:00
Jack
bdacc24660
Converted new quotes to typescript (#2844)
* renamed to ts

* added type for new quote

* converted to ts

* renamed dao to dal, fixed logic
2022-04-21 17:23:24 +02:00
Rizwan Mustafa
5691643b7a
Fixed versions (#2851) 2022-04-21 12:28:30 +02:00
Jack
6598823d60
Converted leaderboards DAO to typescript (#2843)
* added type for leaderboard entry

* converted leaderboards to ts

* fixed return type

* renamed occurences to DAL

* removed as any

* removed as any

* removed type casting
2022-04-21 12:24:13 +02:00
Rizwan Mustafa
b4c191e931
Convert ResultDAO to typescript and rename to DAL (#2838)
* Started conversion to typescript

* Added types to db collection

* Removed changed logic
2022-04-19 13:49:12 +02:00
Rizwan Mustafa
a0d5392884
(Backend) Ability to make Quotes Favorite (#2826) rizwanmustafa
* Created API for making quotes fav

* Moved routes over to quotes

* Renamed favQuotes to favoriteQuotes

* Renamed routes

* Removed error to prevent confusion and panic

* Added regex check for quote id and added fav quote number check

* Some fixy

* Added configuration for max favorite quotes

* Added grouping

* Created variable for storing collection

* Changed variable name

* Changed variable name

* Fixed some problems

* Fixed bug

* Added length chekc for quoteId

* MOved routes over to user

* Renamed routes
2022-04-14 22:53:44 +02:00
Miodec
6c6ebc2a24 removed unnecessary type cast 2022-04-14 18:38:03 +02:00
Rizwan Mustafa
f07a6dd656
Convert UserDAO to typescript & rename to UserDAL (#2821)
* Started conversion to typescript

* Some more fixy fixy

* Final fixy fixy or at least that is what it seems

* Even more fixy fixy

* Add verifed = false upon usre creation

* Added return type

* Removed extra data

* Fixes

* Removed class syntax of UserDAO

* Name fix

* Renamed UserDAO to UserDAL

* Fixed errors

* Fixed some problems

* Fixed pb bug

* Strict Equality

* Var name change

* Var name change
2022-04-14 18:07:28 +02:00
Miodec
ccd0bd6174 added support for approving quotes of one language
closes #2825
2022-04-11 16:05:07 +02:00
Miodec
e6fcc2daf2 added name field to approved quotes. closes #2824 2022-04-11 15:55:59 +02:00
Jack
ca00a53317
Added sub alt color, fixed various styling inconsistencies (#2804)
* replaced rgba with sub-alt

* changed color name

* reworked button styles, removed icon-button

* renamed color

* grid

* no text decoration

* renamed all icon buttons to text buttons

* using text-button

* fixed discord section

* using button class instead of redeclaring styles

* updated scroll styling

* more consistent scroll to top styling

* dot not in link

* fixed dot spacing

* actually fixed dot (stupid prettier)

* signout closer to the edge

* using text-button class

* updated button text for consistency

* lowercase

* moved show average section down

* fixed icon not being fixed width

* updated focus and hover button styling

* footer using text-button class

* fixed spacing
added new lines

* making sure custom themes work with sub alt

* updated validation

* reordered colors

* added sub alt colors to all themes

* updated alt sub colors

* temp

* updated sub alt colors

* updated sub alt

* fixed merge

* fixed merge

* merge fix

* moved section down

* lowercase

* merge fix

* consistent wording

* merge fix

* fixed merge

* removed test notifications

* removed balloon

* adjusted subalt

* removed debug code

* removed unused code

* removed some unused/old code

* fixed dot spacing
2022-04-07 22:04:43 +02:00
Miodec
5169f20ece unnecessary check 2022-04-07 01:30:16 +02:00
Bruce Berrios
a3fc6e9997
Migrate redis client and configuration client from class syntax (#2802) 2022-04-05 12:41:20 -04:00
Miodec
5545b8e0a3 added error message if user is already linked
closes #2794
2022-03-31 19:47:18 +02:00
Bruce Berrios
beb7e35dcb
Remove class syntax from controllers (#2791)
* Remove class syntax from controllers

* Specify base and rename
2022-03-30 18:20:13 -04:00
Miodec
d3c093bb42 checking size of config
removed confusing error
2022-03-28 17:41:16 +02:00
Rizwan Mustafa
020ac5cb24
Add logging support from Winston with colored output (#2774)
* Converted initial outputs to color outputs

* Some more coloring

* Colored all error outputs

* Completed coloring of outputs

* Created basic logger instance

* Moved over to Winston for logging

* Remove unnnecessary stuff

* Added max file size

* Renamed log to logToDb

* minor refactor and added tab separation with timestamps

* Some changes. Thanks Bruception

* Created wrapper for logger

* Tiny refactor

* Some fixes

* Some fixes

* Update example env

* Remove general

* using default yellow, making colors bold

* removed square brackets

* removed square brackets

* using logger instead of console log

* updated timestamp format

* moved comment up

* Fixed typo

Co-authored-by: Miodec <bartnikjack@gmail.com>
2022-03-27 11:29:11 -04:00
Miodec
a8bf141ed7 checking if resulthash length is 40 2022-03-25 20:46:35 +01:00
Bruce Berrios
1159072755
Optional redis (#2770)
* Make redis optional

* Specify return value
2022-03-25 19:15:26 +01:00
Bruce Berrios
ad8c433e45
Save exact (#2769) 2022-03-25 16:01:45 +01:00
Rizwan Mustafa
47c7fd42c7
Improve webpack - Reduced filesize by 18% by converting from node-object-hash to object-hash (#2768) rizwanmustafa
* Refreshed the PR

* not sending stringified result anymore

* removed length check

Co-authored-by: Miodec <bartnikjack@gmail.com>
2022-03-25 15:36:04 +01:00