### Install Frappe Bench and Start Server (Local) Source: https://github.com/frappe/helpdesk/blob/develop/README.md Steps to install the Frappe bench tool and start the development server for local setup. ```bash bench start ``` -------------------------------- ### Frontend Development Setup (Helpdesk) Source: https://github.com/frappe/helpdesk/blob/develop/README.md Install dependencies and start the development server for the Helpdesk frontend. ```bash yarn install yarn dev or yarn dev --host helpdesk.test ``` -------------------------------- ### Install Helpdesk App (Local) Source: https://github.com/frappe/helpdesk/blob/develop/README.md Install the Helpdesk app onto the specified Frappe site. ```bash bench --site helpdesk.test install-app helpdesk ``` -------------------------------- ### Download Easy Install Script Source: https://github.com/frappe/helpdesk/blob/develop/README.md Download the easy install script for Frappe Helpdesk. This is the first step for self-hosting. ```bash wget https://frappe.io/easy-install.py ``` -------------------------------- ### Setup Folder and Download Files (Docker) Source: https://github.com/frappe/helpdesk/blob/develop/README.md Create a directory and download the necessary docker-compose and initialization scripts for setting up Helpdesk with Docker. ```bash mkdir frappe-helpdesk cd frappe-helpdesk # Download the docker-compose file wget -O docker-compose.yml https://raw.githubusercontent.com/frappe/helpdesk/develop/docker/docker-compose.yml # Download the setup script wget -O init.sh https://raw.githubusercontent.com/frappe/helpdesk/develop/docker/init.sh ``` -------------------------------- ### Get Helpdesk App (Local) Source: https://github.com/frappe/helpdesk/blob/develop/README.md Download the Frappe Helpdesk app from its GitHub repository. ```bash bench get-app https://github.com/frappe/helpdesk ``` -------------------------------- ### Get Telephony App (Local) Source: https://github.com/frappe/helpdesk/blob/develop/README.md Download the Frappe Telephony app from its GitHub repository. ```bash bench get-app https://github.com/frappe/telephony ``` -------------------------------- ### Run Docker Container Source: https://github.com/frappe/helpdesk/blob/develop/README.md Start the Helpdesk application in detached mode using Docker Compose. ```bash docker compose up -d ``` -------------------------------- ### Vue Styling and Data Fetching Example Source: https://github.com/frappe/helpdesk/blob/develop/AGENTS.md Demonstrates styling a ticket details component using Tailwind CSS and Frappe UI's data fetching composables. It shows how to create a document resource for a 'HD Ticket' doctype. ```vue ``` -------------------------------- ### Run Frappe Helpdesk Production Deployment Source: https://github.com/frappe/helpdesk/blob/develop/README.md Execute the deployment command to set up a production-ready Frappe Helpdesk instance. Ensure you replace placeholder values with your actual email and domain. ```bash python3 ./easy-install.py deploy \ --project=helpdesk_prod_setup \ --email=your_email.example.com \ --image=ghcr.io/frappe/helpdesk \ --version=stable \ --app=helpdesk \ --sitename subdomain.domain.tld ``` -------------------------------- ### Build Helpdesk App (Local) Source: https://github.com/frappe/helpdesk/blob/develop/README.md Build the Helpdesk application assets for production or development. ```bash bench build --app helpdesk ``` -------------------------------- ### Map Site to Localhost (Local) Source: https://github.com/frappe/helpdesk/blob/develop/README.md Add the newly created site to your local host file for access via a browser. ```bash bench --site helpdesk.test add-to-hosts ``` -------------------------------- ### Create New Site (Local) Source: https://github.com/frappe/helpdesk/blob/develop/README.md Command to create a new Frappe site for the Helpdesk application. ```bash bench new-site helpdesk.test ``` -------------------------------- ### Safe Site Data Query Pattern Source: https://github.com/frappe/helpdesk/blob/develop/AGENTS.md This Python snippet demonstrates a safe pattern for querying Frappe site data. It initializes the Frappe environment, connects to a specified site, and allows for read-only queries before disconnecting. Always query the site first before assuming data state. ```python import sys, os sys.path.insert(0, 'apps/frappe') os.chdir('sites') import frappe frappe.init(site='', sites_path='.') frappe.connect() # ... read-only queries here ... frappe.destroy() ``` -------------------------------- ### Apply Helpdesk Patches Source: https://github.com/frappe/helpdesk/blob/develop/helpdesk/patches.txt Applies various patches to the Helpdesk module. These patches cover renaming, updating, and adding new functionalities. ```python helpdesk.patches.change_app_name_to_helpdesk ``` ```python helpdesk.patches.rename_doctypes_prefix_with_hd ``` ```python helpdesk.patches.rename_frappedesk_module_references ``` ```python helpdesk.patches.naming_autoincrement ``` ```python helpdesk.patches.rename_canned_response_to_saved_reply ``` ```python helpdesk.patches.add_priority_integer ``` ```python helpdesk.patches.template_remove_default_fields ``` ```python helpdesk.helpdesk.doctype.hd_ticket.patches.fallback_ticket_type ``` ```python helpdesk.helpdesk.doctype.hd_ticket_feedback_option.patches.ootb ``` ```python helpdesk.helpdesk.doctype.hd_ticket_feedback_option.patches.label_as_name ``` ```python helpdesk.helpdesk.doctype.hd_service_level_agreement.patches.missing_sla_creation ``` ```python helpdesk.helpdesk.doctype.hd_ticket.patches.replace_overdue_failed ``` ```python helpdesk.patches.create_helpdesk_folder ``` ```python helpdesk.helpdesk.doctype.hd_ticket.patches.feedback_in_master ``` ```python helpdesk.helpdesk.doctype.hd_ticket.patches.first_responded_on ``` ```python helpdesk.patches.update_hd_team_users ``` ```python helpdesk.patches.default_article_category #v2 ``` ```python helpdesk.patches.communication_read_perm_agent ``` ```python helpdesk.patches.agent_manager_perms #v2 ``` ```python helpdesk.patches.remove_agents_teams_default_views ``` ```python helpdesk.patches.add_fields_in_assignment_rule ``` ```python helpdesk.patches.update_ticket_statuses ``` ```python helpdesk.patches.add_status_category_to_tickets ``` ```python helpdesk.patches.enable_new_email_notifications ``` ```python helpdesk.patches.add_fulltext_index #v2 ``` ```python helpdesk.patches.add_telephony_app ``` ```python helpdesk.patches.add_website_settings_permission ``` ```python helpdesk.patches.set_last_customer_agent_response ``` ```python helpdesk.patches.add_agent_manager_perms_in_assignment_rule ``` ```python helpdesk.patches.set_std_views_non_public ``` ```python helpdesk.helpdesk.doctype.hd_ticket.patches.backfill_sla_failed_by ``` ```python helpdesk.patches.rename_and_update_std_views #v2 ``` ```python helpdesk.patches.set_hd_ticket_naming_series ``` ```python helpdesk.patches.set_default_agent_statuses ``` -------------------------------- ### Button Macro Source: https://github.com/frappe/helpdesk/blob/develop/helpdesk/templates/emails/macros.html Generates a button-like link for emails. Use this to create prominent calls to action. ```html {% macro button(label, link, primary = true) %} [{{ label }}]({{ link }}) {% endmacro %} ``` -------------------------------- ### Link Macro Source: https://github.com/frappe/helpdesk/blob/develop/helpdesk/templates/emails/macros.html Generates a standard markdown link for emails. Suitable for less prominent navigation. ```html {% macro link(label, link) %} [{{ label }}]({{ link }}) {% endmacro %} ``` -------------------------------- ### Signature Macro Source: https://github.com/frappe/helpdesk/blob/develop/helpdesk/templates/emails/macros.html Generates a standard email signature. Appends a closing and team name. ```html {% macro signature() %} Thanks, Team Frappe {% endmacro %} ``` -------------------------------- ### Create List Resource for HD Tickets Source: https://github.com/frappe/helpdesk/blob/develop/AGENTS.md Use createListResource to fetch and manage a list of 'HD Ticket' documents. Handles loading, error states, and provides methods for operations like reload, update, insert, and delete. ```typescript const tickets = createListResource({ doctype: "HD Ticket", filters: { status: "Open" }, fields: ["name", "subject", "modified"], limit: 20, auto: true, }); // Access data tickets.data; // Array of ticket objects tickets.loading; // Boolean loading state tickets.error; // Error object if any // Operations tickets.reload(); // Refresh the list tickets.update({ name: "", subject: "Updated Subject" }); // Update item tickets.insert({ subject: "New Ticket" }); // Add new item tickets.delete(""); // Delete item ``` -------------------------------- ### Create Document Resource for Single HD Ticket Source: https://github.com/frappe/helpdesk/blob/develop/AGENTS.md Use createDocumentResource to fetch and manage a single 'HD Ticket' document. Provides access to the document object, loading/error states, and methods for fetching, updating fields, saving, and deleting. ```typescript const ticket = createDocumentResource({ doctype: "HD Ticket", name: "", auto: true, }); // Access data ticket.doc; // Document object ticket.loading; // Boolean loading state ticket.error; // Error object if any // Operations ticket.get(); // Fetch/refresh document ticket.setValue("status", "Resolved"); // Update field ticket.save(); // Save changes ticket.delete(); // Delete document ``` -------------------------------- ### Import Lucide Icons in Script Source: https://github.com/frappe/helpdesk/blob/develop/AGENTS.md Import Lucide icons for use within JavaScript or TypeScript code. This allows programmatic manipulation or conditional rendering of icons. ```typescript import LucidePlus from "~icons/lucide/plus"; import LucideTicket from "~icons/lucide/ticket"; ``` -------------------------------- ### Create Resource for API Calls Source: https://github.com/frappe/helpdesk/blob/develop/AGENTS.md Use createResource for making API calls to specific backend endpoints. Handles success and error callbacks and provides a submit method to trigger the API request with parameters. ```typescript const apiCall = createResource({ url: "helpdesk.api.ticket.assign_ticket_to_agent", onSuccess(data) { // Handle success }, onError(error) { // Handle error }, }); // Make the call apiCall.submit({ ticket_id: "", agent_id: "" }); ``` -------------------------------- ### Execute Frappe Delete Workspace Source: https://github.com/frappe/helpdesk/blob/develop/helpdesk/patches.txt Deletes a specific workspace from the Frappe framework. The 'force=True' argument bypasses checks. ```python execute:frappe.delete_doc("Workspace", "Frappe Desk", force=True) ``` -------------------------------- ### Python Controller Code Structure Source: https://github.com/frappe/helpdesk/blob/develop/AGENTS.md Illustrates the required structure for controller logic in Python, emphasizing lifecycle hooks calling methods and methods having single responsibilities. Lifecycle hooks should not contain inline logic. ```python class HDFoo(Document): # 1. Lifecycle hooks at the top — each hook calls methods, no inline logic def after_insert(self): self.do_a() self.do_b() def on_update(self): self.do_a() # 2. Methods below — one responsibility each def do_a(self): pass def do_b(self): pass ``` -------------------------------- ### Execute Frappe Delete Server Script Source: https://github.com/frappe/helpdesk/blob/develop/helpdesk/patches.txt Deletes a server script, ignoring it if it's not found. Useful for cleanup operations. ```python execute:frappe.delete_doc("Server Script", "Ticket Auto Set Custom Fields", ignore_missing=True) ``` -------------------------------- ### Execute Frappe Delete Document Source: https://github.com/frappe/helpdesk/blob/develop/helpdesk/patches.txt Deletes specific DocTypes from the Frappe framework. Use with caution as it permanently removes data structures. ```python execute:frappe.delete_doc("DocType", "HD Preset Filter") ``` ```python execute:frappe.delete_doc("DocType", "HD Preset Filter Item") ``` ```python execute:frappe.delete_doc("DocType", "HD Pause Service Level Agreement On Status") ``` ```python execute:frappe.delete_doc("DocType", "HD Service Level Agreement Fulfilled On Status") ``` -------------------------------- ### Separator Macro Source: https://github.com/frappe/helpdesk/blob/develop/helpdesk/templates/emails/macros.html Generates a visual separator for email content. Use to divide sections of an email. ```html {% macro separator() %} {% endmacro %} ``` -------------------------------- ### Use Lucide Icons in Vue Template Source: https://github.com/frappe/helpdesk/blob/develop/AGENTS.md Integrate Lucide icons directly into Vue templates for modern design. Ensure the 'lucide' icon set is available via unplugin-icons. ```vue ``` -------------------------------- ### Use FeatherIcon Component Source: https://github.com/frappe/helpdesk/blob/develop/AGENTS.md Utilize the FeatherIcon component for legacy components. Prefer Lucide icons for new development. This component takes the icon name as a string prop. ```vue ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.