Core Concepts

Frappe’s power and flexibility come from a few key ideas. Understanding these core concepts will make it much easier to use, customize, and build with Frappe.

1. The Frappe Framework: The Foundation

Think of the Frappe Framework as the operating system for business applications. It provides all the essential tools you need to build powerful, data-driven systems, such as:

  • Database Tools: It handles all the complex interactions with your data.
  • User Interface (UI) Engine: It automatically creates screens for you to work with.
  • Security & Permissions: It manages who can see and do what.
  • Building Blocks: It offers the basic structure for extending its capabilities with Apps.

The framework itself is a toolkit; it needs AApplying lossy compression (like JPEG) or lossless compression (like Flate/ZIP, JPEG 2000) to embedded images. JPEG is excellent for photographs, while Flate works well for line art and text.pps to deliver specific business functions.

2. DocType: The Universal Building Block

The single most important concept in Frappe is the DocType. Like everything in the physical world is made of atoms, everything in the “Frappeverse” is made of DocTypes. It’s the blueprint for everything in the system – from a customer record to a sales invoice, or even system settings.

A DocType is like a smart form that combines three key aspects:

  • What it Stores (Data Model): It defines what information is collected, like Customer Name or Invoice Amount. This is similar to a “Model” in other software systems.
  • How You See It (User Interface): Frappe automatically uses the DocType to create:
    • Forms: Screens for entering and editing data.
    • Lists: Views to browse through multiple records.
    • Reports: Tools to analyze your data.
    • Web Views: Public-facing pages based on your data.
  • What It Does (Business Logic): You can attach rules and actions to a DocType. For example, validating data, performing calculations, or triggering automatic steps when a document is saved or approved. You can do this with Python code or use Frappe’s simpler “low-code” options.

This unified approach makes Frappe very consistent and efficient.

3. Frappe Apps: Ready-Made Solutions

Apps are like specialized programs you install to add features to your Frappe system. There are ready-made apps which Frappe provides or you can make your custom app.

  • Extend Functionality: Just like apps on your phone, Frappe Apps extend the core framework’s capabilities without changing its main code.
  • Examples: ERPNext (one of Frappe’s ready-made apps which functions as an ERP) is a great example—it’s a complete business management system built as a Frappe App. You can also create your own custom Apps for unique needs.
  • Installation: Apps are installed onto specific Sites, allowing you to choose which features are available for each part of your system. A single Site can have multiple Apps installed to create a complete solution.

4. Bench: The Command-Line Manager

Bench is your main command-line tool for managing your Frappe installations.

  • Central Control: It’s used to set up new Frappe projects, create and manage Sites, install and update Apps, start your development server, and perform various maintenance tasks.
  • Developer’s Helper: While primarily used by developers and administrators, understanding Bench’s role helps you grasp how Frappe environments are structured and managed.

5. Sites and Databases: Your Separate Workspaces

A Frappe installation can host one or many Sites. A Site is like a completely separate instance of your Frappe application, each with its own dedicated database.

  • Independent Workspaces: Each Site runs independently, meaning it has its own data, users, and settings. This is perfect for managing multiple companies, departments, or distinct projects on the same Frappe server without their data getting mixed up.
  • Dedicated Data: Every Site gets its own database, ensuring data separation and integrity.
  • Managed by Bench: A single Bench installation can oversee multiple Sites, offering a central point to manage different Frappe instances. You could even have multiple Sites for similar purposes (e.g., different branch offices) while keeping their data distinct.

6. The Desk & User Permissions: Your Control Center

The Desk is the main screen where users interact with Frappe applications. It’s your central hub for accessing modules, creating documents, viewing reports, and completing daily tasks.

Working hand-in-hand with the Desk is Frappe’s strong User Permissions system:

  • Role-Based Access: Permissions are controlled by Roles (like “Sales Manager” or “Accountant”). Users are assigned one or more roles, which then determine what they can see and do within the system.
  • Fine-Grained Control: Permissions can be set very precisely, from allowing access to entire document types down to individual fields. This ensures data security and helps enforce business processes.

7. Metadata-Driven Architecture: Building Smart

Frappe uses a metadata-driven approach, which is why it’s so fast to build and flexible. Instead of writing lots of code to define every database table or screen, you define metadata (data about your data) directly within DocTypes.

  • Define, Don’t Code: You simply describe what you want—the fields, their types, their properties.
  • Frappe Builds It: The Frappe Framework then automatically creates the underlying database structure, user interfaces, and much of the necessary code for you based on this description. This significantly speeds up development and keeps your application consistent.

8. Event-Driven Architecture & Hooks: Customizing with Ease

Frappe is built on an event-driven architecture, which makes it easy to customize and extend.

  • System Notifications: As things happen in the system (e.g., “a sales order was submitted,” “a new user logged in”), the Frappe Framework sends out notifications called events.
  • Hooks: Developers can “hook into” these events. By writing a small piece of code in an App’s hooks.py file, you can tell your system to automatically perform a custom action whenever a specific event occurs. This allows you to add powerful features and integrations without ever changing Frappe’s core code, keeping your customizations clean and manageable.
Last updated on