Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/artiphishle/ch-grossmeister-api
Chess API built using Next.js & Docker
https://github.com/artiphishle/ch-grossmeister-api
alphabeta api book chess chess-api docker engine minimax negamax nextjs opening schach schach-api typescript
Last synced: 1 day ago
JSON representation
Chess API built using Next.js & Docker
- Host: GitHub
- URL: https://github.com/artiphishle/ch-grossmeister-api
- Owner: artiphishle
- Created: 2023-07-14T02:46:09.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-17T20:35:10.000Z (24 days ago)
- Last Synced: 2024-12-17T21:31:13.267Z (24 days ago)
- Topics: alphabeta, api, book, chess, chess-api, docker, engine, minimax, negamax, nextjs, opening, schach, schach-api, typescript
- Language: TypeScript
- Homepage:
- Size: 448 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ch-grossmeister-api
Chess API built for grossmeister.ch
- Mongodb Atlas
- Mongoose
- Next.js## Quickstart
**1. Environment variables\***
First: provide a `.env` file in the root directory, and add the environment:
```bash
MONGODB_URI={secret}
```**2. Run the API**
```bash
# clean, build & run docker image
npm run do:clean
npm run do:build
npm run do:run# visit: localhost:3001/api/opening
```---
## API Endpoints
### ♟️ /api/game
| Method | Endpoint | Description |
| ------ | ------------------ | ------------------------------- |
| POST | /api/game | Create a new game |
| GET | /api/game/[gameId] | Find game by \_id |
| PATCH | /api/game/[gameId] | Payload: `data: Partial` |
| DELETE | /api/game/[gameId] | Delete game by \_id |### ♟️ /api/opening
As the opening book is added by administrators, users get only 'read' permissions to examine the immutable openings.
| Method | Endpoint | Description |
| ------ | ------------------ | -------------------------- |
| GET | /api/opening/[fen] | Find opening by FEN string |### ♟️ /api/user
As user authentication is handled using Clerk there is only a `GET` endpoint to retreive the logged user data.
| Method | Endpoint | Description |
| ------ | --------- | ---------------------- |
| GET | /api/user | Returns logged in user |## API Authentication
⚠️ Authentication is **bypassed**, everyone is the same mock user now.