https://github.com/rizingstar/measurementhub
A sample C# project demonstrating Clean Architecture and CQRS patterns with Blazor and Entity Framework Core.
https://github.com/rizingstar/measurementhub
blazor clean-architecture cqrs csharp efcore restful-api
Last synced: 2 months ago
JSON representation
A sample C# project demonstrating Clean Architecture and CQRS patterns with Blazor and Entity Framework Core.
- Host: GitHub
- URL: https://github.com/rizingstar/measurementhub
- Owner: rizingstar
- License: mit
- Created: 2025-05-25T23:31:28.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-06-02T05:09:38.000Z (about 1 year ago)
- Last Synced: 2025-06-02T10:38:37.870Z (about 1 year ago)
- Topics: blazor, clean-architecture, cqrs, csharp, efcore, restful-api
- Language: C#
- Homepage:
- Size: 237 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# π MeasurementHub, ASP.NET Core C# CQRS REST API MediatR Clean Architecture
**MeasurementHub** is a modular, full-stack demo application built using **ASP.NET Core**, **Blazor WebAssembly**, **Entity Framework Core**, and **Clean Architecture** principles with **CQRS** pattern and **MediatR** integration.
**π MeasurementHub **
**A real-world .NET reference for building, learning, and selling your expertiseβMeasurementHub helps you ship enterprise-grade software faster and smarter.**
MeasurementHub is more than just a demoβit's a modular, production-style blueprint engineered for developers and teams who want to build scalable, maintainable, and interview-ready solutions on todayβs .NET stack.
**Why MeasurementHub?**
Accelerate your learning and project delivery with a battle-tested architecture inspired by real-world enterprise scenarios (think Fortune 500s). Whether youβre preparing for interviews, onboarding to a new team, or looking for proven patterns to implement at work, MeasurementHub empowers you to build with confidence and modern best practices.
**π Key Features & Benefits**
**Clean Architecture**
Robust, enterprise-proven separation of concerns to keep your codebase maintainable as it grows.
**CQRS + MediatR**
Leverage command/query segregation and MediatR pipelines to deliver true decoupling and testability.
**RESTful ASP.NET Core Web API**
Build scalable backend services, ready for integration and extension.
**Modern UI with Blazor WebAssembly**
Deliver rich client experiences with a modern SPA frontend (showcasing Telerik UI, trial version included).
**Plug-and-Play Data Layer**
Use Entity Framework Core with an in-memory database for rapid prototyping and automated testing.
**Swagger/OpenAPI**
Out-of-the-box interactive API documentation makes onboarding and integration a breeze.
**Professional Project Structure**
Organized src/ and tests/ directories modeled after enterprise codebases for real-world maintainability.
**Who Is This For?**
**.NET Developers:**
Looking for a reference app with proven patterns.
**Engineering Teams:**
Onboarding new team members or standardizing best practices.
J**ob Seekers:**
Preparing for interviews or building a portfolio project that stands out.
**Enterprise Architects:**
Evaluating modular approaches for greenfield or brownfield projects.
---
## ποΈ Project Structure
MeasurementHub/
βββ src/
β βββ MeasurementHub.Api/ # ASP.NET Core Web API (Controllers + DI)
β βββ MeasurementHub.Application/ # Application layer (CQRS Handlers, DTOs)
β βββ MeasurementHub.Domain/ # Core domain models and interfaces
β βββ MeasurementHub.Infrastructure/# Infra services (logging, email, etc.)
β βββ MeasurementHub.Persistence/ # EF Core DbContext & Repository
β βββ MeasurementHub.Client/ # Blazor WASM UI using TelerikGrid
βββ README.md
---
## π§° Tech Stack
| Layer | Tech Used |
|------------------|-----------------------------------------|
| UI Frontend | Blazor WebAssembly + Telerik UI |
| API Backend | ASP.NET Core 8 |
| Data Access | Entity Framework Core (InMemory + SQL) |
| Architecture | Clean Architecture + CQRS |
| Mediator | MediatR |
| API Docs | Swashbuckle / Swagger |
| DI & Config | .NET built-in Dependency Injection |
---
## πΈ Screenshots
> _(Coming Soon)_ Blazor UI with live API integration and grid-based data listing.
---
## π§ Getting Started
### β
Prerequisites
- [.NET 8 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
- Visual Studio 2022+ with Blazor/WebAssembly workload
- (Optional) Telerik UI Trial Key (if using premium components)
### π οΈ Setup Instructions
1. **Clone the repository**
``bash
git clone https://github.com/rizingstar/MeasurementHub.git
cd MeasurementHub/src
---
| Method | Endpoint | Description |
| ------ | ------------------------ | ---------------------- |
| GET | `/api/measurements` | Get all measurements |
| GET | `/api/measurements/{id}` | Get measurement by ID |
| POST | `/api/measurements` | Create new measurement |
| PUT | `/api/measurements/{id}` | Update measurement |
| DELETE | `/api/measurements/{id}` | Delete measurement |
---
π‘ Learnings & Design Choices
Implemented CQRS pattern using IRequestHandler for command/query segregation.
Used Clean Architecture to enforce layer separation:
Domain: Business rules
Application: Use-cases, handlers
Infrastructure: EF Core logic
API: Only orchestration via Controllers + MediatR
Dependency Injection ensures testability and decoupling.
Blazor WASM acts as lightweight SPA frontend, consuming REST API.
---
π¨βπ» Author
Noman Khan
.NET Full Stack Developer | Clean Architecture Advocate | Houston, TX
LinkedIn Profile (https://www.linkedin.com/in/Nomanakhan/)
---
π License
This project is licensed under the MIT License.
---