Skip to main content

Source Code Organization

This document outlines the standard structure of the Frappe and ERPNext source code.

Main Components

The project typically resides within a "Bench" directory structure.

apps/

Contains all the Frappe applications installed in the current bench.

  • apps/frappe/: The core Frappe framework codebase.
  • apps/erpnext/: The ERPNext application codebase.
  • apps/custom_app/: Any custom applications developed for our specific use cases.

sites/

Contains the configuration and public files for individual sites hosted on the bench.

  • sites/common_site_config.json: Configuration shared across all sites (e.g., Redis endpoints).
  • sites/[site_name]/: Directory for a specific site.

Best Practices for Customization

  1. Do NOT edit core files: Never modify files directly within apps/frappe/ or apps/erpnext/ unless contributing upstream.
  2. Use Custom Apps: All customizations (new DocTypes, custom scripts, server scripts) should be packaged in a custom app.
  3. Hooks: Use hooks.py in your custom app to override behaviors, inject CSS/JS, or intercept controller methods.

When reviewing or contributing to the source code, please adhere to our Core Agreements and Licenses.