A modular and modern REST API built with .NET Core, Entity Framework Core, and PostgreSQL.
Designed to demonstrate clean architecture, code reusability, and production-grade patterns for real-world applications.
CWD API is a personal yet extensible project combining:
- 🗒 Notes
- ✅ Tasks
- 🔁 Habits
Each resource is handled through a generic service and repository architecture, providing:
- DRY (Don’t Repeat Yourself) principles
- Easy scalability
- Consistent CRUD operations
- Maintainability and flexibility
- .NET Core 8 API following RESTful standards
- Entity Framework Core + PostgreSQL for modern relational persistence
- Generic Repository & Service pattern to minimize boilerplate
- Automapper integration for clean DTO mapping
- Dependency Injection (DI) and Interface-based abstraction
- Swagger UI for documentation and live API testing
- Ready for deployment (Docker, Railway, Render, or Azure)
CWD.API/
├── Controllers/
│ ├── HabitController.cs
│ ├── NotesController.cs
│ └── TasksController.cs
├── Data/
│ └── ApiContext.cs
├── Dtos/
│ ├── HabitDto.cs
│ ├── NoteDto.cs
│ └── TaskDto.cs
├── Entities/
│ └── Habit.cs
│ └── Note.cs
│ └── TaskItem.cs
├── Migrations/
├── Services/
│ ├── GenericService.cs
│ ├── HabitService.cs
│ ├── NoteService.cs
│ ├── TaskService.cs
├── Repositories/
│ ├── GenericRepository.cs
│ ├── HabitRepository.cs
│ ├── NoteRepository.cs
│ ├── TaskRepository.cs
├── Program.cs
└── appsettings.json
Principles applied:
- Separation of Concerns (SoC)
- Single Responsibility Principle (SRP)
- Interface-driven design
- Testable and loosely coupled components
git clone https://github.com/Clemix37/cwd-api.git
cd cwd-apiEdit appsettings.json
"ConnectionStrings": {
"DefautlConnection": "",
}dotnet ef database updateGo to AutoMapper website and get a license.
You can add it on Program.cs:
[...]cfg.LicenseKey = "YOUR-LICENSE"dotnet runThe API will be available at http://localhost:500.
Swagger is integrated by default and available at: http://localhost:5000/swagger.
You can test every endpoint direclty from the UI.