> For the complete documentation index, see [llms.txt](https://docs.scandipwa.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scandipwa.com/tutorials/scandipwa-social-share/step-1-and-2-creating-magento-2-module.md).

# STEP-1 and 2 Creating Magento 2 Module

[**STEP-1**](https://github.com/GAkim/SocialShareGraphQl/tree/STEP-1)

{% embed url="<https://www.youtube.com/watch?v=N4fWRyYZ0SA>" %}

Let’s Create Empty Module Folder **app/code/ScandiPWA/SocialShareGraphQl**\
ScandiPWA is **\[VENDOR]** module provider \
SocialShareGrpahQl **\[MODULE\_NAME]**

\
[**STEP-2**](https://github.com/GAkim/SocialShareGraphQl/tree/STEP-2)

&#x20;Now we going to create a blank Magento module and register it in Magento

1. For that let’s create an **etc** folder in **app/code/ScandiPWA/SocailShareGraphQl** <- feather in text **\<MODULE ROOT>**
2. In **\<MODULE ROOT>/etc** we need to create file **module.xm**l with the following content

{% code title="ScandiPWA/SocialShareGraphQl/etc/module.xml" %}

```markup
<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
   <module name="ScandiPWA_SocialShareGraphQl" />
</config>
```

{% endcode %}

&#x20; 3\. Create **registration.php** in **\<MODULE ROOT>**

{% code title="ScandiPWA/SocialShareGraphQl/registration.php" %}

```php
<?php
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE,
'ScandiPWA_SocialShareGraphQl',
__DIR__);
```

{% endcode %}

&#x20; 4\. Now we need to run `setup:upgrade` and find our module in output\
if you are running [CMA setup](https://docs.create-magento-app.com/) open console in **\<PROJECT ROOT>**  run `npm run cli`\
and then`m set:up`\
![](https://lh6.googleusercontent.com/Hj-UZsJHyDhAbFes9OYPe-n8mojaqjVzpGK5LSlhTJYVKCIkREtLAFDZ-OndAOsNLBRAci4JajO-xBSYqsdwAWKqWR38C8Eob78BMxVV8H6U3SgsSB-bm0QsBqKlar2O97dQBu7L)

**Congrats!!** \
**useful material:** [**Create a new Magento 2 module**](https://devdocs.magento.com/videos/fundamentals/create-a-new-module/) [**Working with Magento modules**](https://docs.scandipwa.com/developing-with-scandi/working-with-magento/working-with-magento-modules)\
[**Create Magento App**](https://docs.create-magento-app.com/)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.scandipwa.com/tutorials/scandipwa-social-share/step-1-and-2-creating-magento-2-module.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
