Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lenguyenthanh/fide
Experimental FIDE Api
https://github.com/lenguyenthanh/fide
cats cats-effect chess fide functional-programming scala skunk smithy smithy4s typelevel
Last synced: 23 days ago
JSON representation
Experimental FIDE Api
- Host: GitHub
- URL: https://github.com/lenguyenthanh/fide
- Owner: lenguyenthanh
- License: agpl-3.0
- Created: 2024-04-03T10:06:00.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-04-13T03:13:39.000Z (7 months ago)
- Last Synced: 2024-04-14T00:57:59.497Z (7 months ago)
- Topics: cats, cats-effect, chess, fide, functional-programming, scala, skunk, smithy, smithy4s, typelevel
- Language: Scala
- Homepage: https://fide.thanh.se/docs/index.html
- Size: 176 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Experimental FIDE API
[![Continuous Integration](https://github.com/lenguyenthanh/fide/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/lenguyenthanh/fide/actions/workflows/ci.yml)
## How to use
Check [Open API docs](https://fide.lichess.dev/docs/index.html)
## Development
### Prerequisites:
- Docker
### Run
Also requires JDK 21 with [sbt](https://www.scala-sbt.org/1.x/docs/Setup.html)
```bash
cp .env.example .env
docker compose up -d
```then
```bash
sbt backend/run
```or
```bash
sbt backend/stage
export $(cat .env | xargs) && ./modules/backend/target/universal/stage/bin/backend
```### Usage
```bash
open http://localhost:9669/docs
curl http://localhost:9669/api/players
```### Database viewer
```bash
COMPOSE_PROFILES=adminer docker compose up -d
```http://localhost:8180/?pgsql=db&username=admin&db=fide&ns=fide (password: dummy)
### Stress test with Gatling
```bash
docker compose -f docker-compose.gatling.yml up -d
sbt gatling/gatling:test
```### Before submitting PR
```bash
sbt test
sbt lint
```### release
```bash
sbt release with-defaults
```## Run without building
You can use a pre-built Docker image from [GitHub Container Registry](https://github.com/lenguyenthanh/fide/pkgs/container/fide). Here is an example of how to run it with docker-compose:
```yaml
name: fideservices:
api:
image: ghcr.io/lenguyenthanh/fide:latest
environment:
- HTTP_SHUTDOWN_TIMEOUT=1
- POSTGRES_HOST=db
- POSTGRES_PORT=5432
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=dummy
- POSTGRES_DATABASE=fide
ports:
- 9669:9669
networks:
- fide_api
restart: unless-stoppeddb:
image: postgres:16.2-alpine3.19
environment:
POSTGRES_DB: fide
POSTGRES_USER: admin
POSTGRES_PASSWORD: dummy
ports:
- 5432:5432
networks:
- fide_api
restart: unless-stoppednetworks:
fide_api:
driver: bridge
```Then run:
```bash
docker compose up -d
```