The backend for the "To Do List" application is built using ASP.NET Core (C#) and uses SQL Server as its database. It handles task management, including CRUD operations and deadline handling.
- Framework: ASP.NET Core (C#)
- Database: SQL Server (Entity Framework Core)
- .NET SDK (version 6.0 or above) - Download
- SQL Server (if running locally outside Docker) - Download
- Entity Framework CLI Tools (
dotnet-ef
) - Install by running:dotnet tool install --global dotnet-ef
-
Clone the project and navigate to the
backend
directory:cd backend
-
Ensure that you have a running SQL Server instance. You can adjust the connection string in
appsettings.json
to point to your local SQL Server. -
Apply the latest migrations to your database:
dotnet ef database update
-
Run the backend:
dotnet run
By default, the backend will run on the port 5000
.
The API is available at http://localhost:5000/api
.
-
GET
/tasks
- Retrieves all tasks.
-
GET
/tasks/{id}
- Retrieves a specific task by its ID.
-
POST
/tasks
- Creates a new task. Example request body:
{ "title": "New Task", "description": "Task details", "deadline": "2024-10-15T12:00:00" }
- Creates a new task. Example request body:
-
PUT
/tasks/{id}
- Updates an existing task by its ID. Example request body:
{ "title": "Updated Task", "description": "Updated details", "deadline": "2024-10-16T12:00:00" }
- Updates an existing task by its ID. Example request body:
-
PUT
/tasks/{id}/complete
- Toggles an existing task's "Completed" status by its ID (if current is true, turns to false, as well as the opposite).
-
DELETE
/tasks/{id}
- Deletes a task by its ID.