Skip to content

Cookbook Overview

The Frappe Developer Cookbook is the companion to the Guide: 56 self-contained recipes, each roughly 80% code and 20% explanation. Every recipe follows the same shape so you can scan it fast:

  • Problem — what you’re trying to solve.
  • Solution — complete, runnable code with file paths.
  • Why this works — the mechanism in a sentence or two.
  • Common mistake — the pitfall to avoid.

Every recipe uses the ScoopJoy franchise theme, and they’re self-contained — jump straight to whichever one matches your current need.

RecipeWhat you get
Self-Referencing Tree DocTypeUnlimited category nesting with the Nested Set model
Multi-Level Child TablesSimulating nested rows inside a document
Virtual DocTypeBack a DocType with an external API instead of a table
Dynamic Link (Polymorphic)One field that references many DocTypes
Advanced NamingFormat-string, controller, bulk, and cascade naming
ORM Power PatternsEight high-leverage frappe.db / ORM techniques
Fixtures & Data MigrationShipping seed data with your app
Computed & Virtual FieldsFields derived on read instead of stored
RecipeWhat you get
Validation ChainComposing readable, ordered validations
Document LifecycleOrchestrating submit/cancel side effects
Background JobsEnqueuing and tracking long work
Scheduled TasksFive kinds of recurring jobs
Whitelisted API MethodsA clean mobile-app API layer
extend_doctype_class (v16)The v16 way to extend stock DocTypes
Database TransactionsCommit/rollback patterns done right
Email & CommunicationSending and threading messages
RecipeWhat you get
Multi-Step Wizard DialogA guided multi-page form dialog
Real-Time DashboardLive sales numbers over Socket.IO
Dynamic Form Manipulation15+ form scripting patterns
Child Table OperationsProgrammatic grid manipulation
Custom List ViewList views with bulk actions
Custom Desk PageA franchise command-center page
Form Script CommunicationTalking between scripts and server
Frappe UI ComponentsReusable Desk UI building blocks
RecipeWhat you get
Mobile REST API LayerA versioned API surface for apps
Webhook Sender + RetryReliable outbound webhooks
Incoming Webhook IdempotencySafe, replay-proof handlers
Custom UPI GatewayA bespoke payment-gateway integration
Circuit-Breaker ClientResilient external API calls
File Upload PipelineUpload, validate, and process files
OAuth2 Connected AppConnecting to Google and friends
Node.js/Express MiddlewareBridging an Express app to Frappe
RecipeWhat you get
Query Builder MasterclassTen frappe.qb patterns
Script Report ScorecardA franchise performance report
Query Reports (SQL)Production SQL-backed reports
Redis Caching StrategiesSix caching patterns
N+1 Query EliminationFinding and killing N+1s
Database IndexingAn indexing strategy that holds up
Materialized View PatternPrecomputed rollups in Frappe
Bulk Data OperationsFast inserts and updates at scale
RecipeWhat you get
Approval Workflow + EscalationMulti-level approvals that escalate
Document State MachineModeling explicit state transitions
Notification EngineSix delivery channels in one engine
Scheduled Job OrchestrationPipelines of dependent jobs
Auto Repeat & RecurringRecurring documents on a schedule
Assignment RulesFour auto-assignment strategies
Complete CI/CD PipelineBuild, test, and deploy a Frappe app
Health Check & MonitoringA monitoring endpoint that means something
RecipeWhat you get
Unit TestingTesting controllers in isolation
Integration TestingEnd-to-end document flows
API Endpoint TestingExercising whitelisted methods
Permission Testing MatrixProving roles see what they should
Security HardeningNine concrete hardening recipes
Load Testing with LocustFinding the breaking point
Backup & Recovery ScriptsBackups you can actually restore
Docker Production BuildA lean production image pipeline