Coder Social home page Coder Social logo

chess's People

Contributors

abhayymishraa avatar airbornharsh avatar csummers27 avatar guruharsha1 avatar hkirat avatar manish591 avatar modamaan avatar moh1tsingh avatar nimit9 avatar nischal-shetty2 avatar ofcljaved avatar sagardxd avatar sama-004 avatar sanjeevs9 avatar sarthak-simplifii avatar skushagra9 avatar ssk090 avatar turbobot-temp avatar usama-rahman avatar vishalmishraa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chess's Issues

Issue in auth in react native

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?

Persist games into a DB

Let's create a simple postgres table + Prisma for ORM which stores all the game information

  • Whenever a new game is started, create an entry in the game table
  • As the users make moves, store it in a moves table which has a foreign key to the game table
  • Add ids 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 reset
  • If a user wants to join a game and there is no in memory Game object for it, recover the game from the DB and put it back in memory

issue in Signin with github

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.
image
image

  1. 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.

  2. 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.

  3. 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

Possible fix:
image

Join a game by id: Frontend

Join a game by adding the game id, backend is done, have to complete the frontend part.

Taking this up myself.

Error Encountered When Running `node index.ts`

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'
}

Add cleanup logic

Whenever the game ends (timeout, users leave/resign) , we should clean up the resources on the server (destroy the Game class instance)

Scalability

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.