Skip to content

thesammy2010/api.thesammy2010.com

Repository files navigation

api.thesammy2010.com

gRPC HTTP repo for https://api.thesammy2010.com

Setup

make install

Running Locally

make run-app

Usage

Good Create Squash Player request

POST /v1/squash/players?pretty
Content-Type: application/json

{"name": "TheSammy2010", "email_address": "foo@example.com"}
{
  "id": "a715ea87-92e2-4a11-80cf-7a9f9f2d9302"
}

Bad Create Squash Player request

POST /v1/squash/players?pretty
Content-Type: application/json

{"name": ""}
{
    "code": 9, 
    "message": "Player `name` is required", 
    "details": []
}

Good Get squash player request

GET /v1/squash/players/76d34b99-1e10-4693-b2c2-20b129ad4da1
Content-Type: application/json
{
  "squashPlayer": {
    "id": "6622224b-a8eb-4093-bc24-4c8a20f49f25",
    "name": "TheSammy2010",
    "email_address": "foo@example.com",
    "profile_picture": "",
    "created_at": "2024-01-25T00:58:28.819889Z",
    "updated_at": "2024-01-25T00:58:28.819889Z"
  }
}

Bad Get squash player request

GET /v1/squash/players/76d34b99-1e10-4693-b2c2-20b129ad4da1
Content-Type: application/json
{
    "code": 3,
    "message": "Player `id` type is not valid UUID",
    "details": []
}
PATCH /v1/squash/players/76d34b99-1e10-4693-b2c2-20b129ad4da1 -d '{"name": "TheSammy2011"}'
{
  "squashPlayer": {
    "id": "76d34b99-1e10-4693-b2c2-20b129ad4da1",
    "name": "TheSammy2011",
    "email_address": "foo@example.comssss",
    "profile_picture": "",
    "created_at": "2024-02-05T14:34:41Z",
    "updated_at": "2024-02-05T15:34:44Z"
  }
}

TODO

  • Authentication
  • Routes & Methods
    • /v1/squash/players/signup
    • /v1/squash/players
      • GET
      • GET (list)
      • POST (create) //Deprecated in place of /v1/squash/players/signup
      • PATCH (update)
      • DELETE
    • /v1/squash/games/singles
      • GET
      • GET (list)
      • POST (create)
      • PATCH (update)
      • DELETE
    • /v1/squash/games/doubles
      • GET
      • GET (list)
      • POST (create)
      • PATCH (update)
      • DELETE
  • Postgres Setup in Code
  • ORM relationships between tables
  • Handle null fields
  • Handle timestamps
  • Logging
    • Trace Logging
  • Handle non-registered routes

About

Source code for the public API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published