3

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.

3 Answers 3

5

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
    • ...
Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

1

I'd suggest that ZippyV's solution layout is a good starting point for the solution. Depending on how you want to use IoC and unit testing etc. I'd potentially look at splitting out the controllers (and potentially model) into a separate project to aid in unit testing.

In addition to this I'd leave the admin section until you've defined all the objects / data structures you need for the public site otherwise you'll end up changing a model object and having to update in multiple places to potentially no gain (as it might change again :-)).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.