Skip to content

Instantly share code, notes, and snippets.

View ManotLuijiu's full-sized avatar
🏠
Working from home

Manot Luijiu ManotLuijiu

🏠
Working from home
View GitHub Profile
@ManotLuijiu
ManotLuijiu / App.jsx
Created April 21, 2025 11:34
How to sync dark theme from ERPNext
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');
#!/bin/bash
for app in "${apps_with_git[@]}"; do
echo "Checking branch in $app..."
git -C "$app" branch --show-current
done
@ManotLuijiu
ManotLuijiu / settings.json
Created April 14, 2025 05:24
Settings File for Frappe/ERPNext environment
{
"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
},
@ManotLuijiu
ManotLuijiu / setup-mariadb-10.6.sh
Created April 12, 2025 05:01
Purge MariaDB from Ubuntu 24.04 and Re-Install Scripts
#!/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
@ManotLuijiu
ManotLuijiu / App.jsx
Last active April 14, 2025 17:07
Using Tailwindcss V3 and Shadcn/ui V2 in Frappe/ERPNext Ecosystem
// 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">
@ManotLuijiu
ManotLuijiu / access_console.log
Created April 2, 2025 04:58
How to get Relations between Tables in ERPNext
bench --site your_site_name console
@ManotLuijiu
ManotLuijiu / README.md
Last active March 29, 2025 12:19
Frappe/ERPNext custom app files structure at beginning point

Understanding Jinja vs. Vite.js (React.js) Build Processes in ERPNext

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.


How Jinja Builds and Where to Place Build Files

Jinja in ERPNext

@ManotLuijiu
ManotLuijiu / __init__.py
Created March 24, 2025 16:39
Example of creating workspace
# thai_business_suite/setup/__init__.py
from . import setup_default_workspace
def after_install():
"""Setup workspaces after app installation"""
setup_default_workspace.setup_workspaces()
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");
@ManotLuijiu
ManotLuijiu / setup-translation-eng2thai.sh
Last active March 22, 2025 06:28
Setup for Translation from English to Thai in th.po file
#!/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 "==============================================="