GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - stackrlabs/unification-cup: Micro-rollup for Unification Cup

BranchesTags
Open more actions menu

Latest commit

 

History

41 Commits
41 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
assets
assets
 
 
data/season1-ethcc2024
data/season1-ethcc2024
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
Dockerfile
Dockerfile
 
 
README.md
README.md
 
 
genesis-state.json
genesis-state.json
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
stackr.config.ts
stackr.config.ts
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

banner

Unification Cup

Micro-rollup for Avail's Unification Cup 2024

State Structure

type LeagueState = {
  admins: string[];
  meta: {
    // metadata about the tournament
    round: number;
    startTime: number;
    endTime: number;
    winnerTeamId: number;
    byes: {
      teamId: number;
      round: number;
    }[];
  };
  teams: {
    id: number;
    name: string;
  }[];
  matches: {
    id: number;
    scores: Record<string, number>;
    startTime: number;
    endTime: number;
    penaltyStartTime: number;
    winnerTeamId: number;
  }[];
  players: {
    id: number;
    name: string;
    teamId: number;
    removedAt?: number;
  }[];
  logs: {
    // logs of all the actions performed in the tournament
    playerId: number;
    matchId?: number;
    timestamp: number;
    action: string;
  }[];
};

Transition Functions

  • startTournament: Start the tournament
  • startMatch: Start a match with matchId
  • penaltyShootout: Start a penalty shootout for a match with matchId
  • endMatch: End a match with matchId
  • logGoal: Log a goal for a player with playerId in a match with matchId
  • logBlock: Log a block for a player with playerId in a match with matchId
  • logFoul: Log a foul for a player with playerId in a match with matchId
  • logPenaltyHit: Log a penalty hit for a player with playerId in a match with matchId
  • logPenaltyMiss: Log a penalty miss for a player with playerId in a match with matchId
  • addPlayer: Add a player with playerId to a team with teamId
  • removePlayer: Remove a player with playerId from a team with teamId
  • logByes: Log a bye for a team with teamId. (Used in case of odd number of teams)
  • removeGoal: Remove a goal for a player with playerId in a match with matchId

How to run?

Run using Node.js 🚀

npm start

Run using Docker 🐳

  • Build the image using the following command: (make sure you replace `<NPM_TOKEN>` with the actual value)
# For Linux
docker build -t unification-league:latest . --build-arg NPM_TOKEN=<NPM_TOKEN>

# For Mac with Apple Silicon chips
docker buildx build --platform linux/amd64,linux/arm64 -t unification-league:latest . --build-arg NPM_TOKEN=<NPM_TOKEN>
  • Run the Docker container using the following command:
# If using SQLite as the datastore
docker run -v ./db.sqlite:/app/db.sqlite -p <HOST_PORT>:<CONTAINER_PORT> --name=unification-league -it unification-league:latest

# If using other URI based datastores
docker run -p <HOST_PORT>:<CONTAINER_PORT> --name=unification-league -it unification-league:latest

About

Micro-rollup for Unification Cup

api.unify.stf.xyz

Resources

Readme
Activity
Custom properties

Stars

0 stars

Watchers

2 watching

Forks

0 forks
Report repository

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.