{"id":30758661,"url":"https://github.com/hobaama/to-do-list-web-api","last_synced_at":"2026-05-14T23:13:52.654Z","repository":{"id":306679320,"uuid":"1026922551","full_name":"HoBaaMa/To-Do-List-Web-API","owner":"HoBaaMa","description":"A RESTful ASP.NET Core Web API for managing to-do items, demonstrating CRUD operations, filtering by date, and JSON Patch support.","archived":false,"fork":false,"pushed_at":"2025-08-29T00:47:13.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-29T05:07:26.014Z","etag":null,"topics":["api","api-rest","api-restful","asp-net-core","aspnetcore","csharp","dotnet-core","dotnetcore","serilog","web-api","webapi"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HoBaaMa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2025-07-26T23:03:05.000Z","updated_at":"2025-08-29T00:47:16.000Z","dependencies_parsed_at":"2025-07-27T03:02:58.502Z","dependency_job_id":null,"html_url":"https://github.com/HoBaaMa/To-Do-List-Web-API","commit_stats":null,"previous_names":["hobaama/to-do-list-web-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HoBaaMa/To-Do-List-Web-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoBaaMa%2FTo-Do-List-Web-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoBaaMa%2FTo-Do-List-Web-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoBaaMa%2FTo-Do-List-Web-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoBaaMa%2FTo-Do-List-Web-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HoBaaMa","download_url":"https://codeload.github.com/HoBaaMa/To-Do-List-Web-API/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoBaaMa%2FTo-Do-List-Web-API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278692973,"owners_count":26029410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["api","api-rest","api-restful","asp-net-core","aspnetcore","csharp","dotnet-core","dotnetcore","serilog","web-api","webapi"],"created_at":"2025-09-04T11:08:15.046Z","updated_at":"2025-10-06T23:10:05.115Z","avatar_url":"https://github.com/HoBaaMa.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# 📝 To-Do List Web API\n\nA simple ASP.NET Core Web API for managing to-do items. This project demonstrates CRUD operations, filtering by date, and supports JSON Patch for partial updates.\n\n---\n\n## 📋 Table of Contents\n\n- [✨ Features](#-features)\n- [🧰 Technologies Used](#-technologies-used)\n- [🚀 Getting Started](#-getting-started)\n  - [🔧 Prerequisites](#-prerequisites)\n  - [⚙️ Setup](#setup)\n- [🌐 API Endpoints](#-api-endpoints)\n  - [📄 Example To-Do Item JSON](#-example-to-do-item-json)\n  - [🩹 JSON Patch Example](#-json-patch-example)\n- [🧱 Model](#-model)\n- [❗ Error Handling](#-error-handling)\n- [📦 Required NuGet Packages](#-required-nuget-packages)\n  - [🚀 Quick Install All](#-quick-install-all)\n- [📈 What's New](#-whats-new)\n  - [🆕 Version 1.2.0 – 29 July 2025](#-version-120--29-july-2025)\n  - [✅ Version 1.1.0 – 28 July 2025](#-version-110--28-july-2025)\n- [🪪 License](#-license)\n\n---\n\n## ✨ Features\n\n- Create, read, update, and delete to-do items\n- Filter to-do items by creation date\n- Partial updates using JSON Patch\n- Entity Framework Core with SQL Server\n- Serilog-based structured logging\n\n---\n\n## 🧰 Technologies Used\n\n![.NET 8](https://img.shields.io/badge/.NET%208-5C2D91?logo=dotnet\u0026logoColor=white\u0026style=for-the-badge)\n![ASP.NET Core](https://img.shields.io/badge/ASP.NET%20Core-512BD4?logo=dotnet\u0026logoColor=white\u0026style=for-the-badge)\n![EF Core](https://img.shields.io/badge/Entity%20Framework%20Core-6DB33F?logo=entity-framework\u0026logoColor=white\u0026style=for-the-badge)\n![SQL Server](https://img.shields.io/badge/SQL%20Server-CC2927?logo=microsoftsqlserver\u0026logoColor=white\u0026style=for-the-badge)\n![Swagger](https://img.shields.io/badge/Swagger-85EA2D?logo=swagger\u0026logoColor=black\u0026style=for-the-badge)\n![Postman](https://img.shields.io/badge/Postman-FF6C37?logo=postman\u0026logoColor=white\u0026style=for-the-badge)\n![Newtonsoft.Json](https://img.shields.io/badge/Newtonsoft.Json-000000?logo=json\u0026logoColor=white\u0026style=for-the-badge)\n![Serilog](https://img.shields.io/badge/Logging-Serilog-blueviolet?style=for-the-badge\u0026logo=serilog\u0026logoColor=white)\n\n---\n\n## 🚀 Getting Started\n\n### 🔧 Prerequisites\n\n- [.NET 8 SDK](https://dotnet.microsoft.com/download)\n- [SQL Server](https://www.microsoft.com/en-us/sql-server/sql-server-downloads)\n\n### ⚙️ Setup\n\n1. **Clone the repository:**\n\n   ```bash\n   git clone https://github.com/HoBaaMa/To-Do-List-Web-API.git\n   ```\n\n2. **Configure the database connection:**\n\n   Update the `DefaultConnection` string in `appsettings.json` with your SQL Server details.\n\n3. **Apply migrations:**\n\n   ```bash\n   dotnet ef database update\n   ```\n\n4. **Run the application:**\n\n   ```bash\n   dotnet run\n   ```\n\n5. **Access Swagger UI:**\n\n   Navigate to `https://localhost:{port}/swagger` in your browser.\n\n---\n\n## 🌐 API Endpoints\n\n| 🔠 Method | 🌐 Endpoint                | 📝 Description                        |\n|----------|----------------------------|--------------------------------------|\n| 🟢 GET   | `/api/todo`                | Get all to-do items                  |\n| 🔍 GET   | `/api/todo/{id}`           | Get a to-do item by ID               |\n| 📅 GET   | `/api/todo/date/{date}`    | Get to-do items by creation date     |\n| ➕ POST  | `/api/todo`                | Create a new to-do item              |\n| ♻️ PUT   | `/api/todo/{id}`           | Update an existing to-do item        |\n| 🩹 PATCH | `/api/todo/{id}`           | Partially update a to-do item        |\n| ❌ DELETE| `/api/todo/{id}`           | Delete a to-do item                  |\n\n---\n\n### 📄 Example To-Do Item JSON\n\n```json\n{\n  \"id\": 1,\n  \"title\": \"Sample To-Do Item\",\n  \"isCompleted\": false,\n  \"createdAt\": \"2023-10-01T12:00:00Z\",\n  \"completedAt\": \"2023-10-10T12:00:00Z\"\n}\n```\n\n---\n\n## 🩹 JSON Patch Example\n\n```json\n[\n  {\n    \"op\": \"replace\",\n    \"path\": \"/isCompleted\",\n    \"value\": true\n  },\n  {\n    \"op\": \"replace\",\n    \"path\": \"/completedAt\",\n    \"value\": \"2023-10-01T12:00:00Z\"\n  }\n]\n```\n\n---\n\n## 🧱 Model\n\n```csharp\npublic class TodoItem\n{\n    public int Id { get; set; }\n    public required string Title { get; set; }\n    public string? Description { get; set; }\n    public bool? IsCompleted { get; set; }\n    public DateTime CreatedAt { get; set; }\n    public DateTime? CompletedAt { get; set; }\n}\n```\n\n---\n\n## ❗ Error Handling\n\n- Returns `400 Bad Request` for invalid input or out-of-range IDs.\n- Returns `404 Not Found` if the item does not exist.\n\n---\n\n## 📦 Required NuGet Packages\n\n| 📦 Package Name                              | 📝 Description                             |\n|---------------------------------------------|--------------------------------------------|\n| 📂 Microsoft.EntityFrameworkCore             | Entity Framework Core ORM                  |\n| 🛢️ Microsoft.EntityFrameworkCore.SqlServer   | SQL Server provider for EF Core            |\n| 🛠️ Microsoft.EntityFrameworkCore.Tools       | EF Core CLI tools                          |\n| 🩹 Microsoft.AspNetCore.JsonPatch            | JSON Patch support                         |\n| 🧩 Microsoft.AspNetCore.Mvc.NewtonsoftJson   | Newtonsoft.Json support                    |\n| 📖 Swashbuckle.AspNetCore                    | Swagger / OpenAPI support                  |\n| 🧾 Serilog.AspNetCore                        | Serilog logging                            |\n| 📤 Serilog.Sinks.Console                     | Serilog console sink                       |\n| 📁 Serilog.Sinks.File                        | Serilog file sink                          |\n| ⚙️ Serilog.Settings.Configuration            | Serilog configuration from appsettings.json                     |\n\n\n### 🚀 Quick Install All\n\n```bash\ndotnet add package Microsoft.EntityFrameworkCore\ndotnet add package Microsoft.EntityFrameworkCore.SqlServer\ndotnet add package Microsoft.EntityFrameworkCore.Tools\ndotnet add package Microsoft.AspNetCore.JsonPatch\ndotnet add package Microsoft.AspNetCore.Mvc.NewtonsoftJson\ndotnet add package Swashbuckle.AspNetCore\ndotnet add package Serilog.AspNetCore\ndotnet add package Serilog.Sinks.Console\ndotnet add package Serilog.Sinks.File\n```\n\n---\n\n## 📈 What's New\n\n### 🆕 Version 1.2.0 – 29 July 2025\n\n- ✅ **Improved validation logic and code structure**\n  - ➕ Added `CompletedCreationDatesValidationAttribute.cs` and `CompletedStateValidationAttribute.cs` to enforce business rules between `IsCompleted` and `CompletedAt`.\n  - 🛠️ Updated `TodoItem.cs` to apply the new validation attributes and removed unnecessary usings.\n  - 🧹 Cleaned up `TodoRepository.cs` with better ID validation and cleaner code.\n  - 📝 Enhanced `README.md` with clearer API documentation.\n\n---\n\n### ✅ Version 1.1.0 – 28 July 2025\n\n- ✅ **Added logging with Serilog to Todo API**\n  - 🔧 Configured Serilog in `Program.cs` for structured logging to console and file.\n  - 📄 Installed and configured Serilog packages in `appsettings.json`.\n  - 💬 Integrated `ILogger` into `TodoController` for consistent logging.\n\n---\n\n## 🪪 License\n\nThis project is licensed under the [MIT License](LICENSE.txt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhobaama%2Fto-do-list-web-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhobaama%2Fto-do-list-web-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhobaama%2Fto-do-list-web-api/lists"}