Modules are the core of Magento. Every action on the site, frontend or backend, goes through a module. Modules act as containers for one or more of the following: data models, rendering objects, action controllers, settings, database schemas, utility helpers. A module can be made of all six of these things, or just one.
Where are the Modules ?
All Magento’s core Modules are located in \app\code\core\Mage folder. The other extra modules (extensions) which are downloaded from Magento Connect or developed locally will be stored in \app\code\community and \app\code\local respectively. Here are the core Magento modules :

Directory Structure:
Let’s check out the Catalog module. Below you can see the directory structure of the Catalog module:

MVC Architecture:
Why so many folders? Magento follows MVC architecture. In MVC architecture even the bare bone application is (mostly) written across three separate files- Model, View and Controller. In this case ‘View’ is ‘Block’. Model manages all of the database connections and queries, then passes the information to controller. Controller then reorders, maps, filters, does some logic on the data and passes it to the View. View is the thing we see.
As you might notice, there are more than three types of files here. By types I mean Model, View (Block), Controller. Magento’s structure is therefore more divided. We can see the Helper and sql folders as well. Although not every Model contains the same sub folder structure like this one you need to understand that this is somewhat of a blueprint of how Magento modules are built.
Model:
They help move data from the database into the program itself. The output, or rendering, of the data is done by the Blocks, but the models are mainly responsible for manipulating the data.
Block:
Blocks provide the programming control behind Magento’s templating system. Block uses the sites Models, grabs the data, makes any necessary adjustments, and then makes that data available to a View. For instance, when you create a Block that calls a product collection, that product collection is pulling some products data from a Model. The Block is where you create such a product collection and implement the product collection’s methods product collection is then made available to your View so you can display the products on a page.
etc:
The configuration for each module resides within etc.
There are three key files:
- config.xml – Configures the module directly.
- convert.xml – Provides mechanisms for importing and exporting data.
- install.xml – Handles installation.
- system.xml – Provides admin menus and default settings.
Magento internally compiles a list of Modules to be used by combining the different XML files parsed when Magento loads.That list is then used when Magento needs to initiate a given action, the action is looked up within the large XML structure to determine which module can resolve the action.
sql:
Contains code to install the module by creating appropriate tables and inserting required records. A useful block of code to examine when trying to determine what tables are used by a given module.




