Get Started in Minutes
This guide will help you quickly set up and run the Hybrid DDD Architecture template. You’ll have a working REST API with Swagger documentation running locally.Prerequisites: Make sure you have .NET 8 SDK installed. Download it here if needed.
Quick Setup
Configure database connection
The template supports multiple databases. Choose your preferred option in
Template-API/appsettings.json:The
UseDatabase setting accepts: "sqlserver", "mysql", "mariadb", or "mongodb"Run database migrations (SQL databases only)
If using SQL Server, MySQL, or MariaDB, create the initial database migration:
The application automatically applies migrations on startup, so you don’t need to run
dotnet ef database update manually.Test with Swagger
Open your browser and navigate to:You’ll see the Hybrid Architecture Project v1 Swagger UI with the
DummyEntity endpoints:GET /api/v1/DummyEntity- Get all entities with paginationGET /api/v1/DummyEntity/{id}- Get entity by IDPOST /api/v1/DummyEntity- Create new entityPUT /api/v1/DummyEntity- Update existing entityDELETE /api/v1/DummyEntity/{id}- Delete entity
What You Just Did
Congratulations! You now have:A running .NET 8 REST API with Swagger documentation
Database configured (SQL Server or MongoDB)
CQRS pattern with command and query bus
Domain entities with FluentValidation
Repository pattern with your chosen database
Exception handling and standardized API responses
Exploring the Example Implementation
The template includes a completeDummyEntity implementation to demonstrate all patterns:
Domain Entity
Location:Domain/Entities/DummyEntity.cs
Command Example
Location:Application/UseCases/DummyEntity/Commands/CreateDummyEntity/CreateDummyEntityCommand.cs
Controller Example
Location:Template-API/Controllers/DummyEntityController.cs
Next Steps
Now that you have the template running, here’s what to explore next:Architecture Overview
Understand the layers and design patterns
Creating Entities
Add your first domain entity
Database Setup
Configure different database providers
Event Bus
Set up RabbitMQ for event-driven communication
Troubleshooting
Database connection errors with SQL Server
Database connection errors with SQL Server
If using LocalDB and getting connection errors:
- Verify SQL Server LocalDB is installed:
sqllocaldb info - Start LocalDB if needed:
sqllocaldb start MSSQLLocalDB - Check the connection string in
appsettings.json
Migration errors
Migration errors
If Entity Framework migrations fail:
- Ensure you’re in the solution directory
- Check that the
--projectand--startup-projectpaths are correct - Verify the database connection string is valid
- Delete the
Migrationsfolder and try creating a new migration
Port already in use
Port already in use
If ports 5000 or 5001 are already in use, you can change them in
Template-API/Properties/launchSettings.json or run with a custom URL:Swagger not appearing
Swagger not appearing
Swagger is only enabled in Development mode. Ensure the
ASPNETCORE_ENVIRONMENT is set to Development:Getting Help
Community Support
Found a bug or have questions? Open an issue on GitHub