Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Exploading Kittens

A luck based card game.

DEMO VIDEO

Watch the video

Installation

Clone the Project

git clone https://github.com/AFZL210/exploding-kittens.git

Setting Up Client/Frontend

  1. Navigate to the exploding-kittens/client folder:

    cd exploding-kittens/client
  2. Install the dependencies:

    npm install
  3. Start the development server:

    npm run dev

Setting Up Backend

NOTE: Make sure you have Go and Redis installed, and Redis is running either locally or on a remote server.

  1. Navigate to the exploding-kittens/server folder:

    cd exploding-kittens/server
  2. Install Go modules:

    go mod tidy
  3. 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,
          },
      })
  4. Run the server:

    go run main.go

No go to http://localhost:5173/ to play the game!

API Reference

Register user

  GET /api/register
Parameter Type Description
username string Required. username
password string Required. password for username

Login user

  GET /api/login
Parameter Type Description
username string Required. username
password string Required. password for username

Get User's Cards

  GET /api/getcards?username={$Username}

Shuffle/Reset usersgame

  GET /api/shuffle?username={$Username}

Play Move/Draw a card

  GET /api/play?username={$Username}
Parameter Type Description
index string Required. index of card to be drawn

Get Leaderboard

  GET /api/leaderboard

Get User's Rank

  GET /api/user-rank?username={$Username}

Features

  • 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

Bonus Features

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

Releases

Packages

Used by

Contributors

Languages