> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ghg.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Folder Structure

> How to organize files in your game bundle and where index.html must be located

# Folder Structure

Your game bundle must contain an `index.html` file that serves as the entry point. The platform supports two valid folder structures: a flat structure and a single-wrapper-directory structure.

## The `index.html` Requirement

Every game submission **must** include an `index.html` file at the root level of the ZIP archive. This is the entry point that the platform uses to load and serve your game.

<Warning>
  Submissions without a valid `index.html` at the expected root location will be rejected during validation.
</Warning>

## Flat Structure (Recommended)

In the simplest and recommended layout, `index.html` sits directly at the ZIP root alongside your other game files:

```
my-game.zip
├── index.html
├── game.js
├── style.css
└── assets/
    ├── sprites.png
    ├── background.webp
    └── audio/
        ├── music.ogg
        └── sfx.mp3
```

With this structure, the platform finds `index.html` immediately at the root of the archive.

## Single-Wrapper-Directory Structure

If your ZIP root contains **exactly one directory and no other files**, the platform automatically treats that directory's contents as the effective root for locating `index.html`.

```
my-game.zip
└── my-game/
    ├── index.html
    ├── game.js
    ├── style.css
    └── assets/
        ├── sprites.png
        ├── background.webp
        └── audio/
            ├── music.ogg
            └── sfx.mp3
```

In this example, the ZIP root contains only the `my-game/` directory. The platform detects this pattern and looks for `index.html` inside `my-game/` instead.

<Note>
  This behavior **only** applies when the ZIP root contains exactly one directory and nothing else. If the root contains any files alongside the directory, the platform expects `index.html` directly at the root level.
</Note>

## Invalid Structures

The following structures will cause your submission to be rejected:

### Missing `index.html`

```
my-game.zip
├── game.js
├── style.css
└── assets/
    └── sprites.png
```

❌ No `index.html` at the root — rejected.

### Multiple Directories Without `index.html` at Root

```
my-game.zip
├── src/
│   └── index.html
├── assets/
│   └── sprites.png
└── lib/
    └── engine.js
```

❌ Multiple items at the root but no `index.html` — rejected. The single-wrapper-directory rule does not apply because there are multiple directories at the root.

### `index.html` Nested Too Deep

```
my-game.zip
├── build/
│   └── dist/
│       └── index.html
└── README.md
```

❌ The root contains both a directory (`build/`) and a file (`README.md`), so the platform expects `index.html` at the root level. Since it's not there, the submission is rejected.

## Tips

<Tip>
  **Using a build tool?** Most bundlers (Webpack, Vite, Parcel) output to a `dist/` or `build/` folder. You can ZIP the contents of that output folder directly to get a flat structure, or ZIP the folder itself to use the single-wrapper-directory pattern.
</Tip>

* **Flat structure:** `cd dist && zip -r ../my-game.zip .`
* **Wrapper structure:** `zip -r my-game.zip dist/`

Both are valid as long as `index.html` is findable at the effective root.

## Next Steps

Review the [file count and rate limits](/submission/file-limits) that apply to your submission, then use the [submission checklist](/submission/submission-checklist) to verify everything before uploading.
