An ASP.NET Core MVC application demonstrating multiple approaches to implementing a modern, maintainable CRUD (Create, Read, Update, Delete) user interface. This repository is designed as a reference and educational resource for developers interested in best practices for web application architecture, theming, API design, and deployment.
- Windows IIS VM (.NET 9): samplecrud.markhazleton.com
- Azure App Service (.NET 9, Linux, GitHub Actions): mwhsampleweb.azurewebsites.net
- Azure App Service (Docker Image): samplecrud.azurewebsites.net
- Docker Hub Image: markhazleton/mwhsampleweb
- Demonstrate multiple ways to build CRUD UIs in ASP.NET Core MVC
- Showcase best practices for architecture, testing, and deployment
- Provide a reference for theming, API design, and modern web techniques
- Enable easy customization and extension for your own projects
- Multiple CRUD Implementations:
- Classic MVC Controllers & Views
- Razor Pages
- Single Page (JavaScript-driven) UI
- Pivot Table integration (PivotTable.js)
- API-First Design:
- RESTful endpoints for Employees and Departments
- Swagger/OpenAPI documentation (API Docs)
- Modern UI/UX:
- Responsive Bootstrap 5 layout
- WebSpark.Bootswatch theme switcher (light/dark, instant theme change)
- Bootstrap Icons
- DataTables integration for advanced tables
- Security & Configuration:
- Azure Key Vault integration for secrets
- App Insights telemetry
- Health checks endpoint (
/health
)
- DevOps & CI/CD:
- GitHub Actions for build, test, Docker, and Azure deployment
- Azure DevOps pipeline example
- Dockerfile for containerized builds
- Testing:
- Unit tests for domain and repository layers
- Extensible Architecture:
- Clean separation of Domain, Repository, and Web projects
- Dependency Injection throughout
- Example HttpClientFactory usage
This app features a dynamic theme switcher using WebSpark.Bootswatch:
- Instantly change the site's look with any Bootswatch theme
- Light/dark mode support
- User preferences are saved in the browser
- Implemented via
<bootswatch-theme-switcher />
tag helper and JavaScript
- .NET 9 SDK
- (Optional) Docker
# Clone the repository
git clone https://github.com/markhazleton/SampleMvcCRUD.git
cd SampleMvcCRUD
# Restore and run the web app
dotnet restore
cd Mwh.Sample.Web
dotnet run
Visit https://localhost:5001 in your browser.
docker build -t mwhsampleweb ./Mwh.Sample.Web
docker run -p 8080:80 mwhsampleweb
Mwh.Sample.Web/
- Main ASP.NET Core MVC web appMwh.Sample.Domain/
- Domain models and interfacesMwh.Sample.Repository/
- Data access and repository patternMwh.Sample.HttpClientFactory/
- HttpClient usage examplesSampleMinimalApi/
- Minimal API exampleMwh.Sample.Domain.Tests/
,Mwh.Sample.Repository.Tests/
- Unit tests
- MVC, Razor Pages, and SPA patterns in one solution
- API-first development with Swagger/OpenAPI
- Modern Bootstrap theming and instant theme switching
- Azure Key Vault for secure configuration
- Health checks and Application Insights
- CI/CD with GitHub Actions and Azure DevOps
- Docker containerization
- Extensible, testable architecture
SampleMvcCRUD is open source and welcomes contributions!
- Issues: File an issue
- Pull Requests: Fork, branch, and submit your improvements
- Documentation: Help improve this README or add more docs
- Feature Ideas: React/Vue/Mobile UI contributions are welcome
See CONTRIBUTING.md and CODE_OF_CONDUCT.md.
Mark Hazleton is a solutions architect and lifelong learner with a passion for building technology that delivers real business value. With extensive experience in both on-premises and cloud-based solutions, Mark has worked with organizations of all sizesβfrom small business websites to large enterprise projects. He is dedicated to pragmatic, outcome-focused software development, and is an advocate for clear communication, agile practices, and continuous learning.
For all questions, contributions, and support, please use the GitHub repository issues and pull requests. Community participation is welcome and encouraged!
Thanks to the open source community, teachers, and developers who share their knowledge and code.
Copyright 2018-2025 Mark Hazleton
Code released under the MIT License. See LICENSE.