Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC folder structure for E-Commerce project

Tags:

asp.net-mvc

I am little confused about the folder structure for my project and grouping them in Controller. Project is E-Commerce. I have pages like

Home,About,Contact,Category menu and SubCategory list page, ProductList, ProductDetail, ShoppingCart, CartSummary, Checkout

User management Edit Profile, Orders, login information management.

Admin Product management (Insert, Update, Delete, Upload images, Adding Description etc), Category management, Order management etc.

Should I make areas?. How to make clean folder structure.

like image 969
Pirzada Avatar asked Feb 26 '26 18:02

Pirzada


2 Answers

My suggestion:

  • HomeController:
    • Home (Index action)
    • About
    • Contact
  • CategoryController:
    • Category (Index action - subcategory as a parameter of the category action)
  • ProductController:
    • List (you can share the productlist-html as a usercontrol with the category actions),
    • Detail
  • CartController:
    • ShoppingCart (Index action)
    • Checkout
    • Payment
    • ...
  • UserController:
    • Index (show the possible options: Edit and Orders)
    • Edit
    • Orders
  • Admin (Create a separate area for this because you will need multiple controllers to manage your site)
    • UsersController
    • OrdersController
    • ProductsController
    • SettingsController
    • MailingsController
    • ...
like image 85
ZippyV Avatar answered Feb 28 '26 14:02

ZippyV


Areas is the way forward. Try making folder for each big feature you mentioned. And consolidate everything related to it inside one area including controllers, views, css, javascript etc.

Make one separate Shared folder which would contain the stuff common across the whole website eg master pages, jQuery files etc.

like image 42
neebz Avatar answered Feb 28 '26 14:02

neebz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!