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
- Do NOT edit core files: Never modify files directly within
apps/frappe/orapps/erpnext/unless contributing upstream. - Use Custom Apps: All customizations (new DocTypes, custom scripts, server scripts) should be packaged in a custom app.
- Hooks: Use
hooks.pyin your custom app to override behaviors, inject CSS/JS, or intercept controller methods.
Legal Notice
When reviewing or contributing to the source code, please adhere to our Core Agreements and Licenses.