A luck based card game.
git clone https://github.com/AFZL210/exploding-kittens.git-
Navigate to the
exploding-kittens/clientfolder:cd exploding-kittens/client -
Install the dependencies:
npm install
-
Start the development server:
npm run dev
NOTE: Make sure you have Go and Redis installed, and Redis is running either locally or on a remote server.
-
Navigate to the
exploding-kittens/serverfolder:cd exploding-kittens/server -
Install Go modules:
go mod tidy
-
Update Redis configuration in
main.go:-
If Redis is running locally, update the configuration as follows:
redisClient := redis.NewClient(&redis.Options{ Addr: "localhost:6379", })
-
If Redis is running on a remote server, configure it like this:
redisClient = redis.NewClient(&redis.Options{ Addr: "host:port", Username: "Username", Password: "Password", TLSConfig: &tls.Config{ MinVersion: tls.VersionTLS12, }, })
-
-
Run the server:
go run main.go
No go to http://localhost:5173/ to play the game!
GET /api/register| Parameter | Type | Description |
|---|---|---|
username |
string |
Required. username |
password |
string |
Required. password for username |
GET /api/login| Parameter | Type | Description |
|---|---|---|
username |
string |
Required. username |
password |
string |
Required. password for username |
GET /api/getcards?username={$Username} GET /api/shuffle?username={$Username} GET /api/play?username={$Username}| Parameter | Type | Description |
|---|---|---|
index |
string |
Required. index of card to be drawn |
GET /api/leaderboard GET /api/user-rank?username={$Username}- User game create an account and play game as per given rules
- Show leaderboard to users
- Used Redux for state management
- User can login/register with username and password
- Used JWT for auth
- Automatically save the game for a user at every stage so the user can continue from where he left off last time.
- Real-time update of points on the leaderboard for all the users if they are playing simultaneously.
