Skip to content
This repository has been archived by the owner on Jun 5, 2021. It is now read-only.

This project is a lab of Dotnet core 3.1 web API on Heroku using Empire Puzzles information

License

Notifications You must be signed in to change notification settings

ming-tsai/EmpiresPuzzlesAPI

Repository files navigation

Empires Puzzle API

master

This project is an example how to deploy dotnet core 3.1 API in Heroku using Empire Puzzles information.

Game descriptions

Empires & Puzzles: RPG Quest. Empires & Puzzles is a completely new take on RPG games, combining match-3 battles and building a mighty stronghold - topped with thrilling PVP duels.

Prerequisities

Getting start

Run project locally

  1. Build project
dotnet build
  1. Create appsettings.Development.json file

  2. Config dev connection string on the file

  "ConnectionStrings" : {
    "PostgreSQL" : "User ID={user};Password={paswword};Host={host};Port=5432;Database={database};Pooling=true;SslMode=Require;TrustServerCertificate=True;"
  }
  1. Run project
dotnet run --project EmpiresPuzzles.API

Deploy project on Heroku

  1. Create Heroku app
  2. Add-ons postgresql on Heroku app
  3. Find database credentials on dashboard
  4. Set Heroku environment variable with name ConnectionStrings__PostgreSQL
User ID={user};Password={paswword};Host={host};Port=5432;Database={database};Pooling=true;SslMode=Require;TrustServerCertificate=True;
  1. Configure APP_NAME and HEROKU_API_KEY secrets see more

  2. Create action with this workflow

  3. Run workflow

  4. Open swagger endpoint {APP_NAME}.herokuapp.com/swagger

  5. Open GraphQL endpoint {APP_NAME}.herokuapp.com/graphql

Examples in GraphQL

This is an example for getting full fileds of heroes information.

query getFullFields {
  heroes {
    name
    stars
    color
    teamCost
    maxPower
    maxAttack
    maxDefense
    maxHealth
    maxLevel
    fandomWikiURI
    heroSpeed {
      description
    }
  }
}

This is an example for getting hero by name

query getByName {
  hero(name: "Thorne") {
    name
    stars
    color
    teamCost
    maxPower
    maxAttack
    maxDefense
    maxHealth
    maxLevel
    fandomWikiURI
    heroSpeed {
      description
    }
  }
}

Environments

Swagger Environment

GraphQL Environment

References

Deploy a Containerized ASP.NET Core App to Heroku using GitHub Actions

GraphL

GraphQL with NetCore API

GraphQL UI on dotnet core

Empires and puzzles fandom wiki