-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Added Timing for each move
, Spectator Feature
, Chat Feature
, Review Page
and updated the ui for it
#198
Open
Airbornharsh
wants to merge
37
commits into
code100x:main
Choose a base branch
from
Airbornharsh:timer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 35 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
09f1561
Merge commit '5cc8d2bc0850da6eef3f6e0100b88a0250a7497c' into timer
Airbornharsh 49e91c9
Merge commit 'ec2f10663bbe2144c477f4743ed894e935b8d7b1' into timer
Airbornharsh 8421446
Timer was removed in the UI
Airbornharsh 047947b
Added some Logic for each piece move
Airbornharsh 47e6e4a
addes logic and ui change in Frontend for move timer
Airbornharsh 0fca8f2
Updated the move timings
Airbornharsh 9e84f5e
Merge commit '0fca8f242a8c195356512a42504854b84b766111' into timer
Airbornharsh 4c86309
Merge commit 'e2ad6ce6363312aaae83058744fe03049a825647' into timer
Airbornharsh e16659f
Updated the logic with own
Airbornharsh 98e3904
cleaning ups
Airbornharsh 9430d23
Formatting
Airbornharsh f786d47
Added Spector Screen and logic in backend
Airbornharsh 6888956
Added the spectator in the landing to get the rooms
Airbornharsh a70a085
Added Chatting Feature
Airbornharsh 480e3e3
Added Review Page and users can check the moves also
Airbornharsh 3e92e58
Merge commit 'e51b13ce6b099703eb3ce90f5b8ca03b1db28566' into timer
Airbornharsh 265a137
lint error
Airbornharsh 2917546
Merge commit '35a689dcff2515b0d18e59fbf0dff7633e047ded' into timer
Airbornharsh 8e23205
Updated according to new Code
Airbornharsh 0e16979
chenged to previous
Airbornharsh 5824431
Merge commit '1fe8678701f2f9e78e93612646e203a69c183a82' into timer
Airbornharsh ba561f7
Merge commit '467b45381e80908d486d6bd6f542bd0a10722a0b' into timer
Airbornharsh 63e78d5
Merge commit '172f920a2e76b78c354edaacb05c8871d216f68e' into timer
Airbornharsh 251e529
Button Color for spectate
Airbornharsh dcc9b59
Merge commit '632a0df456cdfa55185bea895ac2afa0d164e529' into timer
Airbornharsh a1a4807
Removed package lock json
Airbornharsh 2786632
Updated lock FIles
Airbornharsh de39822
Old Lock
Airbornharsh 9373220
Yarn lock update to old one
Airbornharsh 8407256
Old Lock
Airbornharsh 2fd2e60
Format and stopped timer when game over
Airbornharsh efa3c97
Added Review Button in Game Result Modal
Airbornharsh ddd0dd0
Merge commit 'e8dd89936e88277c017f2910d72e814d9a2d11a9' into timer
Airbornharsh fbfd383
Updated the logic in server
Airbornharsh fe8e359
Updateed
Airbornharsh b542a8b
Added Chat in Spectator
Airbornharsh 214cdde
Merge branch 'main' into timer
Airbornharsh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,47 @@ | ||
import { Router } from 'express'; | ||
import { db } from '../db'; | ||
|
||
const v1Router = Router(); | ||
|
||
export const IN_PROGRESS = 'IN_PROGRESS'; | ||
|
||
v1Router.get('/', (req, res) => { | ||
res.send('Hello, World!'); | ||
}); | ||
|
||
v1Router.get('/games', async (req, res) => { | ||
try { | ||
const games = await db.game.findMany({ | ||
include: { | ||
blackPlayer: true, | ||
whitePlayer: true, | ||
}, | ||
where: { | ||
status: IN_PROGRESS, | ||
}, | ||
}); | ||
res.json(games); | ||
} catch (e: any) { | ||
res.status(500).json({ error: e.message }); | ||
} | ||
}); | ||
|
||
v1Router.get('/games/:gameId', async (req, res) => { | ||
try { | ||
const game = await db.game.findUnique({ | ||
include: { | ||
blackPlayer: true, | ||
whitePlayer: true, | ||
moves: true, | ||
}, | ||
where: { | ||
id: req.params.gameId, | ||
}, | ||
}); | ||
res.json(game); | ||
} catch (e: any) { | ||
res.status(500).json({ error: e.message }); | ||
} | ||
}); | ||
|
||
export default v1Router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should ideally happen on the same url
We shouldnt expect spectators to come at a different url
fine for now tho