Skip to content

gabrielmdc/zombicide-spawn-backend

Repository files navigation

Zombicide Black Plague spawn cards - backend Build status

This project offers an API where you can get all the info about the Zombicide Black Plague spawn cards.

The frontend project is here

Table of contents:

API use

This API uses GraphQL. API documentation

Query examples

Get the card 39 from the Zombicide Black Plague spawn pile:

query {
  getCard(number: 39) {
    number
    type
    ... on SziCard {
      levels {
        red {
          zombie
          amount
        }
        orange {
          zombie
          amount
        }
        yellow {
          zombie
          amount
        }
        blue {
          zombie
          amount
        }
      }
    }
    ... on ActivationCard {
      levels {
        red {
          zombie
        }
        orange {
          zombie
        }
        yellow {
          zombie
        }
        blue {
          zombie
        }
      }
    }
  }
}

Get all cards of type Necromancer:

query {
  fetchAllCardsByType(type: "Necromancer") {
    items {
      number
    }
  }
}

Requirements

You can set-up some environment variables:

Optional:

  • PORT: The server port
  • SERVER_NAME: The server name. By default, the field name from package.json is used

For the develop environment, you can add a nodemon.json file which is not tracked by GIT. More info here

Example (nodemon.json):

{
  "env": {
    "PORT": "8080",
    "SERVER_NAME": "server_name"
  }
}

Using the Docker image

There are some official repositories.

docker pull gmdcwork/zombicide-spawn-backend:[version]
# Please set the correct variable values
docker run --name zombicide-spawn-backend-instance \
  -d zombicide-spawn-backend:[version]

Installation

yarn

Run

Start the application in production mode:

yarn start:prod

The command yarn start is similar but it does not set the environment variable NODE_ENV.

Build Docker container

You can use an official docker image Docker image repositories:

yarn build

Now you could run a container. Example explained

Docker image repositories

There are two repositories:

Credits

Author: Gabriel MDC

License

MIT