> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: Git Repository File Structure ## Article: Git Repository File Structure ## Article Link: https://dev.wix.com/docs/develop-websites-sdk/code-your-site/developer-environments/ides/git-integration/git-repository-file-structure.md ## Article Content: # Git Repository File Structure The repo's file structure matches the public, backend, and page code sections in the Code sidebar of the Wix editors. The file structure includes these important elements: - The [wix.config.json](#wixconfigjson) file found in the repo's root folder. - The **src** folder, that contains the following: - The [Backend folder](#backend-folder) - The [Pages folder](#pages-folder) - The [Public folder](#public-folder) - The [velo.dependencies.json](#velodependenciesjson) file (only exists once the first npm package is installed) Add code in either the **Pages**, **Backend**, or **Public** folders. Files or folders added to the root of the **src** folder are ignored. > **Notes:** > The following Velo features can't be added to a site when using Git Integration & Wix CLI: > > - [Custom Apps](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/developer-environments/packages/custom-apps/about-custom-apps.md) > - [Velo Packages](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/developer-environments/packages/velo-packages/about-velo-packages.md) ## Pages folder This folder contains code files for each of the pages on a site as well as the `masterpage.js` file. The code you add to these files runs when visitors open pages on the site. These files correspond to the ones found in the **Main Pages** section of the **Page Code** tab in the Code sidebar. When you add a page to a site in a Wix editor in your browser, a code file for that page gets added to the repo. The name of the file has 2 components: the name of the page that you define in the editor, and an internal ID string. The sections are separated by a period. ![Page name and ID](https://wixmp-833713b177cebf373f611808.wixmp.com/images/e709462e23ad2fdbb330efaacc3c3f41.png) When you [add a dynamic page](https://support.wix.com/en/article/content-manager-about-dynamic-pages#adding-dynamic-pages) to a site 2 code files are added to the site's repo corresponding to the dynamic list and dynamic item pages. When you open a page's code file, you see the same sample code that appears in these code files in Wix editors in your browser. ![Sample code](https://wixmp-833713b177cebf373f611808.wixmp.com/images/50c249b2e60957f6e2a3e0335ff1eed5.png) When you delete a page in a Wix editor in your browser, the page's corresponding code file is deleted from the repo. > **Notes:** > > - You can't create new code files for pages from the IDE. To add a file, create a new page for the site in a Wix editor in your browser, and [sync](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/developer-environments/ides/git-integration/working-with-the-local-editor.md#sync-design-changes-to-your-ide) the site with the local IDE. > - Don't rename code files for pages. Wix uses these file names to associate the files with the appropriate pages on the site. If you rename a file, the code is ignored and a new code file is created for the page. ## Backend folder This folder contains the backend code files for a site. These files correspond to the ones found in the **Backend** section of the **Public & Backend** tab in the Code sidebar. Add the following files to this folder to include them in the site: - [**Web Modules:**](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/build-a-custom-backend/web-modules/about-web-modules.md) These are files that allow you to expose functions in a site's backend that you can run in frontend code. These files require a `.web.js` file extension. > **Note:** For web modules with a `.jsw` extension, permissions are managed using the [permissions.json](#permissionsjson) file. Note that `.jsw` web modules are deprecated, although still supported for backward compatibility for both Wix Editor and Wix Studio. - **data.js:** A file for [adding data hooks](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/work-with-data/data-api/about-data-hooks.md) to the site's collections. - **routers.js:** A file for implementing [routing and sitemap](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/build-a-custom-backend/routers/about-routers.md#routing-code) functionality for the site. - **events.js:** A file for implementing the site's [backend event handlers](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/build-a-custom-backend/backend-events/about-backend-events.md). - **http-functions.js:** A file for implementing [HTTP endpoints](https://www.wix.com/velo/reference/wix-http-functions/introduction) that are exposed on the site. - **jobs.config:** A file for [scheduling recurring jobs](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/build-a-custom-backend/scheduled-jobs/schedule-recurring-jobs.md). Jobs consist of other backend code that's run at regular intervals. - **General backend files:** JavaScript code files. You can import code from these files into any other backend file on the site. These files require a `.js` file extension. Use the following syntax to import code from backend files: ```javascript import { myFunctionName } from "backend/myFileName"; ``` Trying to import from the relative path in the site's repo doesn't work. ### permissions.json
When using `.jsw` (deprecated) web modules, you can't change permissions in the editor when using Git Integration & Wix CLI. Instead, use the permissions.json file to set function permissions.   The backend folder also contains the **permissions.json** file. This file defines [permissions](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/build-a-custom-backend/web-modules/about-web-modules.md#permissions) for the functions in web module files. The file contains a key, `"web-methods"`, whose value is an object that contains keys named after the web module files in the backend folder. Name these keys with the following syntax: `"backend/{path to file}/myFile.jsw"`. The value for each file name key is an object that contains keys named after the functions in that file. Each function key has a value with the following format: ```json "myFunction": { "siteOwner" : { "invoke" : // Boolean }, "siteMember" : { "invoke" : // Boolean }, "anonymous" : { "invoke" : // Boolean } } ``` These values reflect the different levels of web module function permissions. You should set them using the following options: - **Owner-only access**: - `siteOwner.invoke`: `true` - `siteMember.invoke`: `false` - `anonymous.invoke` : `false` - **Site member access**: - `siteOwner.invoke`: `true` - `siteMember.invoke`: `true` - `anonymous.invoke` : `false` - **Anyone can access**: - `anonymous.invoke`: `true` - `siteMember.invoke` : `true` - `anonymous.invoke`: `true` The `"web-methods"` object must also contain a `"*"` key. The value for this key defines the default permissions that are applied to any function whose permissions you don't set manually. Here is an example `permissions.json` file for a site with a backend file called `helperFunctions.jsw`. The file's functions are called `calculate`, `fetchData`, and `syncWithServer`. In this case anyone can call `calculate`, site members can call `syncWithServer`, and only site owners can call `fetchData`. ```json { "web-methods": { "*": { "*": { "siteOwner": { "invoke": true }, "siteMember": { "invoke": true }, "anonymous": { "invoke": true } } }, "backend/helperFunctions.jsw": { "calculate": { "siteOwner": { "invoke": true }, "siteMember": { "invoke": true }, "anonymous": { "invoke": true } }, "fetchData": { "siteOwner": { "invoke": true }, "siteMember": { "invoke": false }, "anonymous": { "invoke": false } }, "syncWithServer": { "siteOwner": { "invoke": true }, "siteMember": { "invoke": true }, "anonymous": { "invoke": false } } } } } ```
## Public folder This folder contains the public code files for a site. These files correspond to the ones found in the **Public** section of the **Public & Backend** tab in the Code sidebar. You can import code from these files into any other file on the site. Use the following syntax to import code from public files: ```javascript import { myFunctionName } from "public/myFileName"; ``` Trying to import from the relative path in the site's repo doesn't work. ## velo.dependencies.json This file is created automatically when you install the first npm package. Wix uses this file to track the [npm packages](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/developer-environments/packages/npm/about-npm-packages.md) installed on a site. The file is updated automatically when you [install a package](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/developer-environments/ides/git-integration/wix-cli-commands.md#wix-install) with the Wix CLI. Don't change this file manually. ## wix.config.json Wix uses this file to associate a repo's code with a particular site and [UI version](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/developer-environments/ides/git-integration/about-the-local-editor.md). This file is updated automatically when the repo is synced with the Wix editors. Don't change this file manually. ## See also - [Publish a Site with Git Integration & Wix CLI](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/developer-environments/ides/git-integration/publish-a-site-with-git-integration-and-wix-cli.md) - [Test Code in the Local Editor](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/developer-environments/ides/git-integration/test-code-in-the-local-editor.md) - [Fix a Broken Git Integration](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/developer-environments/ides/git-integration/fix-a-broken-git-integration.md)