I cut you this one issue, https://github.com/jaeheonshim/ChessBoard/issues/1
I think your castling logic is incomplete? Worth a double check.