🚀 RESTful API demo with Actix Web and Postgres

Built from this template: actix-psql-template

⚠️ Authentication Required: All API endpoints require the x-api-key header to be included in your requests.

📡 Database Endpoints

GET
/api/db
Check database connection and retrieve PostgreSQL version and current time.

📝 Status Tracker Endpoints

POST
/api/statustracker
Create a new status tracker record.
{
  "name": "string",
  "status": "string"
}
{
  "id": 1,
  "created_on": "2024-01-01T00:00:00Z",
  "changed_on": "2024-01-01T00:00:00Z",
  "name": "string",
  "status": "string"
}
GET
/api/statustracker
Retrieve all status tracker records, ordered by ID.
[
  {
    "id": 1,
    "created_on": "2024-01-01T00:00:00Z",
    "changed_on": "2024-01-01T00:00:00Z",
    "name": "string",
    "status": "string"
  }
]
GET
/api/statustracker/{id}
Retrieve a specific status tracker record by ID.
{
  "id": 1,
  "created_on": "2024-01-01T00:00:00Z",
  "changed_on": "2024-01-01T00:00:00Z",
  "name": "string",
  "status": "string"
}
PUT
/api/statustracker/{id}
Update an existing status tracker record by ID.
{
  "name": "string",
  "status": "string"
}
{
  "id": 1,
  "created_on": "2024-01-01T00:00:00Z",
  "changed_on": "2024-01-01T00:00:00Z",
  "name": "string",
  "status": "string"
}
DELETE
/api/statustracker/{id}
Delete a status tracker record by ID.
{
  "message": "Record deleted"
}

🏆 Scoreboard Endpoints

POST
/api/scoreboard/enter_score
Enter a new score into the scoreboard. Automatically maintains top 10 rankings.
{
  "name": "string",
  "score": 100
}
{
  "id": 1,
  "name": "string",
  "score": 100,
  "created_at": "2024-01-01T00:00:00Z",
  "is_top_10": true
}
GET
/api/scoreboard/show_scores
Retrieve the top 10 scores with rankings.
[
  {
    "rank": 1,
    "id": 1,
    "name": "string",
    "score": 100,
    "created_at": "2024-01-01T00:00:00Z"
  }
]
DELETE
/api/scoreboard/empty_scoreboard
Clear all entries from the scoreboard.
{
  "message": "Scoreboard cleared successfully",
  "deleted_count": 42
}