- Frontend Developer.
- Team member at NextUI.
- X(Twitter): @ryo_manba
- LinkedIn: ryo-manba
ryo-manba / ft_transcendence Goto Github PK
View Code? Open in Web Editor NEWReal-time online Pong game with chat.
Real-time online Pong game with chat.
çŸç¶ãããŒã«ã«ã®Node.jsã§åãããŠããããã¯ãšã³ãã®ãµãŒããŒãNestã«ç§»è¡
udemyéãã«ç»é¢äœæ
åãã®ã¯åŸã§ããã¹ãéãããã«ããã
2ã€ã®ãŠã£ã³ããŠãç«ã¡äžããŠPongããã¬ãŒããŠããæäžã«ãããããäžæ¹ã®ãŠã£ã³ããŠãéãããšããµãŒããŒåŽãäžèšã®ãšã©ãŒãåããŸããåé¡ã«å¯ŸåŠããã
[Nest] 2382 - 10/28/2022, 12:53:05 AM ERROR [WsExceptionsHandler] Cannot read properties of undefined (reading 'player1')
TypeError: Cannot read properties of undefined (reading 'player1')
at GameGateway.updatePlayerPos (/Users/tnishina/Programming/42/ft_transcendence/backend/src/game/game.gateway.ts:164:12)
at /Users/tnishina/Programming/42/ft_transcendence/backend/node_modules/@nestjs/websockets/context/ws-context-creator.js:43:33
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at GameGateway.<anonymous> (/Users/tnishina/Programming/42/ft_transcendence/backend/node_modules/@nestjs/websockets/context/ws-proxy.js:11:32)
at WebSocketsController.pickResult (/Users/tnishina/Programming/42/ft_transcendence/backend/node_modules/@nestjs/websockets/web-sockets-controller.js:90:24)
ããã¯ãšã³ãã§ä¿æããŠãããŠãŒã¶ãŒæ å ±ãšã²ãŒã é¢é£ã®åçš®æ©èœãã€ãªããã¿
å ·äœçãªã€ãªããã¿ã®é ç®ãšããŠã¯ããããšæãã€ãéšåã¯ä»¥äžã®éããïŒãã£ãšå šç¶ããããïŒ
@yuta-fujimoto ãäœã£ãŠãããŠãããããã³ã°ã»ã·ã¹ãã ãšã²ãŒã ã®ã€ãªã蟌ã¿ãå®è£
çŸç¶ãReact + TypeScripté察å¿ã®Pongã®ããã³ããšã³ããNextã«ç§»è¡
以äžã®è¿œå æ©èœãå®è£
ããããããš
draw.io ã§ç°¡åãªç»é¢é·ç§»ãäœæããŸããã
ããŒã ãžã®æåŸ
ãªã³ã¯
https://miro.com/welcomeonboard/RzNFS0xQQzBUdTRFWDFPYjN1bWNsemdYbG45MmZnMHZjTllIRHpRMktuUTFaTERlbFFQVktnOHlGTm44dHJYdHwzMDc0NDU3MzQ4NjE1Njg0NDU3fDI=?share_link_id=923306915377
åç
§ã®ã¿ïŒéç»é²äŒå¡ã®ç·šéã¯ææãã©ã³ãããããïŒ
https://miro.com/app/board/o9J_lbYM-4o=/?share_link_id=947232855041
42ã®èªèšŒãæã£ãŠãããã¹ã ãŒãºã«çµãã£ãã®ã§ãããŸãã
ã²ãŒã ãããéã«è¡šç€ºããååããŠãŒã¶åã«ããã
ãã©ãŠã¶ã®ç»é¢ãµã€ãºã«å¿ããŠãresponsiveã«ã²ãŒã ç»é¢ã®ãµã€ãºãå€æŽã§ããããã«ä¿®æ£
eslint 'pages/**/*.{js,jsx,ts,tsx}'
prettier --write "pages/**/*.{js,jsx,ts,tsx}"
https://www.notion.so/Game-option-487cee26b673420989b679578b988249
ææ°ã®å®å®çã®16.18.0ã«çµ±äžããã(2022/10/23æç¹)
https://nodejs.org/ja/download/
察å¿ãçµãã£ãããã§ãã¯ãé¡ãããŸãã
ãã£ããã«ãŒã ãäžã€ãäœãããŠããªãç¶æ ã§/chatã«ã¢ã¯ã»ã¹ãããšãããã¯ãšã³ãåŽã§äžèšã®ãšã©ãŒãçºç
/Users/tnishina/Programming/42/ft_transcendence/backend/node_modules/@prisma/client/runtime/index.js:30873
throw new PrismaClientKnownRequestError(message, error2.code, this.client._clientVersion, error2.meta);
^
Error:
Invalid `this.prisma.chatRoom.findMany()` invocation in
/Users/tnishina/Programming/42/ft_transcendence/backend/src/chat/chat.service.ts:26:33
23 }): Promise<ChatRoom[]> {
24 const { skip, take, cursor, where, orderBy } = params;
25
â 26 return this.prisma.chatRoom.findMany(
The table `public.ChatRoom` does not exist in the current database.
at RequestHandler.handleRequestError (/Users/tnishina/Programming/42/ft_transcendence/backend/node_modules/@prisma/client/runtime/index.js:30873:13)
at RequestHandler.request (/Users/tnishina/Programming/42/ft_transcendence/backend/node_modules/@prisma/client/runtime/index.js:30856:12)
at PrismaService._request (/Users/tnishina/Programming/42/ft_transcendence/backend/node_modules/@prisma/client/runtime/index.js:31836:16)
at ChatGateway.handleConnection (/Users/tnishina/Programming/42/ft_transcendence/backend/src/chat/chat.gateway.ts:34:18)
statsãªã©ã®è¡šç€º
export defaultããªããšãyarn buildãã¡ãããšèµ°ã£ãŠãããªãããã§ãããææ°ã§ãããä¿®æ£ããé¡ãããŸãã
(åèãªã³ã¯: https://qiita.com/hirochan/items/9de19f22dc409507313c)
äžèšã®ç¹ãå«ããGameRecordã®DBæ¹è¯ãå®æœ
[åè]
https://zuma-lab.com/posts/typescript-import-absolute-path-settings
ãã¬ãŒã€ãŒä»¥å€ã®ç¬¬3è ãé²è¡äžã®ã²ãŒã ã芳æŠã§ããæ©èœãå®è£
ã²ãŒã ãéžãã§èŠ³æŠç»é¢ã«ç§»ããããã«ãããçŸç¶ããWatch.tsxãããã«é²åããã圢ã«ããã
Frontend
ç®ã®ããŒã¯ãé·ç§»ãã¿ã³ã«ãããNext察å¿
Backend
JSON.stringify
ã¯ããããããšäœç§ããã«éããæ€èšããã
ã²ãŒã çµäºåŸãåæã®ããŒã¿ãåãã¬ãŒã€ãŒã«çŽä»ãã圢ã§ããã¯ãšã³ãã§èšé²
0:0 error Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: custom.d.ts.
The file must be included in at least one of the projects provided
custom.d.tsãã©ããããimportãããŠãªãïŒ
https://wonwon-eater.com/ts-eslint-import-error/
äžèšãå®è¡ããŠããšã©ãŒãçºçãã
eslint.ignoreã§linterã®å¯Ÿè±¡å€ã«ãããšãäžå¿commitã¯ã§ãã
https://github.com/ryo-manba/ft_transcendence/pull/68/files#diff-fbda2e0371b06961184b6238699784b350177911a9a75dfebbc59fc5b811d6adR8
çŸç¶ããStart.tsx
ãé²åããã圢ã«ããã
Backend
ãã¢ã§äœ¿ã£ãŠããèªåã®ååãªã©äžèŠãªããŒã¿ã®ããåãã®åé€ãèªåã®ååã¯DBãããšã£ãŠããã
Frontend
ã²ãŒã ã£ãœãç»é¢ã«ãªãããã«ãšããã®ãšNext察å¿ããã©ã³ã¹ãèŠãå¿
èŠãããã®ã§å
šäœãã§ããããŸãèããã
yarn build && yarn start
yarn dev
å¥ã«ä»ããã£ãŠããã§ããªããã§ãããã²ãŒã ã®ã¹ã³ã¢ã·ã¹ãã (ã©ããŒåšã)ã®å®è£ ãã©ããããçžè«ãããŠããã ãããã§ãã
ã¹ã³ã¢ãªãã§åæã®ã¿ãèšé²ãã
åæã«å¿ããŠã¹ã³ã¢ãã€ããã
äŸãã°ã
ããã©ã«ãã§1000ãã€ã³ããäžããããŠ
åã€ãš100ãã€ã³ãå¢ããŠãè² ãããš100ãã€ã³ã倱ãã
ã²ãŒã ã®çµæã«å¯ŸããŠã¹ã³ã¢ãå€ãããšãã§ããããããããªã(3 - 1ã ã£ããåŸããããã€ã³ããå€ããšã)
bronze
, shilver
, gold
ã®ã©ã³ã¯ãäžããããªã©ãªã©ããããããããšã¯æããã§ããããæèŠãèãããããšæã£ãŠãŸãã
udemyéãã§ã²ãšãŸãè¿œå
postmanã§ç¢ºèª
useEffectã®äžã§socket.onããŠãéšåã§strict modeäžã§ãè€æ°ååŒã³åºãã«ãªããªãããã«ãsocket.offãã€ããŠãªããšããã¯ã€ãã
åèïŒhttps://mui.com/
ãšããããDBã®ããšã¯èãããããŒã¿ãé©åœã«æºåããŠããã
ã®è¡šç€ºããããã
ç°¡åãªãŠãŒã¶æ å ±ã®è¡šç€ºãããŒã ç»é¢é·ç§»ããã°ã¢ãŠããªã©ãããbarãäžéšã«ä»ãããã§ãã
å®è£ ããã¹ããã©ãããèããããã®ã§è°è«ã«ããŠãããŸã
ã¡ã¢
nextã«ãããredirect
https://zenn.dev/uttk/articles/4649e49f1e6628
serverã§ç»é¢ãäœã£ãŠãã®ã§<Navigate>
ãrouter.push
ãªã©ã¯å€±æããå Žåããã
_app.tsx
ã§router.pathname
ã§æ¡ä»¶åå²ããã°ããæãã«ãªããããããªã
useEffect
ã§router.push
ãšããããšäžç¬ç»é¢ãèŠããã®ã§å人çã«å¥œãã§ã¯ãªã
ããã°ã€ã³ããŠããªãã=ãcacheã«ããŒã¿ãå ¥ã£ãŠãªããã«ãããããšæã£ãŠãããããããããšcompileããªãããã³ã«ã«ãŒãã«æ»ã£ãŠããŸãã®ã§å¥ã«åŸã§ãããããªãšã
ãã°ã€ã³ãã¿ã³æŒãããšãã«ãäžåºŠuseQueryUser
ãåŒã³åºãå¿
èŠãããããããã¿ã³ãæŒãããšãã®é¢æ°ã§ã¯åŒã¹ãªãã®ã§enableãªãã·ã§ã³ã䜿ãã
ãã£ããç»é¢ããç¹å®ã®ãŠãŒã¶ãŒã«å¯ŸããŠã²ãŒã ã®ç³èŸŒã¿ãã§ããããã«ãã
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.