Skip to content

Basith-08/go-todo-api

Repository files navigation

Todo API

Simple Go REST API for managing todos with Postgres.

Quick start

  1. Copy env template: cp .env.example .env
  2. Start services: docker compose up --build
  3. Run the smoke test: ./test-api.sh

API notes

  • All success responses use an envelope: { "message": "...", "data": ... }.
  • List endpoint supports pagination: GET /api/todos?limit=20&offset=0.

Example responses

List todos:

{
  "message": "Todos retrieved successfully",
  "data": {
    "items": [
      {
        "id": 1,
        "title": "Test Todo",
        "description": "Example",
        "completed": false,
        "created_at": "2026-01-23T16:30:46Z",
        "updated_at": "2026-01-23T16:30:46Z"
      }
    ],
    "pagination": {
      "limit": 20,
      "offset": 0,
      "total": 1
    }
  }
}

Get single todo:

{
  "message": "Todo retrieved successfully",
  "data": {
    "id": 1,
    "title": "Test Todo",
    "description": "Example",
    "completed": false,
    "created_at": "2026-01-23T16:30:46Z",
    "updated_at": "2026-01-23T16:30:46Z"
  }
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published