Commit Graph

50 Commits

Author SHA1 Message Date
Moon Patel cf4670582d Handle error in challenge action 2023-07-30 20:02:30 +05:30
Moon Patel e98c50d25d fixed stale state closure bug by using useRef() in ChessGameContextProvider 2023-07-28 04:24:16 +05:30
Moon Patel 95fb999747 tests setup 2023-07-26 18:43:26 +05:30
Moon Patel b3b99a340a fixed eslint errors 2023-07-25 20:09:03 +05:30
Moon Patel 13fd73776d prop types added 2023-07-25 19:59:51 +05:30
Moon Patel d71444a6e5 import refactoring 2023-07-25 19:46:04 +05:30
Moon Patel bd13e2b129 bug fixes 2023-07-25 18:52:36 +05:30
Moon Patel f86846004f fixed: Friends list not shown in settings page 2023-07-23 19:04:49 +05:30
Moon Patel 156d4e6f2c Authentication UX improved. 2023-07-23 18:46:31 +05:30
Moon Patel 46be9f244e assets restructuring . 2023-07-23 13:58:22 +05:30
Moon Patel 336259421a new:MainLoader component added 2023-07-23 13:53:46 +05:30
Moon Patel bf51745afe Authentication component changed to adapt new changes in
authentication APIs
New packages added:
-> zod - to add validation logic
-> react-hook-form - handle form state
2023-07-23 13:24:55 +05:30
Moon Patel b2af52f2c6 .env.example added 2023-07-15 16:43:37 +05:30
Moon Patel 78a3187e9a feature: Profile page update user info 2023-07-14 19:53:58 +05:30
Moon Patel e8775ff8e1 feature: Add Friends
Now other user can be added as friends in Settings > Friends
2023-07-13 23:12:01 +05:30
Moon Patel 03fd3a0692 changed: chessboard background color saturation 2023-07-12 19:01:30 +05:30
Moon Patel 86041aef9d changed: Profile component in Settings 2023-07-12 18:52:12 +05:30
Moon Patel ceecac85dd Friends component in Settings page improved 2023-07-12 18:22:19 +05:30
Moon Patel 5c9dcb7533 changed: UI of GameHistory component and some minoor UI enhancements . 2023-07-12 18:19:52 +05:30
Moon Patel 892936c84c changed: background colors and colors changes in various places 2023-07-11 20:45:29 +05:30
Moon Patel 71e5c276e8 minor changes 2023-07-11 20:03:11 +05:30
Moon Patel 24cefafa87 removing console logs and some improvements 2023-07-08 02:21:20 +05:30
Moon Patel 136136cfb0 removed JoinChallenges.jsx 2023-07-08 02:10:51 +05:30
Moon Patel 8f39b29377 New feature added: Games automatically saved in database after game
ends in pgn format
2023-07-07 19:10:48 +05:30
Moon Patel 3f22a674e7 Implemented the challenge accept and decline buttons
TODO: Delete room when the challenged user declines the challenge
2023-07-06 23:07:15 +05:30
Moon Patel 189f35a232 Feature added: Exit the game when opponent resigns 2023-07-05 21:44:41 +05:30
Moon Patel 128e86ecb4 feature added: checkmate detection and ending game on checkmate 2023-07-05 21:25:28 +05:30
Moon Patel 313906eb5d Added timers but it is not stable for now 2023-07-05 18:28:16 +05:30
Moon Patel a7a1d08b46 Added a useCountDown hook to handle countdown 2023-07-05 16:14:11 +05:30
Moon Patel 1e77891971 prevent user from making move when not in current state of game. 2023-07-04 20:03:43 +05:30
Moon Patel aa6e463b60 Game state persistency implemented. Game state is
now saved on page refresh.
The game state is stored on the server and when the user refreshes
the page the game state is fetched from the server on socket
re-connection

Next step:
stop user from making any move when the use is viewing past moves
2023-07-04 16:59:20 +05:30
Moon Patel 1d26cca8d8 Go back button and go ahead button implemented
TODO
- Improve the styiling of the GameHistory component
2023-07-04 03:52:19 +05:30
Moon Patel d8d0c95779 New feature added: While in the match the user can go back it time
to analyse previous moves.
2023-07-04 03:11:46 +05:30
Moon Patel 5f450e92fe Adding constants 2023-07-03 22:54:43 +05:30
Moon Patel 8c99021395 Chess game logic move to chess-game-context.jsx
Improves code clarity as logic is handled by context provider and
application is handled by the component itself
2023-07-03 22:37:02 +05:30
Moon Patel 4e6bc1f198 click and move bug fixed 2023-07-03 18:09:20 +05:30
Moon Patel f7bb1e89cb Fixed: Incorrect friends list shown 2023-07-03 17:02:25 +05:30
Moon Patel 1d9f2cc65a file restructuring 2023-07-03 16:29:09 +05:30
Moon Patel c25d5bcca5 Styles for the play page fixed. The styles are now responsive and
the web application can now also be viewed on mobile
2023-07-03 16:27:16 +05:30
Moon Patel 4853e5edd9 THIS IS A MAJOR MILESTONE
Socket connection re-implemented. Everything is working fine now.
All thats left to do is to make the app robust and handle some edge cases.
TODO
- The friends list is maybe hardcoded or whatever I dont know, but the problem is
  it shows the same username no matter who the signed in user is. I need to fix that.
- Whenever the pawn reaches to tha last square for promotion an 'Invalid move' error is
  thrown by the Chess class. Need to fix that too.
- Need to disable the chessboard (so user cannot make any moves) until the opponent has joined the game.
- Set timers for the game.
- Need to show the loading states in various places in the app.
- Improve the backend such that a user cannot create more than one room at a time.
- Remove hardcoded values from various places.
- Make the app responsive. The UI is good on desktop but it is very bad on mobile.
- Add a feature to search and add friends.
- Destroying the rooms when the match ends and set timers for auto destruction after a certain time.
- Need some logic to save games in the history.
- Add some tests.
2023-07-03 01:12:47 +05:30
Moon Patel 40acca7dd1 Challenging and room creating working now 2023-07-02 19:21:36 +05:30
Moon Patel 10a943e444 New component Challenges.jsx added which lists all the challenges
sent to the user and allow the user to accept or decline it.
TODO:
- Add API for fetching challenges.
- Implement onClick for Decline button in Challenges component
2023-07-02 18:45:08 +05:30
Moon Patel 9ec5021dea Logic for connecting is changed in frontend starting from this commit
New algorithm:
- User sends a request to create a room in the backend
- roomID is generated in the backend
- server responds with a roomID
- user stores it in the localStorage and is redirected to the game page

Changes made in this commit
Previously there was no api endpoint for room creation. Now the API is
utilized by the ChallengeFriend.jsx component as per the above algorithm
2023-07-02 17:51:53 +05:30
Moon Patel acde1cb44d fixed: user data cleanup from localStorage after logout 2023-07-02 17:15:35 +05:30
Moon Patel ceb6a6993c socket implementation and multiplayer feature added in frontend 2023-07-02 14:45:49 +05:30
Moon Patel 16326766b7 refactoring - chess logic used from third party package 2023-07-01 03:22:59 +05:30
Moon Patel b45cc5194c drag and drop play implemented, audio integrated 2023-06-29 23:51:54 +05:30
Moon Patel 0a06890b81 socket connection established and chess logic imported from old codebase 2023-06-29 02:03:06 +05:30
Moon Patel 02b302e2c8 authentication implemented 2023-06-27 18:28:24 +05:30
Moon Patel 8edd05e020 basic ui for frontend 2023-06-27 15:43:40 +05:30