{"id":28445396,"url":"https://github.com/suptarr/todo","last_synced_at":"2026-05-06T08:37:03.866Z","repository":{"id":215910716,"uuid":"739992011","full_name":"SupTarr/todo","owner":"SupTarr","description":"This is a simple Todo list API built with Go, Gin, GORM, and MariaDB.","archived":false,"fork":false,"pushed_at":"2025-05-05T04:00:16.000Z","size":10769,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-29T22:37:31.685Z","etag":null,"topics":["gin-gonic","golang","gorm","mariadb"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SupTarr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-01-07T07:10:08.000Z","updated_at":"2025-05-05T04:00:20.000Z","dependencies_parsed_at":"2025-05-05T04:38:32.223Z","dependency_job_id":null,"html_url":"https://github.com/SupTarr/todo","commit_stats":null,"previous_names":["suptarr/todo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SupTarr/todo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SupTarr%2Ftodo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SupTarr%2Ftodo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SupTarr%2Ftodo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SupTarr%2Ftodo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SupTarr","download_url":"https://codeload.github.com/SupTarr/todo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SupTarr%2Ftodo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32685072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T08:33:17.875Z","status":"ssl_error","status_checked_at":"2026-05-06T08:33:17.221Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gin-gonic","golang","gorm","mariadb"],"created_at":"2025-06-06T10:12:52.520Z","updated_at":"2026-05-06T08:37:03.861Z","avatar_url":"https://github.com/SupTarr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Todo API\n\nThis is a simple Todo list API built with Go, Gin, GORM, and MariaDB. It demonstrates basic CRUD operations, authentication, and deployment using Docker that I have learned from [Skooldio](https://www.skooldio.com/courses/developing-robust-api-services-with-go)\n\n## Features\n\n* Create, Read, and Delete Todos\n* JWT-based authentication for protected endpoints\n* Rate limiting on specific endpoints\n* Health checks (`/healthz`)\n* Graceful shutdown\n* Dockerized setup using Docker Compose\n\n## Getting Started\n\n### Prerequisites\n\n* [Go](https://golang.org/doc/install) (version 1.18 or later recommended)\n* [Docker](https://docs.docker.com/get-docker/)\n* [Docker Compose](https://docs.docker.com/compose/install/)\n* [Make](https://www.gnu.org/software/make/) (optional, for using Makefile commands)\n\n### Installation\n\n1. **Clone the repository:**\n\n    ```bash\n    git clone \u003crepository-url\u003e\n    cd todo\n    ```\n\n2. **Create environment file:**\nCopy the example environment variables:\n\n    ```bash\n    cp local.env.example local.env\n    ```\n\n*Note: You might need to create `local.env.example` based on your `local.env` file.*\nUpdate `local.env` with your desired settings, especially the `SIGN` key for JWT.\n\n### Running the Application\n\n#### Option 1: Using Docker Compose (Recommended)\n\nThis method starts both the API and the MariaDB database in containers.\n\n1. **Build and run the services:**\n\n```bash\ndocker-compose up --build\n```\n\nThe API will be available at `http://localhost:8081`.\n\n#### Option 2: Running Locally (Requires MariaDB Running Separately)\n\n1. **Start MariaDB:**\nYou can use the provided Makefile target to start a MariaDB container:\n\n    ```bash\n    make maria\n    ```\n\n    *Ensure port 3306 is free or modify the port mapping in the `Makefile`.*\n\n2. **Build the Application:**\n\n    ```bash\n    make build\n    ```\n\n3. **Run the Application:**\n\n    ```bash\n    make run\n    ```\n\n    The API will be available at `http://localhost:8081`.\n\n## API Endpoints\n\n* `GET /healthz`: Health check endpoint. Returns `200 OK`.\n* `GET /pingz`: Simple ping endpoint. Returns `{\"message\": \"pong\"}`.\n* `GET /limitz`: Rate-limited endpoint.\n* `GET /x`: Returns build information (`{\"buildcommit\": \"...\", \"buildtime\": \"...\"}`).\n* `GET /tokenz`: Generates a JWT token for accessing protected routes.\n* **Protected Routes (require `Authorization: Bearer \u003ctoken\u003e` header):**\n* `POST /todos`: Create a new todo. Request body: `{\"text\": \"Your todo text\"}`.\n* `GET /todos`: Get all todos.\n* `DELETE /todos/:id`: Delete a todo by its ID.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuptarr%2Ftodo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuptarr%2Ftodo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuptarr%2Ftodo/lists"}