A RESTful API built with .NET 8, demonstrating Domain-Driven Design (DDD) and Clean Architecture principles. This API supports Create, Read, Update, and Delete (CRUD) operations for managing dinner entities.
This project follows a DDD and Clean Architecture approach, ensuring a modular, maintainable, and scalable application structure. The key components include:
- BuberDinner.Api – Handles HTTP requests and responses.
- BuberDinner.Application – Contains business logic, commands, and queries.
- BuberDinner.Domain – Encapsulates core domain entities and logic.
- BuberDinner.Infrastructure – Manages database access and external integrations.
- BuberDinner.Contracts – Defines DTOs and contracts shared across layers.
The API layer acts as the entry point for handling client requests and forwarding them to the application layer.
Contains the core application logic, implementing CQRS (Command and Query Responsibility Segregation) principles to separate read and write operations.
Defines the domain entities, aggregates, value objects, and business rules that are at the heart of the application.
Manages external concerns such as database access (via Entity Framework Core), authentication, and integrations with external services.
Holds the DTOs (Data Transfer Objects) and contracts that ensure consistent communication between different layers and external consumers.
- .NET 8.0 installed on your system.
-
Clone the repository:
git clone https://github.com/enesmetek/ddd-cleanarchitecture-restapi.git
-
Navigate into the project directory:
cd ddd-cleanarchitecture-restapi -
Build the solution:
dotnet build
-
Run the application:
dotnet run --project BuberDinner.Api
The API will be accessible at
https://localhost:5001by default.
Below are the available endpoints in BuberDinner.API:
| HTTP Method | Endpoint | Description |
|---|---|---|
GET |
/api/dinners |
Get all dinners |
GET |
/api/dinners/{id} |
Get a specific dinner |
POST |
/api/dinners |
Create a new dinner |
PUT |
/api/dinners/{id} |
Update an existing dinner |
DELETE |
/api/dinners/{id} |
Delete a dinner |
This project is licensed under the MIT License.
Contributions are welcome! Feel free to submit a pull request or open an issue.
For any questions or issues, please reach out via GitHub Issues or email me at [[email protected]].
If you found this project useful, consider giving it a star on GitHub! 😊