Quick Start (UI)
Get the visual UI running in under 5 minutes.
Prerequisites
Verify installation:
node --version # Should show v18.x.x or higher
go version # Should show go1.21.x or higher Step 1: Clone the Repository
git clone https://github.com/dtrules/dtrules.git
cd DTRules Step 2: Start the Backend
Open a terminal and run:
cd go
go run ./cmd/api You should see:
DTRules API Server starting on :8080 Leave this terminal running.
Step 3: Start the Frontend
Open a new terminal and run:
cd ui
npm install # First time only - installs dependencies
npm run dev You should see:
VITE v5.x.x ready in xxx ms
➜ Local: http://localhost:5173/ Step 4: Open the UI
- Open your browser to http://localhost:5173
- You'll see the DTRules welcome screen
Step 5: Open a Project
Click "Start Tutorial" or "Open Sample Project" to load the CHIP sample project.
Alternatively, click "Open Custom Project" and enter the path to a DTRules project:
| OS | Example Path |
|---|---|
| Linux | /home/username/DTRules/sampleprojects/CHIP/xml |
| macOS | /Users/username/DTRules/sampleprojects/CHIP/xml |
| Windows | C:\Users\username\DTRules\sampleprojects\CHIP\xml |
Tip: Use the absolute path to your cloned DTRules repository.
Step 6: Explore
Once the project loads, you can:
- Left Panel - Browse entities and decision tables
- Entity Tab - View/edit entity definitions (EDD)
- Decision Table Tab - View/edit decision tables with color-coded cells
- Test Tab - Execute rules with test data and see traces
- Tree Tab - Visualize decision table call hierarchy
Architecture
┌─────────────┐ HTTP ┌─────────────┐
│ Browser │◄────────────►│ Go Backend │
│ (React UI) │ :5173 │ (API) │
│ │ │ :8080 │
└─────────────┘ └──────┬──────┘
│
▼
┌─────────────┐
│ XML Files │
│ (EDD, DT) │
└─────────────┘ Troubleshooting
"Failed to fetch" or "Network Error"
The backend isn't running. Make sure you started it:
cd go
go run ./cmd/api "npm install" fails
Try clearing the cache:
cd ui
rm -rf node_modules package-lock.json
npm install Port already in use
Backend (8080):
# Find and kill the process using port 8080
lsof -i :8080
kill <PID> Frontend (5173):
# Vite will automatically try the next port (5174, etc.)
# Or kill the existing process
lsof -i :5173
kill <PID> Project won't open
- Verify the path exists and contains
*_edd.xmland*_dt.xmlfiles - Use an absolute path (starting with
/on Linux/Mac orC:\on Windows) - Check the backend terminal for error messages
Quick Reference
| Action | Command |
|---|---|
| Start backend | cd go && go run ./cmd/api |
| Start frontend | cd ui && npm run dev |
| Build frontend | cd ui && npm run build |
| Run Go tests | cd go && go test ./... |
| Type check UI | cd ui && npm run typecheck |
Next Steps
- Explore the CHIP Tutorial to understand DTRules concepts
- Read about Decision Tables
- Check the Operator Reference