55 Commits

Author SHA1 Message Date
Moon Patel 231e1658de chore 2024-08-22 07:48:17 +05:30
Moon Patel ee77788fb8 npm run start and npm run dev scripts update 2024-05-13 22:09:57 +05:30
Moon Patel 75e4aa3e08 PROD mode and backend/.env.example update 2024-05-13 21:41:20 +05:30
Soumya Ranjan Swain 37197e37f1 add moves can be viewed using left, right keys 2023-10-31 05:32:09 +05:30
Moon Patel 133c762b3b refactored api 2023-10-19 19:38:07 +05:30
Moon Patel 662cd02cfd API endpoints changed, save profile feature added 2023-10-19 19:05:49 +05:30
Moon Patel 6f420a40dd changes in api 2023-10-19 19:05:49 +05:30
Moon Patel fc1d5d4143 added color choice for computer game and fixed bug of computer not making move when player chooses black 2023-10-15 23:20:46 +05:30
Moon Patel ab3aedfc3b making stockfish16 engine executable to prevent spwan EACCES error 2023-10-15 01:55:12 +05:30
Moon Patel f5cf5c4619 fix: set cookies error while authentication in production 2023-10-15 01:38:43 +05:30
Moon Patel 35fbc2a8ce feat: added bind mounts to docker-compose.yml file for hot reload 2023-10-14 20:26:57 +05:30
Moon Patel e28f876b74 bug fix in backend docker file 2023-10-13 03:07:39 +05:30
Moon Patel e87629f736 stockfish chess engine added
the engine is compatible wiht linux systems. If you are running on
windows add windows engine.
2023-10-13 03:04:58 +05:30
Moon Patel ea04c7eb9d feat: add friend from settings pages
Now the user can add friend to his friends list through
the settings page
2023-10-13 00:55:43 +05:30
Moon Patel 83a7192dea updated .env.example in backend 2023-10-13 00:55:43 +05:30
Moon Patel f9639b5dc4 added computer mode 2023-10-11 22:43:37 +05:30
Moon Patel dcbd9477fe chessbot added 2023-09-30 09:22:17 +05:30
Moon Patel a42a7d0e75 dockerize backend 2023-09-18 21:58:47 +05:30
Moon Patel 164da1ffee corrected cors origin 2023-09-14 00:13:08 +05:30
Moon Patel 4cca4b6527 changes added 2023-09-13 18:36:46 +05:30
Moon Patel 6d21475e20 cors origin 2023-09-13 18:35:36 +05:30
Moon Patel 2848cb213c changes 2023-09-13 18:31:34 +05:30
Moon Patel 7b1503d384 some changs 2023-09-13 14:28:58 +05:30
Moon Patel 0bd078438f health check route added 2023-09-13 13:50:15 +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 bd13e2b129 bug fixes 2023-07-25 18:52:36 +05:30
Moon Patel 156d4e6f2c Authentication UX improved. 2023-07-23 18:46:31 +05:30
Moon Patel 81ff9e31a0 Authentication logic changed
JWT is now stored in cookie instead of localStorage
changed APIs:
-> /api/auth/login
-> /api/auth/signup
new APIs:
-> /api/auth/logout
2023-07-23 13:20: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 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 0abd8e0660 hardcoded email id moved to .env file 2023-07-06 23:51:36 +05:30
Moon Patel 5786795e58 Changes in this commit:
- New model added for games played
- Game model ref added to User model
- New APIs created to create and get games
2023-07-06 23:47:20 +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 882837448c New apis added and old apis improved 2023-07-06 19:28:19 +05:30
Moon Patel 189f35a232 Feature added: Exit the game when opponent resigns 2023-07-05 21:44:41 +05:30
Moon Patel 5dbf0409f6 new API endpoint added
- DELETE /api/user/:username/challenges/:challengeID -> when user accepts or declines a challenge
2023-07-04 23:49:09 +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 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 f7bb1e89cb Fixed: Incorrect friends list shown 2023-07-03 17:02:25 +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 dd5f3069d0 JWT auth token expiresIn option removed 2023-07-02 19:07:35 +05:30
Moon Patel 490bd539fe new api endpoint create - /api/user/:username/challenges
returns a challenges sent to the current user by other users
2023-07-02 19:03:57 +05:30
Moon Patel cfd207e41f minor import changes 2023-07-02 17:56:28 +05:30
Moon Patel b026837184 TODO list for apis added 2023-07-02 16:10:15 +05:30
Moon Patel 6869a87cfe room creation and joining logic re-implemented 2023-07-02 15:53:35 +05:30
Moon Patel ea116e7f6a create room api added 2023-07-02 15:49:30 +05:30