How shware100/asp.net-mvc-webcrm-demo-app works
Main Components
• Frontend / Client Side:
• Views: The “Views” folder contains Razor views (cshtml pages) for different controllers (Account, ActivityHistories, Companies, Contacts, Home, Manage, and Shared layouts) that build the user interface.
• Scripts & Content: The “Scripts” folder includes jQuery, Bootstrap, and other JS libraries, while “Content” provides CSS (including Bootstrap, DataTables, fullcalendar, etc.) and images. These support styling, responsive design, and dynamic client behavior.
• Backend / Server Side:
• Controllers: The “Controllers” folder holds controllers (AccountController, HomeController, etc.) which process user requests, perform business logic, and interact with models.
• Models and ViewModels: The “Models” and “ViewModels” directories define data structures, Entity Framework models, and representations for data passing to views.
• App_Start and Startup: This directory includes configuration files (RouteConfig, BundleConfig, IdentityConfig, etc.) for routing, bundling/minification, authentication, and initializing application services.
• Data Access Layer: The “DAL” folder contains the database context (WebCRMDBContext.cs) and database initialization/seeding (WebCRMInitializer.cs.txt), which facilitate data persistence using Entity Framework.
• Migrations: The “Migrations” folder contains EF migration files managing schema and data changes.
• Global Settings: Files like Global.asax and startup configuration (Startup.cs) tie together application-level events and initialization.
• Database:
• Although not explicitly a file in the project tree, Sql Express LocalDB is the embedded database here which is used via Entity Framework for data persistence. Diagrammatically, show the database component interacting with the DAL.
Relationships and Interactions
• Client requests flow into the Controllers (via routing defined in RouteConfig).
• Controllers interact with Models and use Entity Framework (DAL/WebCRMDBContext) for CRUD operations on the database.
• The Controllers then pass data to Views (via ViewModels and Models) to render HTML, augmented with client-side JS for further interactions.
• AJAX calls are employed on the client side (as indicated in the README and JS files in the “Scripts” folder) to refresh parts of the view (partial views) and fetch data (such as DataTables and calendar events).
• The App_Start configurations provide foundational behavior (authentication, route mapping, bundling) that defines global policies and connects middleware components.
Architectural Patterns and Design Principles
• MVC (Model-View-Controller): The clear separation between Controllers (logic), Views (presentation), and Models (data) is central.
• Dependency Injection and Startup Configuration: Though not explicitly shown as DI containers, the startup classes and configuration files indicate structured initialization.
• Separation of Client and Server Concerns: Different folders (Content, Scripts vs. Controllers, Views) indicate a clear split of responsibilities.
• Use of Entity Framework with Migrations: This highlights database versioning and code-first strategies.
• Partial AJAX Rendering and Responsive Design: Emphasis on fast client interactions through AJAX and a responsive UI using Bootstrap.
Relevant Technologies
• ASP.NET MVC 5
• Entity Framework 6 (with Code First, FluentAPI, Migrations)
• Razor Views (cshtml)
• jQuery, Bootstrap, and DataTables.net
• GUID configuration for routing, bundling, and authentication (ASP.Net Identity)