Skip to content
Skillpedia
General coding8.1k Β· #12616

webiny-project-structure

What it does

Explains the folder layout of a Webiny project and the role of its main config file. It is for developers who are new to Webiny and need to know where to put their code.

When to use it

  • βœ“When a developer asks where custom code should go in a Webiny project.
  • βœ“When a developer wants to know what the webiny.config.tsx file does.
  • βœ“When a developer needs to register a new extension in a Webiny project.

Skill link

https://github.com/webiny/webiny-js/blob/next/skills/user-skills/project-structure/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/webiny/webiny-js/blob/next/skills/user-skills/project-structure/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œWhere should I put my custom code in my Webiny project?”

5 new skills a week. 1 minute to read.

How it works

The skill explains the main folders and the config file, where all extensions are registered. The AI uses this to place new code in the right spot.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Webiny Project Structure

TL;DR

A Webiny project has a flat structure centered around webiny.config.tsx -- the single configuration file where all extensions are registered. Custom code lives in the extensions/ folder. Extensions are registered as React components (<Api.Extension>, <Admin.Extension>, <Infra.*>, <Cli.Command>) and can be conditionally loaded per environment.

Project Layout

my-webiny-project/
β”œβ”€β”€ extensions/          # All custom code -- API, Admin, Infra, CLI extensions
β”‚   └── README.md
β”œβ”€β”€ public/              # Static assets for the Admin app
β”‚   β”œβ”€β”€ favicon.ico
β”‚   β”œβ”€β”€ global.css
β”‚   β”œβ”€β”€ index.html
β”‚   └── robots.txt
β”œβ”€β”€ package.json         # Single package.json for the whole project
β”œβ”€β”€ tsconfig.json        # Single TypeScript config
β”œβ”€β”€ webiny.config.tsx    # Main configuration -- all extensions registered here
β”œβ”€β”€ webiny-env.d.ts      # TypeScript environment types
└── yarn.lock

Key points:

  • Single package.json -- no monorepo, no workspaces needed.
  • Single tsconfig.json -- straightforward TypeScript setup.
  • webiny.config.tsx -- the entry point for everything. All extensions, infrastructure options, and project settings are declared here.
  • extensions/ -- where all your custom code lives. Organize with subfolders as needed (e.g., extensions/contactSubmission/, extensions/AdminBranding/).

The webiny.config.tsx File

This file exports a single React component called Extensions. It uses JSX to declaratively register all configuration:

// webiny.config.tsx
import React from "react";
import { Admin, Api, Cli, Infra, Project, Security } from "webiny/extensions";
import { Cognito } from "@webiny/cognito";

export const Extensions = () => {
  return (
    <>
      {/* Infrastructure configuration */}
      <Infra.Aws.DefaultRegion name={"us-east-1"} />
      <Infra.Core.OpenSearch enabled={true} />
      <Infra.Aws.Tags tags={{ OWNER: "me", PROJECT: "my-project" }} />

      {/* Identity provider */}
      <Cognito />

      {/* API extensions (backend) */}
      <Api.Extension src={"/extensions/ProductCategoryModel.ts"} />
      <Api.Extension src={"/extensions/ProductModel.ts"} />
      <Api.Extension src={"/extensions/contactSubmission/ContactSubmissionHook.ts"} />

      {/* Security hooks */}
      <Api.Extension src={"/extensions/MyApiKey.ts"} />
      <Security.ApiKey.AfterUpdate src={"/extensions/MyApiKeyAfterUpdate.ts"} />

      {/* Admin extensions (frontend) */}
      <Admin.Extension src={"/extensions/AdminTheme/AdminTheme.tsx"} />
      <Admin.Extension src={"/extensions/AdminTitleLogo/AdminTitleLogo.tsx"} />
      <Admin.Extension src={"/extensions/contactSubmission/EmailEntryListColumn.tsx"} />

      {/* Infrastructure / Pulumi extensions */}
      <Infra.Core.Pulumi src={"/extensions/MyCorePulumiHandler.ts"} />

      {/* CLI extensions */}
      <Cli.Command src={"/extensions/MyCustomCommand.ts"} />

      {/* Project settings */}
      <Project.Telemetry enabled={false} />
    </>
  );
};

Extension Types

JSX Element What It Does File Type
<Api.Extension src="..." /> Registers a backend extension (GraphQL schemas, content models, lifecycle hooks) .ts
<Admin.Extension src="..." /> Registers a frontend Admin UI extension (themes, branding, custom columns, custom forms) .tsx
<Infra.Core.Pulumi src="..." /> Registers a Pulumi infrastructure handler .ts
<Cli.Command src="..." /> Registers a custom CLI command .ts
<Security.ApiKey.AfterUpdate src="..." /> Registers a security lifecycle hook .ts

YOU MUST include the full file path with the .ts or .tsx extension in every src prop. For example, use src={"/extensions/MyModel.ts"}, NOT src={"/extensions/MyModel"}. Omitting the file extension will cause a build failure.

YOU MUST use export default for the createImplementation() call when the file is targeted directly by an Extensio

FAQ

What is the extensions folder for?

It holds custom code for the API, admin, infrastructure and command-line parts of a project.

Does a Webiny project use several package files?

No. The skill says a project has one package.json and one tsconfig.json, with no monorepo setup.

What kinds of extensions are registered?

The skill lists API, admin, infrastructure and command-line extensions, which are added as components in the config file.

Details

Original description by the author

Webiny project layout, webiny.config.tsx anatomy, and extension registration. Use this skill when the developer asks about folder structure, where custom code goes, how to register extensions, what webiny.config.tsx does, or how the project is organized. Also use when they need to understand the relationship between extensions/, webiny.config.tsx, and the different extension types (Api, Admin, Infra, CLI).

repo: webiny/webiny-js

Popularity

GitHub stars
8.1k
Ranking position
#12616
License
β€”
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills