A professional desktop application for creating Hearts of Iron IV mods through a visual, user-friendly interface. No coding knowledge required!
This application is built with:
- Frontend: React + TypeScript + Tailwind CSS + React Flow
- Backend: Rust + Tauri
- Build Tool: Vite
- Project setup with Tauri + React + TypeScript
- Tailwind CSS with professional HOI4-inspired theme
- Sidebar navigation with smooth transitions
- Routing between sections
- Data model definitions
- Professional button styles (gold gradients, hover effects)
- Beautiful clickable cards with animations
- StatusBar component showing project status
- NewProjectModal with form validation
- Project state management
- Fully functional home screen
- Localisation system
- Condition Builder component
- Effect Builder component
- Ideas Editor
- Events Editor
- Visual node-based editor with React Flow
- Drag & drop focus nodes
- Prerequisite connections
- Focus properties panel
- Import/export focus trees
- Country Editor
- Character Editor
- Decisions Editor
- States Editor
- Technology Editor
- GFX Manager
- Export system with validation
hoi4-mod-maker-pro/
├── src/ # React frontend source
│ ├── components/ # React components
│ │ ├── Sidebar.tsx # Left navigation sidebar
│ │ └── MainWorkspace.tsx # Main content area
│ ├── types.ts # TypeScript type definitions
│ ├── App.tsx # Root React component
│ ├── main.tsx # React entry point
│ └── index.css # Global styles + Tailwind
├── src-tauri/ # Rust backend source
│ ├── src/
│ │ ├── lib.rs # Main Rust library with Tauri commands
│ │ └── main.rs # Rust entry point
│ ├── Cargo.toml # Rust dependencies
│ ├── tauri.conf.json # Tauri configuration
│ └── build.rs # Rust build script
├── public/ # Static assets
├── dist/ # Built frontend (generated)
├── index.html # HTML entry point
├── vite.config.ts # Vite configuration
├── tsconfig.json # TypeScript configuration
├── tailwind.config.js # Tailwind CSS configuration
└── package.json # Node.js dependencies and scripts
# Install dependencies (first time only)
npm install
# Run in development mode
npm run tauri devThe application window will open, and you can:
- ✨ Click "New Project" to open the beautiful modal dialog
- ✨ Fill out the form and create a project
- ✨ Watch the status bar update with your project name
- ✨ Navigate through different sections using the sidebar
- ✨ Experience smooth animations and hover effects
See BUILD_INSTRUCTIONS.md for detailed steps to build the .exe file on Windows.
Quick version:
npm run tauri buildThis creates:
src-tauri/target/release/hoi4-mod-maker-pro.exe(portable executable)- Installer in
src-tauri/target/release/bundle/nsis/
You need to have installed:
- Node.js (v16 or later) - JavaScript runtime
- npm (comes with Node.js) - Package manager
- Rust (latest stable) - Systems programming language
- Cargo (comes with Rust) - Rust package manager
-
Clone the repository (if from git):
git clone <repository-url> cd custom-mod-tool
-
Install dependencies:
npm install
-
Run development server:
npm run tauri dev
This will:
- Start the Vite dev server (React frontend) on port 1420
- Compile the Rust backend
- Open the desktop application window
- Enable hot-reload for development
| Command | Description |
|---|---|
npm run dev |
Start Vite dev server only (for frontend testing) |
npm run build |
Build the React frontend for production |
npm run tauri dev |
Run the full Tauri app in development mode |
npm run tauri build |
Build the production .exe (Windows), .app (macOS), or binary (Linux) |
To create a distributable Windows executable:
npm run tauri buildThis will:
- Build the React frontend in production mode
- Compile the Rust backend with optimizations
- Bundle everything into a Windows executable
- Create an installer (NSIS or MSI)
The built files will be in:
- Executable:
src-tauri/target/release/hoi4-mod-maker-pro.exe - Installer:
src-tauri/target/release/bundle/
-
vite.config.ts: Configures Vite build tool. Sets up React plugin and Tauri-specific settings (port 1420, watch exclusions). -
tsconfig.json: TypeScript compiler configuration. Enables strict type checking and modern JavaScript features. -
tailwind.config.js: Tailwind CSS configuration. Defines custom HOI4-inspired color palette (dark backgrounds, gold accents). -
postcss.config.js: PostCSS configuration. Integrates Tailwind CSS into the build pipeline. -
index.html: Entry HTML file. Contains the root div where React renders. -
src/main.tsx: React entry point. Renders the App component into the DOM. -
src/App.tsx: Root React component. Manages sidebar navigation state and overall layout. -
src/components/Sidebar.tsx: Left navigation sidebar with all section links (Home, Focus, Events, etc.). -
src/components/MainWorkspace.tsx: Main content area that changes based on active sidebar section. -
src/types.ts: TypeScript type definitions for all data structures (Project, Focus, Event, etc.). -
src/index.css: Global CSS with Tailwind directives, custom scrollbar, and base styles.
-
src-tauri/tauri.conf.json: Main Tauri configuration. Defines window properties, app metadata, and build settings. -
src-tauri/Cargo.toml: Rust package manifest. Lists dependencies (Tauri, plugins, serde for JSON). -
src-tauri/build.rs: Rust build script. Called by Cargo before compilation to generate code. -
src-tauri/src/lib.rs: Main Rust library. Defines Tauri commands (functions callable from JavaScript):greet(name): Example commandsave_project(project, path): Saves a project fileload_project(path): Loads a project file
-
src-tauri/src/main.rs: Rust binary entry point. Calls the library'srun()function.
package.json: Node.js package configuration. Lists all npm dependencies and defines scripts.
-
Starting the App:
- User runs
npm run tauri dev - Tauri starts two processes: a. Vite dev server (serves React frontend on http://localhost:1420) b. Rust backend (native desktop window)
- User runs
-
Frontend Rendering:
- Browser loads
index.html - HTML loads
src/main.tsx(via Vite) main.tsxrenders<App />componentApprenders<Sidebar />and<MainWorkspace />- User clicks sidebar items, state updates, workspace content changes
- Browser loads
-
Frontend-Backend Communication:
- React components import
@tauri-apps/api - Call Rust functions:
await invoke('greet', { name: 'User' }) - Rust functions in
lib.rsexecute (file system, system info, etc.) - Results return to React as Promises
- React components import
-
Building for Production:
npm run tauri buildruns: a.npm run build→ Vite builds React todist/folder b.cargo build --release→ Compiles Rust with optimizations c. Tauri bundlesdist/+ Rust binary into.exed. Creates installer with NSIS or Windows Installer
-
Implement Core Components:
- Condition Builder (visual trigger editor)
- Effect Builder (visual effect editor)
- Localisation Manager
-
Build Focus Tree Editor:
- Integrate React Flow
- Create custom focus node components
- Implement drag & drop
- Add connection logic
-
Add File Operations:
- Implement save/load in Rust
- Add HOI4 script generation
- Create export system
-
Polish UI:
- Add tooltips
- Implement auto-save
- Add validation
- Create settings panel
The app uses a HOI4-inspired dark theme:
- Background Dark:
#1a1a2e - Background Darker:
#0f0f1a - Gold (accent):
#c9a227 - Blue (highlights):
#4a90d9 - Red (errors):
#d64545 - Green (success):
#45d645
Ctrl+S: Save projectCtrl+Shift+S: Save asCtrl+E: Export modCtrl+Z: UndoCtrl+Y: RedoF5: Validate modF1: Help
To test during development:
- Run
npm run tauri dev - Application window opens
- Click sidebar items to switch sections
- Check that the UI looks correct
- Monitor console for errors
Issue: npm run tauri dev fails to start
- Solution: Make sure both Node.js and Rust are installed. Run
node --version,npm --version,rustc --version,cargo --versionto verify.
Issue: Changes not showing in dev mode
- Solution: Vite has hot-reload enabled. If it doesn't work, restart
npm run tauri dev.
Issue: Build fails with Rust errors
- Solution: Run
cd src-tauri && cargo cleanto clean build cache, then try again.
Issue: Tailwind classes not working
- Solution: Make sure the file is listed in
tailwind.config.jscontent array.
ISC
Created as a comprehensive Hearts of Iron IV mod creation tool.