Skip to content
frappe-app-scaffold logo

Frappe App Scaffold

frappe-app-scaffold

Canonical folder structure produced by `bench new-app` for modern Frappe (v14/v15+). Use this as the ground truth for any Frappe app file tree — includes pyproject.toml and module management.

SKILL.md

Full skill instructions

Frappe App Scaffold — Modern Canonical Folder Structure

This is the exact folder structure for modern Frappe apps (v14, v15, and v16+). Any Frappe app MUST follow this layout. Modern apps have transitioned from setup.py to pyproject.toml.

CRITICAL: Module Management & modules.txt

Every Frappe app is organized into Modules. A module is a logical grouping of DocTypes.

  1. Directory Naming: Each module MUST have its own directory under the inner package directory.
  2. modules.txt: This file MUST list every module name in the app, one per line. If a module is not in modules.txt, its DocTypes may not be recognized or appear in the Desk.
  3. Module Folder: Inside each module folder, you MUST have an __init__.py and a doctype/ directory.

REQUIRED Files (Modern Viable Frappe App)

invoicing/                         # App root
├── pyproject.toml                 # Modern Python packaging (Replaces setup.py)
├── invoicing/                     # Inner package (same name as app)
│   ├── __init__.py
│   ├── hooks.py                   # App hooks (scheduler, doc_events, fixtures, etc.)
│   ├── modules.txt                # CRITICAL: List of all module names
│   ├── patches.txt                # Migration patches
│   ├── config/
│   │   ├── __init__.py
│   │   └── desktop.py             # Module icon for desk sidebar
│   ├── <module_name>/             # Folder for each module in modules.txt
│   │   ├── __init__.py
│   │   └── doctype/
│   │       ├── __init__.py
│   │       └── <doctype_name>/    # One folder per DocType
│   │           ├── __init__.py
│   │           ├── <doctype_name>.json    # DocType definition
│   │           ├── <doctype_name>.py      # Python controller
│   │           ├── <doctype_name>.js      # Client-side form script
│   │           └── test_<doctype_name>.py # Unit tests
├── requirements.txt               # Python dependencies
├── MANIFEST.in
├── license.txt
└── README.md

pyproject.toml Example (v15+)

[project]
name = "invoicing"
authors = [
    { name = "Your Company", email = "[email protected]" }
]
description = "A Frappe app for invoicing"
requires-python = ">=3.10"
dynamic = ["version"]
dependencies = [
    "frappe>=15.0.0"
]

[build-system]
requires = ["flit_core >=3.4,<4"]
build-backend = "flit_core.buildapi"

[tool.bench]
app-name = "invoicing"
app-title = "Invoicing"
app-publisher = "Your Company"
app-description = "A Frappe app for invoicing"
app-email = "[email protected]"
app-license = "MIT"

Key Rules for AI

  1. Always Update modules.txt: When creating a new module folder, immediately add its name to modules.txt.
  2. Proper Module Naming: Module names should be in Title Case in modules.txt (e.g., Sales Management) but the folder name should be snake_case (e.g., sales_management).
  3. No MVC folders: Do NOT use models/, controllers/, or views/.
  4. UI is automatic: Frappe Desk renders everything from DocType JSON.
  5. hooks.py: This is the brain of your app. Register all your events, filters, and scheduled jobs here.

Example: Invoicing App with "Billing" Module

invoicing/​modules.txt:

Billing

Folder Structure:

invoicing/
├── invoicing/
│   ├── modules.txt
│   ├── billing/                 # Folder for "Billing" module
│   │   ├── __init__.py
│   │   └── doctype/
│   │       ├── __init__.py
│   │       └── sales_invoice/
│   │           ├── ...

What Does NOT Exist in Modern Frappe

  • setup.py (Deprecated in favor of pyproject.toml)
  • setup.cfg (Deprecated)
  • models/ directory
  • views/ directory

Remember: This skill is the "blueprint" for any new Frappe app. Follow it strictly to ensure compatibility with bench and the Frappe Framework.

More skills from vyogotech

frappe-data-migration-generator logo
vyogotech/frappe-apps-manager

frappe-data-migration-generator

Generate data migration scripts for Frappe. Use when migrating data from legacy systems, transforming data structures, or importing large datasets.

11 0
View
frappe-documentation-generator logo
vyogotech/frappe-apps-manager

frappe-documentation-generator

Generate API documentation, user guides, and technical documentation for Frappe apps. Use when documenting APIs, creating user guides, or generating OpenAPI specs.

11 0
View
frappe-containerfile-generator logo
vyogotech/frappe-apps-manager

frappe-containerfile-generator

Generate Containerfile for Frappe apps using the official frappe/erpnext images with Gunicorn. The recommended pattern copies app source into the bench layout and runs Gunicorn directly.

11 0
View
Generate TDD Tests logo
vyogotech/frappe-apps-manager

Generate TDD Tests

Enforce the Iron Law of TDD for Frappe apps. Red-Green-Refactor cycle for DocTypes and Controllers.

11 0
View
frappe-controller logo
vyogotech/frappe-apps-manager

frappe-controller

Generate Frappe-style DocType controllers with lifecycle methods for microservices.

11 0
View
frappe-api-handler logo
vyogotech/frappe-apps-manager

frappe-api-handler

Generate whitelisted API methods and REST endpoints for standard Frappe and microservices.

11 0
View
Validate Microservice Code logo
vyogotech/frappe-apps-manager

Validate Microservice Code

Validate code follows frappe-microservice-lib patterns, security best practices, and framework conventions.

11 0
View
frappe-tenant-query logo
vyogotech/frappe-apps-manager

frappe-tenant-query

Generate tenant-isolated database queries using TenantAwareDB to prevent cross-tenant access.

11 0
View
frappe-secure-endpoint logo
vyogotech/frappe-apps-manager

frappe-secure-endpoint

Generate secure, tenant-aware API endpoints with authentication and tenant isolation.

11 0
View
frappe-web-form-builder logo
vyogotech/frappe-apps-manager

frappe-web-form-builder

Generate Frappe Web Forms for public-facing forms. Use when creating customer portals, registration forms, surveys, or public data collection forms.

11 0
View
frappe-unit-test-generator logo
vyogotech/frappe-apps-manager

frappe-unit-test-generator

Generate comprehensive unit tests for Frappe DocTypes, controllers, and API methods. Use when creating test files, writing test cases, or setting up test infrastructure for Frappe/ERPNext applications.

11 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View