-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtodo.txt
307 lines (247 loc) · 8.81 KB
/
todo.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
- upgrade webpack to 5
- fix html webpack plugin with webpack 5
- upgrade typescript
- upgrade rxjs
use createReactApp typescript version
login app
save vs insert?
use seasonId, suffix ids
predictions dont have gameRoundPicks
fix leaderboard tests
work on processes
punt:
>>>> jokers
findOrCreateJoker(userId, roundId)
findOneOrCreate(userId, matchId) --> [findOrCreatePrediction(userId, matchId)]
findOrCreatePredictions(userId, roundId)
findOrUpdatePrediction(userId, matchId, choice)
pickJoker(userId, matchId)
unsetJoker(userId, match)
findOrCreatePicks() { isComputerGenerated? }
findOrCreatePicks -> optimize, get matches - zip em with prediction, get match odds; use VosePredictor
findOneOrCreate -> optimize pass full match not matchId
processor -> createPredictionsIfNotExist(roundId) -> findOrCreateJoker, (findOrCreatePredictions -> findOrCreatePrediction)
processor -> unsetJokers(matchId) -> unsetJoker
UI -> load-page [findOrCreatePredictions], pick-joker [pickJoker],
change prediction-score [findOrUpdatePrediction], lucky-spin [findOrCreatePicks]
events -> match status changed [unsetJokers, processPredictions], new match round [findOrCreatePredictions]
match finished/cancelled/postponed? or not scheduled/timed?
<<<< jokers
<<< grouping
- name, teams
- match has gameRound, grouping { Group A, Round of 16, Quarter-finals, Semi-finals, Final, Third-place }
- compe has-groupings
>>> groupings
<<< stadiums
- name
- compe has stadiums
- team has stadium
- ui default to homeTeam if has stadium, drop-down or autocomplete better
<<< stadiums
dao should be composed not inherited base-repo
vose predictor laterz
refactor tests undefined types
<<< userScore
- findScoreAndUpsert
>>>
<<< gameRound
add jokerPickable? -> for last 8 wc
>>>
<<< frontend
add slug to gameRound
create constants
merge findAll and find
in matchRep findAll -> change
if has team filter then add home&away to criteria;
conditions: criteria, filter, sort, range
test matchRepo spec findAll(conditions, projections, options)
>>>>
<<<deprecations
npm WARN deprecated @types/[email protected]: Mongoose publishes its own types, so you do not need to install this package.
npm WARN deprecated [email protected]: bcrypt-nodejs is no longer actively maintained. Please use bcrypt or bcryptjs. See https://github.com/kelektiv/node.bcrypt.js/wiki/bcrypt-vs-brypt.js to learn more about these two options
npm WARN deprecated [email protected]: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: mocha-typescript has been deprecated, use @testdeck/mocha instead
npm WARN deprecated [email protected]: Deprecated due to bug in CI build https://github.com/visionmedia/superagent/pull/1677\#issuecomment-1081361876
npm WARN deprecated @types/[email protected]: This is a stub types definition. chai-http provides its own type definitions, so you do not need this installed.
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at <https://github.com/visionmedia/superagent/releases>.
npm WARN deprecated [email protected]: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
>>>
@testdeck/mocha? use?
<<<
auth - simple auth
remove fb/google/twitter
oauth after react
create prediction
end goal docker with api, postman collection
seeder -> worldcup -> stadiums, groupings
dockerize -> node + mongodb
deploy to aws, heroku, digital-ocean?
>>>
<<<
fix tests
update match model & repo
update leaderboard model & repo
update score model & repo
update gameplay & tests
move tests to jest pain?
env setup?
>>>
<<<
/game -> /game/competitions
{
competions: [],
defaultCompetition: {
record: {},
seasons: [],
currentSeason: {
record: {},
teams: [],
stadiums?: [],
groupings?: [],
gameRounds: [],
currentGameRound: { <- last if finished
record: {},
matches: [] <- with or without predictions
}
}
}
}
competitions ->
api/game -> api/game/competitions
api/game/competitions/:competition-slug
api/game/competitions/:competition-slug/:season-slug
api/game/competitions/:competition-slug/:season-slug/round-slug or round-position
getCompetition -> apiCompetition
getSeason -> gameSeason
getRound -> gameRound
game -> /game GameController /game-season /
competitions/english-premier-league/2020/gameweek-1
competitions
world-cup | matches | seasons
english-premier-league
seasons
2021-22 matches
>>>
fix mongoose merge (cleanup)
fix points resultPoints scorePoints
>>>>
update leaderboard processors to update match globalscores/rankings status
>>>>
handle client-side filters
chai-assertions-count
crypto
passport
express-jwt
passport-local
jsonwebtoken
>>>>>
id toString remove
update matches process status in schedulers
test calculatePoints
test processLeaderboards
onMatchday ifCurrentRound position Changed
findOrCreatePredictions timer
updateScorenRankings timer
>>>>
run from package-lock
add two users do preds, run
>>>>
matches.scheduler
getMatches for leagueCodes
ids -> currentSeasons - which gameRound?
findAllFinishedForCurrentSeasons(currentSeasons)
competition -> currentSeason -> matches
findAllByIds -> currentSeasons
currentSeasons -> currentGameRounds
findAllForCurrentGameRounds(currentGameRounds)
Append ids - which// doLater tomorrows matches
matches for pL&others
test getMatches;
test getMatchesW/Ids
const delay = (ms) => new Promise(resolve => setTimeout(resolve,ms));
mongodump --db=test123-test --archive --gzip | cat > /tmp/backup.gz
docker cp /tmp/backup.gz ligidb:/tmp
mongorestore --nsFrom="test123-test.*" --nsTo="ligipredictor.*" --gzip --archive=/tmp/backup.gz
mongorestore --uri mongodb+srv://<user>:<password>@cluster0.w2btl.mongodb.net --archive=db.dump
ls -p .. | grep '/$'
Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
depends_on:
- ligiappserver
volumes:
- ./frontend/build:/var/www/html
location / {
root /var/www/html;
try_files $uri /index.html;
#try_files $uri $uri/ /index.html;
}
location /api/ {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
proxy_pass http://server/api/;
}
upstream client {
server client:3000;
}
upstream library-api {
server library-api:5000;
}
location / {
proxy_pass http://client;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
location /api/v1 {
proxy_pass http://library-api;
}
location / {
# Without this line routing in your Single Page APP will not work
try_files $uri $uri/ /index.html =404;
}
location /backend {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://localhost:5000;
proxy_ssl_session_reuse off;
proxy_set_header Host $http_host;
proxy_cache_bypass $http_upgrade;
proxy_redirect off;
}
proxy_pass http://localhost:5021;
proxy_http_version 1.1;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://api-server:5000;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto http;
client_max_body_size 17m;
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;