i'm trying to learn how to do math at dumb rocks
Skills: C / C++ / JS / TS /PYTHON
la transcendaaance
It'll be funnier if ball initial movements can't be predicted.
I will wait for a game interface to test it and implement it =)
for the deployment we have i think two solutions, we can have a nginx docker that load balance the traffic between our / and /api route (frontend and backend respectively)
or using nest serve-static to directly serve the builded vue files (i kinda like this solution because that mean we need one less container)
this thread is good to make an idea of it
https://www.reddit.com/r/Nestjs_framework/comments/lxaztu/how_do_you_implement_your_frontend_build_deploy/
Do stuff@alkanaev
After an user enabled 2FA : When user click on "login" and after he completed 42 auth, user is redirected to home page. User have to click a second time on "login" and then put the 2FA code before being considered as login.
A possible improvement would be to redirect user to the page asking for 2FA code right after 42 auth, if possible ?
In back, user's friends ids (numbers) are stored inside an array. There's no controller function inside users.controller for adding/removing a friend right now inside back (Get/post/patch/...) but some functions are made inside users.service.ts.
For info, an user should be able to see his friends status (playing/online/offline).
In subject, this feature is listed under user's account and same in correction.
I'll add controller functions about it inside user module.
the redirection of the route /api/auth/login-42 should redirect to /login and on the port 80 (not 8080) now
the page will show "you should not be there" but i will fix that later
A must do !
Subject say we should use "last stable version" for each framework/library used.
Vuetify 3 is only on beta. Buuut, as Vuetify 3 is more compatible with Vue 3 (which is stable), I guess we can defend that position in correction.
Honestly I don't think that anyone is going to check the version we use for library and stuff, but still, better prepare an argument before hand.
A system for disabling 2FA should be made, according to correction =/
For back, maybe do a lot of try/catch block ?
TODO this week
Because many students shared their 42 API keys on their public github repo, 42's staff said they will modify ft_transcendence and others concerned projects subjects on the 26th.
I guess those modifications should only concerned the API stuff and maybe a line about leaving our .env inside our git repo will be eleminatory. But further check is necessary.
Quick explanation: Evan got a VPN which he could set up in order for us to test on the same network once front and back are put together.
State : Left for later as we privilege more urgent parts
No assignees yet
Test with Jest to implement if nothing else to do or issues with some routes
Postponed for now
Everything in title ;)
Goal :
Some clues :
https://docs.nestjs.com/techniques/logger
https://stackoverflow.com/questions/66617285/nestjs-in-express-mode-log-all-incoming-requests
Note : Fastify seems to be more exigent with routes, it may need to clean up our code to it's standards
If we can't find an automated way to do it, we can always make it the "dummy" way with calls to console.log() which will be displayed each time a controller is triggered.
Other option :
Create modules front and back for Users (Evan and Nadège)
It's ft_transcendEnce
My brain bugged on it too ahah
An user should be able to access other users informations and stats, according to subject
Possible improvements to improve efficiency or security:
I encounter this error inside Console
each time I resize my window.
Funny enough it doesn't pop when on "home page", but once I clicked on some buttons (account/game/...), it's unavoidable.
The details of the error sometimes changes, so here are some logs of it:
Uncaught TypeError: canvas is null resize CanvasComp.vue:44 resize CanvasComp.vue:44 resize self-hosted:1178 resize self-hosted:1178
Uncaught TypeError: canvas is null resize CanvasComp.vue:44 mounted CanvasComp.vue:76 callWithErrorHandling runtime-core.esm-bundler.js:155 callWithAsyncErrorHandling runtime-core.esm-bundler.js:164 __weh runtime-core.esm-bundler.js:2685 flushPostFlushCbs runtime-core.esm-bundler.js:356 flushJobs runtime-core.esm-bundler.js:401
Uncaught TypeError: canvas is null resize CanvasComp.vue:44 mounted CanvasComp.vue:76 callWithErrorHandling runtime-core.esm-bundler.js:155 callWithAsyncErrorHandling runtime-core.esm-bundler.js:164 __weh runtime-core.esm-bundler.js:2685 flushPostFlushCbs runtime-core.esm-bundler.js:356 flushJobs runtime-core.esm-bundler.js:401 promise callback*queueFlush runtime-core.esm-bundler.js:285 queueJob runtime-core.esm-bundler.js:279 effect runtime-core.esm-bundler.js:5168 triggerEffects reactivity.esm-bundler.js:382 triggerRefValue reactivity.esm-bundler.js:982 effect reactivity.esm-bundler.js:1113 triggerEffects reactivity.esm-bundler.js:382 triggerRefValue reactivity.esm-bundler.js:982 effect reactivity.esm-bundler.js:1113 triggerEffects reactivity.esm-bundler.js:382 triggerRefValue reactivity.esm-bundler.js:982 effect reactivity.esm-bundler.js:1113 triggerEffects reactivity.esm-bundler.js:382 triggerRefValue reactivity.esm-bundler.js:982 effect reactivity.esm-bundler.js:1113 triggerEffects reactivity.esm-bundler.js:382 triggerRefValue reactivity.esm-bundler.js:982 set value reactivity.esm-bundler.js:1026 finalizeNavigation vue-router.esm-bundler.js:3197 pushWithRedirect vue-router.esm-bundler.js:3070 promise callback*pushWithRedirect vue-router.esm-bundler.js:3040 push vue-router.esm-bundler.js:2969 install vue-router.esm-bundler.js:3386 use runtime-core.esm-bundler.js:3834 <anonymous> main.js:10 js app.js:184 __webpack_require__ app.js:1470 __webpack_exports__ app.js:2681 O app.js:1516 <anonymous> app.js:2682 <anonymous> app.js:2684
More info about this error (link associated with errors messages by console): https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Unexpected_type
Idk if someone was already aware of this error, but I'm making an issue of it just in case ;)
Just to keep you up to date
Some warning about npm packages use in front (will try to download latest versions from my computer as I don't have sudo rights on 42 computers)
npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '@achrinza/[email protected]', npm WARN EBADENGINE required: { node: '8 || 10 || 12 || 14 || 16 || 17' }, npm WARN EBADENGINE current: { node: 'v18.2.0', npm: '8.10.0' } npm WARN EBADENGINE } npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. npm WARN deprecated [email protected]: vuetify-loader has been renamed to webpack-plugin-vuetify for Vuetify 3 npm WARN deprecated [email protected]: this library is no longer supported npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 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]: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
Some warning about size of files used
`warning
asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
fonts/materialdesignicons-webfont.5d875350.eot (1000 KiB)
fonts/materialdesignicons-webfont.54b0f60d.woff2 (318 KiB)
fonts/materialdesignicons-webfont.d671cbf6.woff (454 KiB)
fonts/materialdesignicons-webfont.21f691f0.ttf (1000 KiB)
img/arrow-left.50d7b8ba.png (375 KiB)
img/arrow-right.28c52cca.png (374 KiB)
img/blurredy.d059c8a3.jpg (3.3 MiB)
css/chunk-vendors.05ccbf40.css (591 KiB)
js/chunk-vendors.b7d63461.js (439 KiB)
warning
entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
app (1.11 MiB)
css/chunk-vendors.05ccbf40.css
js/chunk-vendors.b7d63461.js
css/app.d3e08c8a.css
js/app.dae8f6ed.js
File Size Gzipped
dist/js/chunk-vendors.b7d63461.js 439.12 KiB 133.54 KiB
dist/js/app.dae8f6ed.js 89.08 KiB 21.30 KiB
dist/js/webfontloader.33ec0995.js 12.03 KiB 4.84 KiB
dist/css/chunk-vendors.05ccbf40.css 591.02 KiB 84.45 KiB
dist/css/app.d3e08c8a.css 17.17 KiB 2.94 KiB
`
npm WARN deprecated [email protected]: this library is no longer supported npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated [email protected]: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in. npm WARN deprecated @types/[email protected]: This is a stub types definition. socket.io provides its own type definitions, so you do not need this installed. npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/pinpoint' npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/formula' 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 @hapi/[email protected]: Moved to 'npm install @sideway/address' npm WARN deprecated @hapi/[email protected]: Switch to 'npm install joi'
12 high severity vulnerabilities
We should test our app on the last stable version of :
the first time a user connect to the website using 42auth, he click once the button, authenticate, then go back to the /login page and is not registered, he need to click another time to finally be registered
i'll look for it on my side but you can check on it on your side too whenever you got the time :')
Cookie can't be access from socket.io websockets as client.handshake.headers['cookie']
return undefined
value.
Then, user opening a websocket can't be identified.
For now, the fix found is to set httpOnly: false
when setting cookie with jwt token inside auth module (see auth.controller.ts file).
But as it's good pratice to set httpOnly
to true
, it'll be interesting to find another solution to the problem
Redirect users from backend upon first registration to the modify info page.
This may be coming from the last Chat PR that enable ordering channel by update date.
but now the chat is blinking on each new message.... very disturbing.
Find solution or downgrade :(
On chat page, warning as displayed inside console :
[Vue warn]: Failed to resolve component: v-subheader
This warning pops up for v-subheader, v-list-item-group, v-list-item-content, v-tabs-slider and v-tabs-item which are all vuetify elements. I tried to fix this, but solutions I found on the mighty internet were mostly JS compatible and not TS, or were not working.
It's only warnings and elements are correctly displayed, so I guess we can ignore them. But I still do my duty to report =)
you can see it in your user page in the front hosted by me
the backend is the last commit in main
State : Left for later as we privilege more urgent parts
No assignees yet
i realise that when i merged the branch new_chat on reaster-front in the commit 1d70354 the scrolling of the website as been locked and i can't scroll in the website anywhere now
personnaly i tested nestjs for a couple of days and clearly this need some experimentations to get used to
for the moment the best project/tuto i've followed is this one : https://wanago.io/2020/05/11/nestjs-api-controllers-routing-module/
According to correction, accessing a match of a player should be done from chat or friend interface.
I made the logic for it inside chat interface and started it on TheGame.vue
.
@Reaster0, I put some TODO
comments where the rest of the logic should be implemented. It may need some variables manipulations to have the correct display. Can you please continue it ?
the backend should update the "has 2fa" field to true when the "auth/login-2fa" route is sending the 201 response once
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.