This is the API for the Byte-Sized Medieval Paleography app. The project also has a front-end repo.
You can play the game by installing both repos locally. Installation instructions are available in the README files of the two repos.
- Clone the repository
- Run
npm installto install all dependencies - Create a MySQL database on your machine
- Create a
.envusing.env.sampleas a model - Add your preferred localhost port, local database information, and a secret key for encoding auth tokens to your
.envfile - Use
npm run db:migrateto create the database tables - Use
npm run db:seedto seed the database - Use
npm run startto start the server
POST /api/register
- Response: 201,
{ success: true }
POST /api/login
- Response: 200,
{ token }
GET /api/leaderboard
- Response: 200, Array of top ten users by score:
[{ id, username, score}]
GET /api/profile
- Response: 200,
{ id, username, score }
GET /api/text
- Response: 200,
{ id, image_url, transcription, points }
POST /api/user/text
- Response: 201
PATCH /api/users/username
- Response: 200,
{ message: "Username updated! }
PATCH /api/users/email
- Response: 200,
{ message: "Email updated! }
PATCH /api/users/password
- Response: 200,
{ message: "Password updated! }
PATCH /api/users/score
- Response: 200,
{ newTotal }
DELETE /api/users/
- Response: 204