Where can I find samples of full ASP.NET MVC projects?
This is one question I'm constantly asked by developers new to MVC. In this post, I show some sites with sample projects so you can "build by example."
I get commissions for purchases made through links in this post.
Even though today is a short post, I feel it's definitely an important one because of the number of questions I see asked in forums and Q/A sites (Quora, StackOverflow, etc).
As a beginner, you always want to see how applications are built so you can gain the knowledge and build your own project from scratch one day.
When ASP.NET MVC first appeared, most developers didn't have the luxury of sample projects.
Some had the school of hard-knocks of learning things the hard way (guilty!)
Fast forward nine years later (wow!), there are a number of solid ASP.NET MVC sample applications out there for everyone to learn how to code an ASP.NET MVC sample project.
The Obvious Site
For ASP.NET MVC sample projects, the obvious place to look is Microsoft.
As the creators of ASP.NET MVC, they understand new developers need examples to understand new concepts.
Two projects that stand out in my mind are:
This tutorial application is an ASP.NET MVC Sample Project, but it's a little dated. It's MVC 3, but it still provides the foundations for learning MVC.
There is a tutorial PDF, Source Code, and you have to download the Visual Web Developer 2010 Express edition (VWD 20010 EE).
If you can't get the VWD 2010 EE, you could probably use Visual Studio Code or the latest edition of Visual Studio 2015 Community Edition (Both available at http://www.visualstudio.com/).
This ASP.NET MVC Sample Application is an "open-source project that help nerds and computer people plan get-togethers."
While it is a little dated (MVC 3), it still holds as a solid tutorial for the community.
It uses MVC3, Entity Framework (Code First), Razor, jQuery Mobile for responsive design, Twitter and Facebook integration, and Geolocation just to name a few.
I would say that just about every MVC user has, at some point, used some techniques from this project in their own MVC projects (guilty!)
Other Sample Projects
Those were the two legendary projects that I've known about for five years.
This one ASP.NET MVC sample application below is new to me. I've never heard of it, but they are just as good as the two above.
It introduces new developers to how a sample ASP.NET MVC project is built.
The last one is a great tutorial by Stephen Walther.
This ASP.NET MVC Sample Application is meant to show what an N-Tier architecture project looks like in an MVC application.
It uses .NET 4.5, Entity Framework, Security using Forms Authentication, tinyMCE as the WYSIWYG Editor, and the HTML Agility Pack for sanitizing HTML.
It also adheres to SOLID principles and uses jQuery along with ASP.NET MVC Awesome for the Web UI.
Stephen Walther (@) has always provided solid training material and this tutorial is definitely one of his best.
He provides a walk-through for the reader to create their very own movie database.
This tutorial provides code along with screenshots on building a complete ASP.NET MVC application.
This sample application is small, quick, and fast...just enough to get the reader's appetite wet to start developing their own MVC projects.
(UPDATE: 2018-Apr-18) - Contoso University
This project is based on the ASP.NET Core docs and contains smaller applications/concepts to use in your own projects.
As with most of these projects, this is strictly meant for tutorial purposes.
As a sidenote, Jimmy Bogard took this project and refactored it into his image of the project if reworked.
(UPDATE: 2018-Aug-27) - .NET Application Architecture
For those new to .NET and want to dig into sample code immediately, Microsoft has a number of sample architecture applications using .NET.
There are six categories to explore and every category has sample code varying from Microservices and Docker to building Xamarin apps and writing ASP.NET MVC websites.
It's a treasure trove of real-world coding examples.
(UPDATE: 2018-Oct-08) - Practical ASP.NET Core 2.1 Fundamentals
While these aren't "full" projects, they are projects nonetheless.
This resource is great for beginners to understand how Core 2.1 works. Example projects cover everything from SignalR to EF to routing and building and using Middleware.
The projects are meant to simply expose the fundamentals of what Core 2.1 has to offer.
(UPDATE: 2020-Dec-29) - Jason Taylor's Clean Architecture Solution
Even though it's not an ASP.NET MVC, it's a great solution to examine for a solid SPA (Single Page Application) with ASP.NET Core while following the principles of Clean Architecture.
Any Other Projects?
For the new developer, it makes sense to examine existing projects and try to understand the underpinnings of how it all works. While that one method works for some, it may not work for others.
Looking at examples will speed up the learning process, but it won't teach you how they came to that outcome in the code.
Eventually, there will come a time where it makes more sense to learn the basics instead of looking at code you didn't write.
If you are stuck and you don't understand a piece of MVC code, I would recommend learning more about that particular topic.
I would recommend you head over to any one of these sites for some ASP.NET MVC training:
Once you have the basics, THEN head over and view some sample code to see what other developers wrote.
While I can't think of anymore projects off the top of my head, I'm sure there are a lot of ASP.NET MVC sample applications out there.
If you are an independent developer and have a complete ASP.NET MVC sample application, post a comment below and I will add it to the list above.
I hope these projects help you in your efforts to learn how to code.
It's almost becoming a requirement in the workforce.
Remember, post your open-source full projects below in the comments and I'll add them to the list.