Task[in] 2.0 is a productivity application backend built using ASP.NET Core Web API, following Clean Architecture principles. It provides RESTful APIs for managing projects, tasks, and Pomodoros, utilizing the Pomodoro Technique to enhance productivity.
- Features
- Architecture
- Technologies Used
- Project Structure
- Getting Started
- API Endpoints
- Database Migrations
- Contributing
- License
- Project Management: Create, read, update, and delete projects.
- Task Management: CRUD operations for tasks within projects.
- Pomodoro Management: Manage Pomodoros associated with tasks.
- CQRS and MediatR: Implements Command and Query patterns for separation of concerns.
- Entity Framework Core: Uses EF Core for data access with SQL Server.
- Clean Architecture: Ensures a maintainable and testable codebase.
The backend follows the Clean Architecture pattern, dividing the solution into four projects:
- ElGuerre.Taskin.Api: The presentation layer containing controllers.
- ElGuerre.Taskin.Application: Contains application logic, commands, queries, and handlers.
- ElGuerre.Taskin.Domain: Defines domain entities and interfaces.
- ElGuerre.Taskin.Infrastructure: Implements data access and persistence using Entity Framework Core.
- .NET 6 SDK
- ASP.NET Core Web API
- Entity Framework Core
- MediatR
- SQL Server
- Swagger (for API documentation)
ElGuerre.Taskin.sln
├── ElGuerre.Taskin.Api
│ ├── Controllers
│ ├── Program.cs
│ └── appsettings.json
├── ElGuerre.Taskin.Application
│ ├── Projects
│ ├── Tasks
│ └── Pomodoros
├── ElGuerre.Taskin.Domain
│ └── Entities
└── ElGuerre.Taskin.Infrastructure
├── EntityFramework
│ ├── TaskinDbContext.cs
│ └── Configurations
└── Migrations
- .NET 6 SDK: Download and install from Microsoft .NET.
- SQL Server: Install SQL Server or use SQL Server Express.
- Visual Studio 2022 or Visual Studio Code
-
Clone the Repository
git clone https://github.com/your-username/taskin-backend.git cd taskin-backend
-
Restore NuGet Packages
Open the solution in Visual Studio or use the command line:
dotnet restore
-
Configure Database Connection
Update the
appsettings.json
file inElGuerre.Taskin.Api
with your SQL Server connection string:{ "ConnectionStrings": { "DefaultConnection": "Server=your_server;Database=TaskinDB;Trusted_Connection=True;MultipleActiveResultSets=true" } }
-
Apply Database Migrations
Navigate to the
ElGuerre.Taskin.Api
directory and run:# Navigate to the Infrastructure project directory cd ElGuerre.Taskin.Infrastructure # Add a migration dotnet ef migrations add InitialCreate --startup-project ../ElGuerre.Taskin.Api # Update the database dotnet ef database update --startup-project ../ElGuerre.Taskin.Api
Ensure that the
ElGuerre.Taskin.Api
project is set as the startup project.
-
Start the API
In the
ElGuerre.Taskin.Api
project directory, run:dotnet run
The API will start and listen on
https://localhost:5001
by default. -
Test the API
Open a browser and navigate to
https://localhost:5001/swagger
to view the Swagger UI and test the endpoints.
- GET
/api/Projects
- Get a list of projects. - GET
/api/Projects/{id}
- Get a project by ID. - POST
/api/Projects
- Create a new project. - PUT
/api/Projects/{id}
- Update an existing project. - DELETE
/api/Projects/{id}
- Delete a project.
- GET
/api/Tasks?projectId={projectId}
- Get tasks by project ID. - GET
/api/Tasks/{id}
- Get a task by ID. - POST
/api/Tasks
- Create a new task. - PUT
/api/Tasks/{id}
- Update an existing task. - DELETE
/api/Tasks/{id}
- Delete a task.
- GET
/api/Pomodoros?taskId={taskId}
- Get pomodoros by task ID. - GET
/api/Pomodoros/{id}
- Get a pomodoro by ID. - POST
/api/Pomodoros
- Create a new pomodoro. - PUT
/api/Pomodoros/{id}
- Update an existing pomodoro. - DELETE
/api/Pomodoros/{id}
- Delete a pomodoro.
To manage database schema changes, use Entity Framework Core migrations.
dotnet ef migrations add #MIGRATION_NAME# --startup-project .\ElGuerre.Taskin.Api --project .\ElGuerre.Taskin.Infrastructure -o .\EntityFramework\Migrations
dotnet ef database update --startup-project .\ElGuerre.Taskin.Api\ElGuerre.Taskin.Api.csproj --project .\ElGuerre.Taskin.Infrastructure\
Contributions are welcome! Please follow these steps:
-
Fork the Repository
Click the "Fork" button at the top right of the repository page.
-
Create a Feature Branch
git checkout -b feature/YourFeature
-
Commit Your Changes
git commit -m "Add your message here"
-
Push to Your Fork
git push origin feature/YourFeature
-
Create a Pull Request
Open a pull request to the
main
branch of the original repository.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or support, please open an issue on the GitHub repository.
- ASP.NET Core: https://docs.microsoft.com/aspnet/core
- Entity Framework Core: https://docs.microsoft.com/ef/core
- MediatR: https://github.com/jbogard/MediatR
- Clean Architecture: https://github.com/jasontaylordev/CleanArchitecture
- Swagger: https://swagger.io/
Thank you for using Task[in] 2.0 Backend! We hope this tool helps you build efficient and scalable applications.