WHAT YOU'LL LEARN
- How Webiny projects are organized - The purpose of each file and folder - Where to place custom code

Overview
anchor

Webiny projects follow a clean, simple structure designed for clarity and maintainability. All configuration is centralized, custom code has a dedicated location, and the project uses standard JavaScript/TypeScript conventions.

Directory Structure
anchor

Key Files
anchor

webiny.config.tsx
anchor

The central configuration file for your project. This is where you:

  • Register extensions
  • Configure AWS infrastructure
  • Set up authentication providers
  • Define deployment settings
webiny.config.tsx

Extensions/
anchor

The workspace for all custom code. Extensions are organized by type:

Reference extensions in webiny.config.tsx:

webiny.config.tsx

package.json
anchor

Contains project dependencies with key Webiny packages:

package.json

Key packages:

  • webiny - Unified API for all Webiny functionality
  • @webiny/cognito - Default authentication (replaceable)
  • @webiny/cli - Development and deployment tools

Public/
anchor

Static assets for the Admin application:

  • favicon.ico - Browser icon
  • global.css - Global styles applied to Admin
  • index.html - Admin app entry point
  • robots.txt - SEO configuration

Customize these files to brand your Admin interface.

Configuration Files
anchor

tsconfig.json

  • TypeScript compiler configuration
  • Ensures type safety across all extensions
  • Pre-configured for Webiny patterns

eslint.config.js

  • Code linting rules
  • Enforces consistent code style
  • Includes Webiny-specific rules

webiny-env.d.ts

  • TypeScript type definitions
  • Environment-specific types
  • Auto-generated, don’t edit directly

Project Organization
anchor

Single Package
anchor

Webiny uses a single-package approach:

  • One package.json at the root
  • All dependencies managed centrally
  • No complex monorepo setup

Extension-Based Architecture
anchor

All customization through extensions:

  • Clear separation of custom vs. framework code
  • Extensions are portable and testable
  • Easy to understand what’s custom

Deployment Artifacts
anchor

Build outputs are not stored in the project:

  • Lambda functions built on deployment
  • Admin app bundled during deployment
  • Infrastructure state managed by Pulumi

Best Practices
anchor

Extension Organization
anchor

Group related functionality:

Naming Conventions
anchor

  • Extensions - PascalCase (e.g., ProductApi.ts)
  • Folders - camelCase or kebab-case
  • Config files - Match tool conventions

Version Control
anchor

Track these files:

  • Everything in extensions/
  • webiny.config.tsx
  • package.json and lock files
  • Configuration files

Ignore:

  • node_modules/
  • Build outputs
  • Environment-specific files

Next Steps
anchor

With an understanding of project structure: