When developing custom applications in ERPNext, managing frontend assets efficiently is crucial. Traditionally, ERPNext uses Jinja templates to build web pages, while modern frontend frameworks like Vite.js with React.js offer a more dynamic approach. In this blog post, I'll explore how Jinja and Vite.js handle builds, where to place the build files, and how to integrate them into an ERPNext custom app.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect, useState } from 'react'; | |
import '../../css/tailwind.css'; | |
import Dashboard from '@/components/Dashboard'; | |
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; | |
const queryClient = new QueryClient(); | |
export function App() { | |
const [theme, setTheme] = useState('light'); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for app in "${apps_with_git[@]}"; do | |
echo "Checking branch in $app..." | |
git -C "$app" branch --show-current | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"files.autoSave": "onFocusChange", | |
"editor.fontFamily": "Consolas, 'MesloLGS Nerd Font', monospace", | |
"terminal.integrated.fontFamily": "'MesloLGS Nerd Font'", | |
"terminal.integrated.fontSize": 13, | |
"editor.defaultFormatter": "ms-python.black-formatter", | |
"[json]": { | |
"editor.quickSuggestions": { | |
"strings": true | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
echo "🚨 Stopping and removing existing MariaDB..." | |
sudo systemctl stop mariadb || true | |
sudo apt remove --purge mariadb-server mariadb-client mariadb-common mariadb-server-core-* mariadb-client-core-* -y | |
sudo apt autoremove -y | |
sudo apt autoclean -y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// translation_tools/public/js/translation_tools/App.jsx | |
import * as React from 'react'; | |
import '../../css/tailwind.css'; | |
import { Button } from '@/components/ui/button'; | |
export function App() { | |
return ( | |
<main className="tw"> | |
<div className="tw-m-4"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bench --site your_site_name console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# thai_business_suite/setup/__init__.py | |
from . import setup_default_workspace | |
def after_install(): | |
"""Setup workspaces after app installation""" | |
setup_default_workspace.setup_workspaces() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
frappe.ui.form.on("DFP External Storage", { | |
setup: (frm) => { | |
frm.button_remote_files_list = null; | |
}, | |
refresh: function (frm) { | |
if (frm.is_new() && !frm.doc.doctypes_ignored.length) { | |
frm.doc.doctypes_ignored.push({ doctype_to_ignore: "Data Import" }); | |
frm.doc.doctypes_ignored.push({ doctype_to_ignore: "Prepared Report" }); | |
frm.refresh_field("doctypes_ignored"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Setup script for ERPNext translation service using OpenAI API | |
# This script works with or without Thai Business Suite installed | |
set -e # Exit on any error | |
# Banner | |
echo "===============================================" | |
echo "ERPNext Translation Service Setup" | |
echo "===============================================" |
NewerOlder