Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lichess-org/api-demo
Client-side app using various Lichess APIs for demonstration purpose
https://github.com/lichess-org/api-demo
lichess lichess-api
Last synced: about 1 month ago
JSON representation
Client-side app using various Lichess APIs for demonstration purpose
- Host: GitHub
- URL: https://github.com/lichess-org/api-demo
- Owner: lichess-org
- License: agpl-3.0
- Created: 2022-03-24T14:37:33.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-10-24T10:09:28.000Z (about 2 years ago)
- Last Synced: 2024-04-15T02:13:06.712Z (8 months ago)
- Topics: lichess, lichess-api
- Language: TypeScript
- Homepage: https://lichess-org.github.io/api-demo/
- Size: 117 KB
- Stars: 52
- Watchers: 7
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lichess OAuth app demo
This is an example for a fully client side OAuth app that uses various APIs.
## Features
- Fully client side, no server needed
- Login with Lichess (OAuth2 PKCE)
- View ongoing games
- Play games
- Challenge the AI opponent
- Challenge a player
- Create a game seek
- Watch Lichess TV## Try it out
[The demo app is hosted on Github Pages](https://lichess-org.github.io/api-demo/)
## Run it on your machine
1. `npm install`
1. `npm run build`
1. `npm run serve` or any other method to serve the app on http://localhost:8000## Points of interest
- [ND-JSON stream reader](https://github.com/lichess-org/api-demo/blob/master/src/ndJsonStream.ts)
- [OAuth "Login with Lichess"](https://github.com/lichess-org/api-demo/blob/master/src/auth.ts)
- [Read the main event stream](https://github.com/lichess-org/api-demo/blob/master/src/ctrl.ts)
- [Game play](https://github.com/lichess-org/api-demo/blob/master/src/game.ts)
- [Create a seek and await a game](https://github.com/lichess-org/api-demo/blob/master/src/seek.ts)
- [Challenge a player](https://github.com/lichess-org/api-demo/blob/master/src/challenge.ts)
- [Watch Lichess TV](https://github.com/lichess-org/api-demo/blob/master/src/tv.ts)Feel free to reuse and learn from this code when building your own Lichess API app.