Code


Easyfieds is developed in modular fashion. In this section we will go into details of each module and inner workings of its structure.

Project Structure

The project is developed with ASP .Net MVC with the following modules and file structurs. Check the explanation below the tree.

    1) App.Web

    This is the main ASP .Net MVC Web Project in the solution. Users will be interacting with this module in their browsers. For Dashboard Panel, we have created a separate area named Dashboard which have separate routes, controllers, models and views.

    1.a) Controllers

    We have Controllers in two places in the project. One is in main Controllers folder and another is Dashboard Area Controllers folder.

    1.b) Views

    Similar to Controllers, we have views in two Views folders. One is in main Views folder and the other is in Dashboard Area Views folder.

    1.c) Templates, Styles, Scripts, Fonts and Other Files

    All the files related to Templates, Styles, JavaScript/jQuery, third party libraries, SASS, Less, Fonts and Images exists in Content folder.

    1.d) ViewModels

    View models have their own separate ViewModels folder. Each file in ViewModels folder contain many ViewModel classes.

    1.e) Error Pages

    The project also implements custom error pages which you can find in the main folder. Local development does not show these error pages as it is recommended to only be shown on the released environment. You can change this setting in web.config file. Learn more about Error Pages in MVC in this Link.

    2) App.Data

    This module is a Class Library Project in the main solution. This is responsible for handling everything related to Database. Easyfieds uses Entity Framework Code First Migrations to create database. AppDataContext class is derived from DbContext class of Entity Framework. Read more details of Database creation/setup etc in Setup section.

    3) App.Services

    This module is also a Class Library Project which act as intermediary between App.Data database module and App.Web UI module.

    4) App.Entities

    This module is also Class Library Project in the solution. This project contain all the business entities/classes. This is referenced in all other projects in the main solution.

    5) App.Shared

    This module contain a helpers, extensions, attributes and common enums that are shared accross all the other projects in the solution.