Appearance
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 dependenciesBuilt-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