- Node.js 18+
- npm or yarn
- TypeScript 5.0+
npm install# Build backend
npm run build:backend
# Build UI
npm run build:ui
# Build everything
npm run build
# Development mode (watch)
npm run dev
# UI development server
npm run dev:ui
# Electron development
npm run dev:electron# Start backend
npm start
# Start CLI
npm run cli
# Start Electron app
npm run start:electron- main.ts - Application entry point
- cli.ts - Command-line interface
- ob/ - Object Builder specific code
- commands/ - Command pattern classes (39 commands)
- workers/ - Background processing
- settings/ - Settings management
- utils/ - Utilities
- otlib/ - Open Tibia library
- core/ - Core classes (Version, Storage)
- things/ - Thing type system
- sprites/ - Sprite system
- storages/ - Storage implementations
- loaders/ - File loaders
- main.ts - Main process (window management, IPC)
- preload.ts - Preload script (secure bridge)
- components/ - React components
- contexts/ - React contexts (Worker, AppState, Progress)
- services/ - Services (WorkerService, FileDialogService, CommandFactory)
- hooks/ - Custom hooks (useAppState, useToast)
UI Component
↓
WorkerService
↓
Electron IPC
↓
Main Process
↓
ObjectBuilderApp
↓
ObjectBuilderWorker
↓
Storage/Operations
All operations use the command pattern:
- UI creates command via
CommandFactory - Command sent via
WorkerService - Electron IPC forwards to main process
- Main process creates command instance
- Command routed to
ObjectBuilderWorker - Worker executes operation
- Response sent back via IPC
- Create new project files
- Load existing files (.dat, .spr)
- Merge files
- Compile to .dat/.spr
- Unload project
- Create, update, delete things
- Import/export things
- Find things
- Optimize things
- Convert between formats
- Add, remove sprites
- Import/export sprites
- Replace sprites
- Find sprites
- Optimize sprites
- Create command class in
src/ob/commands/ - Add callback in
ObjectBuilderWorker - Register in
WorkerCommunicator - Add to
CommandFactoryin UI - Add to command map in
electron/main.ts
- Create component in
ui/src/components/ - Add styles in component CSS file
- Integrate into parent component
- Add to state management if needed
- Use CLI (
npm run cli) for backend testing - Use Electron dev mode for UI testing
- Check console for errors
- Use React DevTools for component inspection
- Backend:
dist/(TypeScript compiled to JavaScript) - UI:
dist/ui/(Vite build output) - Electron:
dist/electron/(Electron main process)
tsconfig.json- Backend TypeScript configui/tsconfig.json- UI TypeScript configelectron/tsconfig.json- Electron TypeScript config
vite.config.ts- Vite build configuration
electron/main.ts- Main process configuration- Window state saved in
app.getPath('userData')/window-state.json - Settings saved in OS-specific application data directory
- Check TypeScript version compatibility
- Ensure all dependencies are installed
- Clear
dist/and rebuild
- Check Electron version compatibility
- Verify IPC communication
- Check console for errors
- Check React DevTools
- Verify component state
- Check CSS variables