Introduction
In this article you can see the explanation of standard level application architecture using MVC, WebApi, HTML, and Angularjs. I have already created an application architecture by following the layer standard, Mvc standard, and business-level architecture. If you are going to create MVC, Web api, and Angularjs, this is best way to create application architecture.
Nowadays I think each developer has a good experience in web applications, mvc applications, web services, web api and front end development using angularjs which is already well maintained by other architecture, layers, or we can say already configured by somebody. But once they have a need to create a new application by following standard level architecture, they will go silent and confuse how to create application architecture. Also I faced this type of confusion in my life, but nowadays I am giving you a good explanation to create standard level application architecture using MVC, web api, angularjs, and html.
I am just giving you some important links to understand basic points which are used in this type of application.
- What is Mvc?
- Mvc Explantion with example
- Web Api with example
- Simple Example based on rest
- Rest features in web api 2
- Basics of Angularjs
- Angularjs with Example
- Api testing by swagger
- Log4net use to create log file.
- owin authentication to authenticate use
- Identity in mvc with web api.
Important points
If you're going to create good and well-structured applications using layer architecture in mvc, you need to remember some points which are given below,
If you're going to create good and well-structured applications using layer architecture in mvc, you need to remember some points which are given below,
- Use 3-layer architecture.
- Try to use 3-Tier architecture at production server.
- Use Exception logging,create a log file on each exception.
- Use owin authentication with identity.
- Use unit testing,create unit testing.
- Implement swagger for testing with mvc web api.
I am showing an image which is more helpful to understand the architecture of good applications. In this I am trying to explain how to implement application flow at run time.


According to this image I have created an application which is following these architectures, I am explaining their use one by one. I am showing an image which represents real time application architecture and explaining each one by one.
In this project I have configured 7 projects which are separate from one another.
- Application layer (Presentation Layer)
In this layer I have created only HTML pages and consumed the web api by Angularjs. In this consuming web api and using angularjs ,get and post data in JSON format, see the image which is given below to understand what is the use of this part.
In this layer you can create HTML pages and angular services, controller,etc. On index page we can inject all .js,angular,bootstrap,css, because by default this page will be open. - MVC Web Api Layer(Api)
In this layer we can create api controller to use provider layer which is returning model value .Also in this layer we are implementing logging part using Log4net exception logger.see image.
Owin authentication is used to provide authentication part in level. On each request of each controller always check if token is valid or not. End point of web api is consumed by angularjs on front end. - provider Layer (Business logic layer)
This layer is mainly use to create a interface between Api and DAL(repository). Due to security reasons we are not interacting with DiAL directly.
In this layer we can create interface and BAL (classes ) which can be used to call DAL; see image. This layer you can create classes and interfaces and call interfaces on api controller. - Repository layer (Data access layer)
In this layer you will create .Edmx file,you can access the database directly by using entity framework.You can chose as per your database code first approach, data base first approach or model first approach. Now I am using database first approach because my database is already created and mapped with each other's table; see image.
You can see in this image I have used .edmx file and created classes to work with entity (CRUD). - Utility
In this class library we can create some common function, enum, constant variable, readonly etc..see image...
You can see in this image I have created commonhelper class and constant class, so you can use it to create any common variable etc... - Model
This class library is mainly used to create classes which can contain C# properties like field name; see image.
According this image you can see I have created classes which contain the C# property like {get;set;}. - ApplicationUnitTest (Unit tesing)
This is a very important part of any application if we want to develop well structured applications. In this you can create test methods and test your web api; see image.....
In this image you can see I have created a ***Application class to create test method to test web api.
Advantage of good architecture based applications
- Loosely coupled binding of classes.
- No dependency on each other; not class dependent on any other
- Security level authentication provides token based security in web api.
- Reusability of code -- you can use BAL and DAL in other projects as well.
- Provide leverage integration of code.
- Easy to leverage to create test method (unit testing)
- Easy to understand code for anyone,
- Maintenance of application is very easy.
- Alter update some new functionality is easy for anyone .
- Increase the performance of the application as compared to simple, normal architecture.

Saeed SohagPosted Apr 30, 2019, 5:05 AM
Bukachuda you should upload demo project.
Prafulla SahuPosted Apr 10, 2019, 1:00 PM
A sample project would be a great help
Sajid HussainPosted Feb 13, 2019, 10:45 AM
Can you provide this sample project?
Sundaram SubramanianPosted Oct 23, 2018, 12:58 PM
Good to Know and got my answer here. Thanks
Mukesh DepaniPosted Feb 15, 2018, 10:57 PM
Nice article Bikesh, Could you please share the sample code ? Thanks.
varsha NarwadePosted Aug 21, 2017, 2:52 AM
Nice article. just one doubt how did you managed owin authentication using various layers. Please provide code sample.
Shrikant KamblePosted Jul 20, 2017, 9:47 AM
Nice article Bikesh, If possible provide a sample app. Thanks
Bikesh SrivastavaPosted Dec 2, 2016, 3:59 AM
Thanks Everyone,yes sure i'll provide you venkat ramana
venkat ramanaPosted Dec 2, 2016, 3:22 AM
Very nice article.If possible could you please provide a sample application code it will be more helpful to us.
Manas MohapatraPosted Nov 13, 2016, 2:03 PM
Very informative article..
Bikesh SrivastavaPosted Sep 26, 2016, 9:59 AM
In this i haven't use code ,because its only application architecture.it will help you all to make a standard level application architecture .
shaik gousePosted Sep 26, 2016, 9:34 AM
Can we have a downloadable code of this article please?
Manav PandyaPosted Sep 15, 2016, 10:11 AM
Got my answer sir Thanks Bikesh Srivastava
Bikesh SrivastavaPosted Sep 15, 2016, 8:46 AM
No you can see in image one is application,this will run first.and page will run according route.config file.
Manav PandyaPosted Sep 15, 2016, 6:14 AM
Thank you sir Subash
Manav PandyaPosted Sep 15, 2016, 6:03 AM
I have same project structured demo as you have showed above , but which project run first , how can we decide
Bikesh SrivastavaPosted Sep 15, 2016, 1:35 AM
Tell me about confusion Manav Pandya
Manav PandyaPosted Sep 14, 2016, 10:12 AM
For beginner its great thing to know , but im bit confused too .
Bikesh SrivastavaPosted Sep 14, 2016, 6:05 AM
Defiantly Nitu Sharma,,Wait for next article .
Bikesh SrivastavaPosted Sep 14, 2016, 6:02 AM
Yes Nitu Sharma,Thanks
Coder TutorialPosted Sep 14, 2016, 6:02 AM
Please also post an article on how to do Unit testing in MVC architecture project
Coder TutorialPosted Sep 14, 2016, 6:01 AM
Awesome, i am about to start developing a new project and this article will help me alot.
Rupesh KahanePosted Sep 14, 2016, 1:36 AM
Good one..
Bikesh SrivastavaPosted Sep 14, 2016, 1:13 AM
Yes defiantly Subash,Wait for next article
SubashPosted Sep 14, 2016, 12:22 AM
Can you give this for windows application too?
SubashPosted Sep 14, 2016, 12:22 AM
Nice article thanks for give this