A modern, high-performance CQRS (Command Query Responsibility Segregation) API built with .NET 9, featuring reactive programming patterns and clean architecture principles.
- CQRS Pattern: Clear separation between commands (write operations) and queries (read operations)
- Reactive Programming: Built with System.Reactive for efficient event handling
- Clean Architecture: Well-structured layers with dependency injection
- In-Memory Repository: Fast development and testing with in-memory data storage
- OpenAPI Support: Auto-generated API documentation
- Docker Support: Containerized deployment ready
- Comprehensive Testing: Full test coverage with unit tests
The project follows CQRS pattern with the following structure:
Turbo.API/
โโโ Commands/          # Write operations (Create, Update, Delete)
โโโ Queries/           # Read operations (Get, GetAll)
โโโ Controllers/       # API endpoints
โโโ Models/            # Domain entities
โโโ DTOs/              # Data Transfer Objects
โโโ Repositories/      # Data access layer
โโโ Mediation/         # Command/Query handlers
โโโ Tests/             # Unit tests
- .NET 9: Latest .NET framework
- ASP.NET Core: Web API framework
- MediatR: Mediator pattern implementation
- System.Reactive: Reactive programming support
- OpenAPI: API documentation
- Docker: Containerization
- .NET 9 SDK
- Docker (optional, for containerized deployment)
- Your favorite IDE (Visual Studio, VS Code, Rider)
git clone <repository-url>
cd Turbocd Turbo.API
dotnet restore
dotnet rundocker-compose up --build- API Base URL: https://localhost:7001(orhttp://localhost:5001)
- OpenAPI Documentation: https://localhost:7001/openapi(in development)
POST /api/users
Content-Type: application/json
{
  "name": "John Doe",
  "email": "[email protected]"
}GET /api/users/{id}GET /api/users/email/{email}GET /api/usersPUT /api/users/{id}
Content-Type: application/json
{
  "name": "John Updated",
  "email": "[email protected]"
}DELETE /api/users/{id}Run the test suite:
cd Turbo.API.Tests
dotnet test- CreateUserCommand: Creates a new user
- UpdateUserCommand: Updates an existing user
- DeleteUserCommand: Deletes a user
- GetUserByIdQuery: Retrieves a user by ID
- GetUserByEmailQuery: Retrieves a user by email
- GetAllUsersQuery: Retrieves all users
- User: Domain entity representing a user
- UserDto: Data transfer object for user operations
- UserResponse: Response model for user operations
- UsersResponse: Response model for multiple users
The application uses standard ASP.NET Core configuration:
- appsettings.json: Production settings
- appsettings.Development.json: Development settings
The project includes Docker support with:
- Dockerfile: Multi-stage build for optimized container
- compose.yaml: Docker Compose configuration
- .dockerignore: Excludes unnecessary files from build context
- Fork the repository
- Create a feature branch (git checkout -b feature/amazing-feature)
- Commit your changes (git commit -m 'Add some amazing feature')
- Push to the branch (git push origin feature/amazing-feature)
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Contact the maintainers
- Database integration (Entity Framework Core)
- Event sourcing implementation
- Message queue integration
- Authentication and authorization
- API rate limiting
- Caching layer
- Performance monitoring
Built with โค๏ธ using .NET 9 and CQRS patterns