code100x / chess Goto Github PK
View Code? Open in Web Editor NEWA multiplayer chess platform
Home Page: https://chess.100xdevs.com/
A multiplayer chess platform
Home Page: https://chess.100xdevs.com/
User should be able to see the valid places where they can move on the FE
Hi. I am working on react native implementation. The frontend is ready, but I am unable to use the existing backend because of session based system.
The current auth system use passport.js to authenticate by redirecting to certain URL and getting cookie in return, but this cannot be done in react native, as no way to capture incoming httpsafe cookie.
I am confused how should I handle this, according to me session based system can be replaced by JWT based system, but i'll need to change entire auth flow.
Any suggestions on it?
We cant use next-auth
What's the best in house way for us to do auth?
Make a LICENSE file
Let's create a simple postgres table + Prisma for ORM which stores all the game information
game
tablemoves
table which has a foreign key to the game
tableids
to every created game and add a new event that let's users re-join a game with a given id if their wifi went down/ws conn resetin memory
Game object for it, recover the game from the DB and put it back in memoryUser gets logged out quickly
Should persist for longer time
Issue:
If a user makes his email id private in email setting on his github profile, then we will be getting email=null in profile object which leads to below error based on current authentication logic.
May be we can authenticate based on the github username only and creating/updating users accordingly and not storing the email info in db. Need to make email field optional (this don't seem right)
Downside - Everytime user changes his uername we have to make enteries in the table.
If we consider to add/insert email (if not null) along with username in db and user change username ex. name -> name1 , as per first approach we need make a new entry with 'username: name1' and email: {duplicate here} which leads to unique constraint error as we are trying to insert same email into different records.
Continue using same authentication logic and insert null email if email not exists. The issue occurs when user try to login again, here we will be fetching records where email=null can lead to update user displayName at multiple places.
Hence we can fallback to 1st approach. If you guys have any suggestions please share.
cc @hkirat
when I move, a click sound should come (same on the opponent)
Join a game by adding the game id, backend is done, have to complete the frontend part.
Taking this up myself.
@hkirat any thoughts about this?
Right now if I select a pawn, and then click on a knight, the from
peice doesn't change
It should switch to the other one
When I start running the backend with node index.ts
, I encountered this error. Can anyone help me solve this problem? Thanks in advance.
node:internal/errors:497
ErrorCaptureStackTrace(err);
^
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for D:\chess\chess\backend1\src\index.ts
at new NodeError (node:internal/errors:406:5)
at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:99:9)
at defaultGetFormat (node:internal/modules/esm/get_format:142:36)
at defaultLoad (node:internal/modules/esm/load:120:20)
at ModuleLoader.load (node:internal/modules/esm/loader:396:13)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:278:56)
at new ModuleJob (node:internal/modules/esm/module_job:65:26)
at #createModuleJob (node:internal/modules/esm/loader:290:17)
at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:248:34)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:229:17) {
code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
If the user is inactive for more than 60s
Probably needs to be configurable
User shouldnt be able to create a gmae with themselves
Logic should be here - https://github.com/code100x/chess/blob/main/apps/frontend/src/screens/Game.tsx#L55
Taking this up along with #37
Whenever the game ends (timeout, users leave/resign) , we should clean up the resources on the server (destroy the Game class instance)
Enter as guest is not working, maybe due to button is not mapped to any action.
Users creates a game
User gets a link
User can share the link with their friend who can join
Backend and Frontend Require prettier so that there should be any code formatting issue.
Using separate WebSocket servers for handling real-time games can become a bottleneck as your platform grows. and encounters issues with scaling and managing multiple WebSocket connections efficiently.
On running dev command prisma client is not generating automatically
Expected Behaviour
On running run dev command after installing package it should run the primsa client script it run if we go to packages and then genrate basically genrate scripts arre missing in turbo.json
Where all of this logic is moved and shared b/w fe and be https://github.com/code100x/chess/blob/main/apps/frontend/src/screens/Game.tsx#L11-L13
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.