newyork-anthonyng / guess-the-move

https://guess-the-move.vercel.app
0 stars 0 forks source link

Draw architecture diagram #2

Closed newyork-anthonyng closed 1 year ago

newyork-anthonyng commented 1 year ago

POST /validatePGN

Request:
body: {
  fen: '1 e4 e5 2 Nf3 Nc6'
}

Response:
{
  ok: true | false
}

POST /evaluateMove

Request:
body: {
  masterFen: 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1',
  userFen: 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1'
}

Response: {
  masterEval: '+8.5',
  userEval: '+3'
}

POST /reportCard

Request: {
  // Nothing. Backend will understand game from session  
}

Response: {
  ok: true,
  data: {
     inaccuracies: 3,
     mistakes: 4,
     blunders: 1,
     avgCentipawnLoss: 38
  }
}

// when user has not finished the game
Response: {
  ok: false
}