kacperfaber / chesstasks-server

ChessTasks.com API Server. I wrote with ❤ in Kotlin and Ktor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ChessTasks.com

ChessTasks.com API server written in Ktor/Kotlin

See ChessTasks in action: https://chesstasks.com.pl

build test publish running-server-version

Baner

Installation

git clone https://www.github.com/kacperfaber/chesstasks-server && cd chesstasks-server

Run server locally

# Will run with testing database with some records.
# To change default database
#   Edit: src/main/kotlin/com/chesstasks/data/TrySetupTestDb.kt
gradle runDev

# To run server without testing database
gradle runDevNoInitDb

Configuration

{
  "server": {
    "host": "",
    "port": 8080
  },

  "security": {
    "password-hasher": {
      // Password used to encoding/decoding user passwords.
      // In 'dev' profile, passwords are not encoded.
      "secret": "string"
    },

    "tokens": {
      // Password used to encoding/decoding access tokens.
      // In 'dev' profile, tokens are not encoded.
      "secret": "string"
    },

    "cors": {
      "allowed-origins": "white-space separated origins",
      "allowed-hosts": "white-space separated hosts"
    },

    // Api key is used to registration and confirmation endpoints.
    "api-key": "dev-api-key"
  },

  // Database
  "database": {
    "jdbc": "string",
    "username": "string",
    "password": "string"
  },

  "email": {
    // Email settings to send verification email
    "verification": {
      "hostname": "string",
      "port": 587,
      "username": "string",
      "password": "string",
      "from": "string",
      "subject": "string",
      "ssl-trust": "string"
    }
  }
}

Import Lichess database.

To import lichess database, insert file './lichess.data.csv' with puzzles. To run application, and import data from this file use parameter
-Dcom.chesstasks.puzzles.import=true

Author

Kacper Faber

About

ChessTasks.com API Server. I wrote with ❤ in Kotlin and Ktor

License:MIT License


Languages

Language:Kotlin 78.3%Language:HTML 18.5%Language:FreeMarker 1.7%Language:CSS 1.3%Language:JavaScript 0.1%