📄 app.go
GetServiceStatus(serviceName)- Cek status serviceStartService(serviceName)- Start serviceStopService(serviceName)- Stop serviceToggleService(serviceName, shouldStart)- Toggle on/off- Support: Linux (systemctl), macOS (brew), Windows (net)
📄 service_utils.go
CheckSudoAccess()- Cek sudo permissionGetSystemInfo()- Info sistem OS- Helper functions untuk command execution
📄 main.go
- Sudah ada, tidak perlu diubah
📄 App.tsx - Fully Integrated!
- ✅ Service management table (Apache & MySQL)
- ✅ Real-time status monitoring (every 5s)
- ✅ Toggle switches untuk start/stop
- ✅ Loading states dengan spinner
- ✅ Integrated logging system
- ✅ Auto-scroll logs
- ✅ Clear logs button
- ✅ Color-coded log levels
📄 app-layout.tsx
- ✅ Sidebar layout component
- ✅ Header dengan title
- ✅ Responsive design
📄 app-sidebar.tsx
- ✅ Navigation sidebar
- ✅ Version switcher
- ✅ Search form
📄 SETUP.md - Setup instructions 📄 IMPLEMENTATION_GUIDE.md - Complete implementation guide 📄 dev.sh - Development helper script
cd /home/kocan/Coding/LocalValet
# Cara tercepat (recommended)
wails dev
# Atau manual
wails generate module# Edit sudoers untuk allow systemctl tanpa password
sudo visudo
# Tambahkan (ganti 'kocan' dengan username Anda):
kocan ALL=(ALL) NOPASSWD: /bin/systemctl start *
kocan ALL=(ALL) NOPASSWD: /bin/systemctl stop *
kocan ALL=(ALL) NOPASSWD: /bin/systemctl status *
kocan ALL=(ALL) NOPASSWD: /bin/systemctl is-active *# Menggunakan script helper
chmod +x dev.sh
./dev.sh
# Atau langsung
wails dev-
Lihat Status Service
- Status akan auto-update setiap 5 detik
- Badge hijau = Active, abu-abu = Inactive
-
Start/Stop Service
- Toggle switch untuk on/off
- Lihat loading spinner saat proses
- Cek logs untuk hasil operasi
-
Monitor Logs
- Semua operasi tercatat di logs
- Color-coded: Info (biru), Success (hijau), Warning (kuning), Error (merah)
- Auto-scroll ke log terbaru
- Click trash icon untuk clear logs
Linux (Ubuntu/Debian):
serviceName: "apache2"; // untuk Apache
serviceName: "mysql"; // untuk MySQLmacOS (Homebrew):
serviceName: "httpd"; // untuk Apache
serviceName: "mysql"; // untuk MySQLWindows:
serviceName: "Apache2.4"; // untuk Apache
serviceName: "MySQL80"; // untuk MySQLLocalValet/
├── app.go # Backend logic
├── service_utils.go # Helper functions
├── main.go # Entry point
├── dev.sh # Development script
├── SETUP.md # Setup guide
├── IMPLEMENTATION_GUIDE.md # Full guide
├── frontend/
│ └── src/
│ ├── App.tsx # Main app with service management
│ └── components/
│ ├── app-layout.tsx # Layout component
│ ├── app-sidebar.tsx # Sidebar navigation
│ └── ui/ # shadcn components
└── wailsjs/
└── go/
└── main/
└── App.js # Generated bindings (after wails dev)
- Start/Stop Apache
- Start/Stop MySQL
- Real-time status monitoring
- Loading states
- Error handling
- Timestamp setiap log
- Log levels (info, success, warning, error)
- Color-coded display
- Auto-scroll
- Clear logs
- Sidebar navigation
- Responsive layout
- Loading spinners
- Status badges
- Clean design dengan shadcn/ui
# Solution:
wails generate module
# Atau restart dev server# Test sudo access:
sudo -n systemctl status apache2
# Setup sudoers (lihat Step 2)- Cek service name sesuai OS
- Cek logs di UI untuk error detail
- Test manual:
sudo systemctl start apache2
- Cek browser console
- Pastikan wails dev running
- Restart dev server
-
Add More Services
- PostgreSQL
- Redis
- Nginx
- PHP-FPM
-
Enhanced Features
- Restart service button
- Service configuration viewer
- Port management
- Service dependencies
- Auto-start on boot
-
Advanced Logging
- Export logs to file
- Filter logs by level
- Search in logs
- Tail service logs (journalctl)
-
System Info
- Resource usage (CPU, Memory)
- Disk space
- Network stats
- Service uptime
- Wails: https://wails.io/docs/introduction
- shadcn/ui: https://ui.shadcn.com
- React: https://react.dev
- TypeScript: https://www.typescriptlang.org
- systemctl: https://www.freedesktop.org/software/systemd/man/systemctl.html
- Development: Gunakan
wails devuntuk hot-reload - Debugging: Check browser console dan logs UI
- Testing: Test service commands di terminal dulu
- Security: Untuk production, gunakan proper service management
- Performance: Status check 5s sudah optimal
- Baca
IMPLEMENTATION_GUIDE.mduntuk detail teknis - Baca
SETUP.mduntuk setup instructions - Check Wails documentation
- Test commands manually di terminal
Status: ✅ Ready to Use! Platform: Linux (primary), macOS, Windows Framework: Wails v2 + React + TypeScript + shadcn/ui