> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - 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: Astro-based App Project Structure

## Article: Astro-based App Project Structure

## Article Link: https://dev.wix.com/docs/wix-cli/legacy-clis/astro-based-wix-cli-for-apps/project-structure/astro-based-app-project-structure.md

## Article Content:

# Astro-based App Project Structure

<blockquote class="warning">

**Deprecated**

The Astro-based app project structure is deprecated. New app projects use the [new app project structure](https://dev.wix.com/docs/wix-cli/cli-for-apps/project-structure/about-the-app-project-structure.md). To migrate a project to it, see [Migrate an Astro-based CLI App to the New Wix CLI](https://dev.wix.com/docs/build-apps/develop-your-app/develop-an-app-with-the-cli/migrate-an-app-to-the-new-cli/migrate-an-app-from-the-astro-based-cli/migrate-an-astro-based-cli-app-to-the-new-wix-cli.md). To find out which structure a project uses, see [Determine Which CLI Your Project Uses](https://dev.wix.com/docs/build-apps/develop-your-app/develop-an-app-with-the-cli/project-development/determine-which-cli-your-project-uses.md).

</blockquote>

This article describes the structure of an app project that uses the Astro-based Wix CLI, an earlier version of the CLI for app projects. The project is built on the Astro web framework, and declares its extensions with the `@wix/astro` package.

An Astro-based app project includes Astro files, Wix-specific files, [Wix skills](https://dev.wix.com/docs/api-reference/articles/ai-tools/about-wix-skills.md), and directories for extensions and configuration.

## Project file structure

```text
.
├── .agents/
│     └── skills/
├── .astro/
├── .wix/
├── dist/
├── node_modules/
├── public/
├── src/
│   ├── pages/
│   ├── extensions/
│   ├── extensions.ts
│   └── env.d.ts
├── astro.config.mjs
├── .env.local
├── .nvmrc
├── package.json
├── tsconfig.json
├── wix.config.json
└── .gitignore
```

An Astro-based app project centers on [extensions](https://dev.wix.com/docs/build-apps/develop-your-app/develop-an-app-with-the-cli/supported-extensions/about-extensions-in-the-wix-cli.md) and the `extensions.ts` file that registers them.

> **Note:** The CLI creates some of these directories as you work. For example, `.astro/`, `dist/`, and `node_modules/` are created when you install dependencies or build and run your project.

## Skills directories

New CLI projects include [Wix skills](https://dev.wix.com/docs/api-reference/articles/ai-tools/about-wix-skills.md) so AI agents can perform CLI tasks for you. The skills are installed under `.agents/skills/`, with one folder per skill (such as `wix-app` and `wix-headless`), and made available to the AI tools you use, such as Claude Code, Cursor, and GitHub Copilot. The CLI also generates agent-instruction files, such as `AGENTS.md` and `CLAUDE.md`, for those tools.

## .wix/
Contains configuration and log files related to the Wix environment. 

<blockquote class="caution">

__Caution:__
This directory contains internal data. Don't edit it.

</blockquote>

## src/
Source directory. Contains all the source code and core resources of your project.

### pages/
`pages/` holds backend [HTTP endpoints](https://dev.wix.com/docs/build-apps/develop-your-app/develop-an-app-with-the-cli/supported-extensions/backend/http-endpoints/about-http-endpoints.md) under `pages/api/`, where each `.ts` file is auto-discovered as a route. For example, `src/pages/api/users.ts` is served at `/api/users`.

### extensions/
The default location for extensions you generate with [wix generate](https://dev.wix.com/docs/wix-cli/cli-for-apps/command-reference/project-commands/generate.md), organized by type to maintain consistency. Each extension gets its own folder holding an `<extension-name>.extension.ts` configuration file and its implementation. For example, an event handler is created at `src/extensions/backend/events/my-event/`, with `my-event.extension.ts` and `my-event.ts`.

You can place extensions anywhere under `src/`, as long as you update their paths in `extensions.ts`.

Each extension's `.extension.ts` file declares it with a builder from `@wix/astro/builders`, and [extensions.ts](https://dev.wix.com/docs/wix-cli/legacy-clis/astro-based-wix-cli-for-apps/project-structure/astro-based-app-project-structure.md#extensionsts) imports the file and registers the extension. For example:

```typescript
import { extensions } from '@wix/astro/builders';

export default extensions.dashboardPage({
  id: '154f642e-a705-4ff3-8421-6119354a3384',
  title: 'My Imported Page',
  routePath: 'my-imported-page',
  component: './extensions/dashboard/pages/my-imported-page/my-imported-page.tsx',
});
```

`wix generate` creates each extension's files, including a `.extension.ts` file containing the builder. By default, it uses the naming pattern `[extension-name].extension.ts`, and you can rename these files.

### extensions.ts
The configuration file where you register all your project's extensions. It must be located in the `src/` directory. It imports and registers each extension, wherever the extension lives under `src/`. When you move an extension file, update its import path here to maintain the connection. To see the extensions you can add, run [`wix generate`](https://dev.wix.com/docs/wix-cli/cli-for-apps/command-reference/project-commands/generate.md).

The file uses a builder pattern syntax that allows you to chain extension configurations together. It follows this basic structure, where `extensionType` stands for the builder of the extension you register, such as `dashboardPage`:

```typescript
import { app, extensions } from '@wix/astro/builders';

export default app()
  .use(extensions.extensionType({
    // Extension configuration
  }));
```

The file:

- Imports the necessary builders from `@wix/astro/builders`.
- Exports a default app configuration.
- Uses the `.use()` method to register extensions.

`extensions.ts` can also import an extension that's declared in its own `.extension.ts` file, described under [extensions/](https://dev.wix.com/docs/wix-cli/legacy-clis/astro-based-wix-cli-for-apps/project-structure/astro-based-app-project-structure.md#extensions). For example:

```typescript
import { app } from '@wix/astro/builders';
import myImportedPage from './extensions/dashboard/pages/my-imported-page/my-imported-page.extension.ts';

export default app()
  .use(myImportedPage);
```

When `wix generate` creates an extension, it adds the import statement and the `.use()` method call that register the new extension in `extensions.ts`.

When you delete an extension, remove both its import statement and its `.use()` method call from `extensions.ts`.

## astro.config.mjs
Astro configuration file, including the `wix()` integration settings.

## .env.local
Contains [environment variables](https://dev.wix.com/docs/build-apps/develop-your-app/develop-an-app-with-the-cli/project-development/environment-variables/about-environment-variables-in-the-cli.md) required to setup authentication for your local development environment. Don't edit any of the `WIX_CLIENT` variables.

## wix.config.json
Defines the identifiers that connect your local code to your Wix project. Don't edit this file.

## Other files and directories
The rest of the project uses standard Astro, npm, TypeScript, and Git files that you rarely need to edit:

- `.astro/`: holds Astro's build and type files, managed by Astro.
- `dist/`: your project's production build output, created when you build the project.
- `node_modules/`: the npm dependencies installed for your project.
- `public/`: holds static assets served at your site's root.
- `src/env.d.ts`: provides TypeScript type declarations for the Astro environment.
- `.nvmrc`: the version of Node.js the project uses, which Node Version Manager (NVM) reads when you run `nvm use`.
- `package.json`: manages your project's dependencies and scripts.
- `tsconfig.json`: configures the TypeScript compiler.
- `.gitignore`: lists the paths Git excludes from version control.