Skip to content

Latest commit

 

History

123 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

This document outlines the system and library requirements, build instructions, and core functionality for both the CLI and server components of the Cribbage application.

CLI

Description

The CLI provides a terminal-based user interface for interacting with the Cribbage game server. It allows users to log in, join or create games, view their hand, play cards, and track the game state.

System and Library Requirements

Build Instructions

  1. Ensure you have Go installed and configured correctly.

  2. Navigate to the cli directory:

    cd cli
  3. Build the CLI application:

    go build -o crib_cli main.go

    Alternatively, use the BuildGame mage target:

    mage BuildGame

    This command builds the CLI for multiple platforms and places the binaries in the builds directory. This requires magefile.go and build.go to be configured correctly.

  4. The executable crib_cli will be created in the cli directory, or in the builds directory if using the mage target.

Core Functionality

  • Login: Authenticates a user with the server.
  • Lobby: Displays a list of open matches and allows users to join existing matches or create new ones.
  • Game View: Presents the game board, player hands, and other relevant game information.
  • Input Handling: Parses user input to perform actions such as playing cards or cutting the deck.
  • State Management: Manages the CLI's state and updates the view based on server responses.

Server

Description

The server component provides the backend logic and API endpoints for the Cribbage game. It handles user authentication, match management, game state, and communication between clients.

System and Library Requirements

Build Instructions

  1. Ensure you have Go installed and configured correctly.

  2. Navigate to the server directory:

    cd server
  3. Build the server application:

    go build -o crib_server main.go

    Alternatively, use the BuildServer mage target:

    mage BuildServer

    This command builds the server and places the binary in the builds directory. This requires magefile.go and build.go to be configured correctly.

  4. The executable crib_server will be created in the server directory, or in the builds directory if using the mage target.

Running the Server

  1. Ensure PostgreSQL is installed and running. Configure the database connection string as needed.

  2. Run the server executable:

    ./crib_server

Core Functionality

  • API Endpoints: Provides RESTful API endpoints for user authentication, match management, and game actions. See router.go and main.go for endpoint definitions.
  • Match Management: Creates, joins, and manages Cribbage matches.
  • Game Logic: Implements the rules of Cribbage, including card dealing, playing, and scoring.
  • Database Interaction: Stores and retrieves game data from the PostgreSQL database.
  • Real-time Updates: (Potentially) Implements real-time communication with clients using WebSockets or similar technologies.
  • Swagger Documentation: Generates Swagger documentation for the API endpoints.

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages