Giter Site home page Giter Site logo

artiphishle / ch-grossmeister-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 374 KB

Chess API built using Next.js & Docker

JavaScript 0.41% TypeScript 86.13% CSS 12.74% Dockerfile 0.29% Shell 0.43%
alphabeta api book chess chess-api docker engine minimax negamax nextjs

ch-grossmeister-api's Introduction

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:

MONGODB_URI={secret}

2. Run the API

# 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<IGame>
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.

ch-grossmeister-api's People

Contributors

artiphishle avatar dependabot[bot] avatar

Watchers

 avatar

ch-grossmeister-api's Issues

Dockerize API & add some openings

Let's use docker to run our API.

Acceptance Criteria

  • API runs in docker container, request to http://{api_ip}:{api_port}/api/opening returns the opening book.

  • Add Ruy Lopez (C60)

    • Morphy Defense
    • Morphy Defense, Caro Variation
    • Morphy Defense, Norwegian Variation
    • Morphy Defense, Cozio Defense
    • Berlin Defense
  • Add Scotch (C45)

    • Classical Variation, and 2 more
  • Add Sicilian Defense (B20)

    • Wing Gambit and some variations

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.