Skip to content

Frappe Custom Applications โ€‹

What Are Frappe Custom Apps? โ€‹

Custom apps are self-contained, modular business applications that extend Frappe's functionality. They follow a convention-over-configuration approach where the framework provides most boilerplate automatically.

Custom App Structure โ€‹

my_custom_app/
โ”œโ”€โ”€ hooks.py                          # App configuration and hooks into Frappe lifecycle
โ”œโ”€โ”€ modules.txt                       # List of business modules in this app
โ”œโ”€โ”€ my_custom_app/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ config/
โ”‚   โ”‚   โ””โ”€โ”€ desktop.py                # Desktop workspace icons and shortcuts
โ”‚   โ”œโ”€โ”€ my_module/                    # Business domain module (e.g., sales, inventory)
โ”‚   โ”‚   โ”œโ”€โ”€ doctype/                  # Document Types (data models)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ customer/
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ customer.py       # Python controller (business logic)
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ customer.json     # Model definition (schema, validation)
โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ customer.js       # Frontend logic (UI interactions)
โ”‚   โ”‚   โ””โ”€โ”€ page/                     # Custom pages (dashboards, reports)
โ”‚   โ”œโ”€โ”€ public/                       # Static assets (CSS, JS, images)
โ”‚   โ”œโ”€โ”€ templates/                    # Jinja2 templates for web pages
โ”‚   โ””โ”€โ”€ www/                          # Web pages accessible via routes
โ””โ”€โ”€ requirements.txt                  # Python package dependencies

Built-in Features (Auto-generated) โ€‹

Every Frappe app automatically includes:

  • REST API - Automatic CRUD endpoints from DocType definitions
  • Permissions system - Row-level and field-level access control
  • Audit trails - Automatic version tracking and change history
  • Custom fields - Runtime field additions without code changes
  • Workflows - Configurable approval and state management
  • Reports - Query builder and report designer
  • Print formats - PDF generation with custom templates
  • Email integration - Template-based email sending
  • File attachments - Document attachment management

Creating Custom Apps โ€‹

bash
# Enter the development container
docker exec -it <container_name> bash

# Create new app (interactive prompts will ask for details)
bench new-app my_custom_app

# Install app to a site
bench --site mysite.com install-app my_custom_app

# Create a new DocType (data model)
bench --site mysite.com console
>>> bench.new_doc("DocType", {...})
# Or use the web UI: Setup โ†’ Customize โ†’ DocType โ†’ New

Edge Home Solutions - Professional ยท Reliable ยท Trusted