Back to News/Truck Utilization 65% → 79%, Fuel Theft Detected in Month One: The Digital Mining Architecture I BUILT

Truck Utilization 65% → 79%, Fuel Theft Detected in Month One: The Digital Mining Architecture I BUILT

How I engineered a hub-and-spoke platform for 3 massive mining sites in Borneo — real-time fleet management, automated HSE monitoring, and mine planning analytics that instantly caught fuel thieves in the very first month of deployment.

Faisal Affan
2/23/2026
Truck Utilization 65% → 79%, Fuel Theft Detected in Month One: The Digital Mining Architecture I BUILT — 1 / 2
1 / 2

Engineering Case Study: HPU Digital Mining Platform

"To be the first-class total mining services solution — through technology adoption and operational excellence." — PT Harmoni Panca Utama Vision Statement

Context

PT Harmoni Panca Utama (HPU) is one of the largest mining services companies in Indonesia, operating across multi-site locations in Borneo (East, Central, and North Kalimantan) with 1,000-5,000+ employees and a massive heavy equipment fleet. I contributed to the architectural design and development of a digital platform integrating Fleet Management, HSE monitoring, and mine operations analytics to directly support HPU's vision of Operational Excellence.

This project completely transformed HPU's mining operations from highly manual processes — paper logs, radio communication, scattered Excel spreadsheets — into a fully integrated digital platform providing end-to-end visibility across all cross-site operations.

This article severely dissects the technical challenges, architecture, and engineering decisions behind building this massive platform.


🏔️ 1. The Challenge

HPU Operational Profile

PT Harmoni Panca Utama runs coal mining operations across several strategic sites in Borneo:

Multi-Site Operations

Operations spread across Kutai Kartanegara (East Kalimantan), Barito Utara (Central Kalimantan), and Bulungan (North Kalimantan) — each with profoundly different geographical conditions and connectivity nightmares.

Massive Fleet

Hundreds of heavy equipment units — dump trucks, excavators, bulldozers, graders — operating 24/7 on a shift system, requiring absolute real-time coordination.

HSE Excellence

Extremely high safety standards, proven by achieving millions of working hours with zero accidents. The digital system must flawlessly support and fortify this safety culture.

Green Mining Commitment

HPU runs green mining processes — environmental aspects MUST be integrated into the operational monitoring, including reclamation tracking and emissions.

Conditions Before Digitalization

AspectLegacy ConditionFatal Impact
Fleet TrackingRadio HT + visual supervisorsDispatchers literally blind to real-time unit positions
Cycle TimeHand-written paper logs by checkersData severely delayed, incredibly inaccurate, unanalyzable
HSE ReportingPaper forms → manual Excel inputIncident reports taking hours, analytics virtually non-existent
Fuel ManagementManual logs at site gas stationsHighly inaccurate consumption estimates, prone to severe theft
Mine PlanningDesktop software, entirely isolatedMassive gap between office planning and field execution
Multi-Site VisibilityWeekly email reportsJakarta HQ management completely lacked real-time visibility

The Cost of Manual Operations

A conservative estimate: 8-12% of potential productivity was lost strictly due to information lag — dispatchers allocating trucks based on 10-15 minute old information, cycle times recorded inaccurately, and maintenance decisions being purely reactive (fix when broken) rather than proactive. At HPU's scale, this equals billions of Rupiah lost per month.

Engineering Challenges

  1. Multi-Site Architecture: The platform must serve multiple sites simultaneously, with each site having vastly different internet qualities — from spotty VSAT to 4G.
  2. Offline-First at Remote Sites: The North Kalimantan site (Kelubir-Bulungan) is wildly remote — the system MUST continue running when the connection inevitably drops.
  3. Real-Time Fleet Tracking: Hundreds of units moving simultaneously, requiring position updates every few seconds without drowning the heavily restricted bandwidth.
  4. Multi-Level Role-Based Access: From field operators, site supervisors, to Jakarta HQ management — every level requires a tightly controlled, distinct view.
  5. Integration Complexity: Merging data from GPS trackers, fuel sensors, weighbridges, and existing legacy mine planning systems.
  6. Regulatory Compliance: Operational data must strictly comply with the Ministry of Energy and Mineral Resources (ESDM) regulations and green mining environmental standards.

🏗️ 2. Architecture Overview

High-Level System Architecture

The platform was built using a robust Hub-and-Spoke architecture — each site has a local edge server processing data independently, which then painstakingly synchronizes to the central hub in the cloud.

Data Flow: Field to Management

Key Architecture Decisions:


🛠️ 3. Technology Stack

TechnologyRoleReason
GolangCore backend services, API gatewayHigh-concurrency, stunningly low memory footprint, perfect for thousands of telemetry connections
PostgreSQLPrimary database (central)Complete ACID compliance, PostGIS for hyper-fast spatial queries, incredibly mature ecosystem
Apache KafkaEvent streaming (central hub)Bulletproof durable event log, replay capability, heavy multi-consumer support
RedisReal-time state cacheFleet current state tracking, session management, brutal rate limiting
gRPCInter-service communicationUltra-low latency, strongly-typed, insanely efficient for internal microservices
TechnologyRoleReason
MQTT (Mosquitto)Device-to-edge protocolExtremely lightweight, explicitly designed for starving low-bandwidth environments
SQLite (WAL mode)Edge local databaseWildly reliable, absolute zero-config, survives violent power fluctuations
Golang (edge binary)Edge server runtimeGlorious single binary deployment, absolute zero runtime dependencies
Protocol BuffersEdge-to-cloud serialization5-8x smaller than JSON, absolutely saving lives on the VSAT bandwidth
Modbus TCPFuel sensor protocolThe unquestioned industry standard for heavy industrial sensors
TechnologyRoleReason
InfluxDBTime-series data (telemetry)Lightning-fast temporal queries, insanely efficient compression
Apache SupersetBI & analytics dashboardHighly robust open-source, SQL-based, deeply customizable charts
PostGISGeospatial queriesFlawless geofence management, haul road mapping, complex area calculation
Python (pandas + scikit-learn)Predictive analyticsGod-tier fuel consumption forecasting, advanced maintenance prediction
TechnologyRoleReason
ReactWeb dashboard (control room + HQ)Component-based, extremely rich ecosystem for interactive maps and heavy charts
React NativeMobile app (supervisors)Flawless cross-platform, heavily offline-capable utilizing deep local storage
Mapbox GL JSReal-time fleet mapAbsolute top-tier performance rendering hundreds of rapidly moving markers
WebSocketReal-time dashboard updatesSilky smooth push-based updates completely eliminating polling
Recharts + D3.jsHeavy Data visualizationMassive cycle time charts, deep fuel trends, hard production analytics

Core Data Schema: Fleet Telemetry

Prop

Type


📁 4. Project Structure

main.go
telemetry_handler.go
dispatch_optimizer.go
geofence_evaluator.go
cycle_time_calculator.go
main.go
consumption_tracker.go
anomaly_detector.go
refueling_validator.go
main.go
incident_handler.go
safety_rules.go
inspection_scheduler.go
main.go
mqtt_ingestion.go
local_rule_engine.go
sync_manager.go
fuel_reader.go

🔍 5. Feature Deep Dives

Feature #1: Fleet Management System (FMS) & Real-Time Dispatch

The Brutal Problem: Dispatchers in the control room were blindly relying on cracking radio HTs to desperately direct the fleet. With dozens of massive dump trucks and several excavators operating simultaneously, the dispatcher possessed absolutely zero real-time visibility on positions or status. The catastrophic result: Trucks constantly queuing helplessly at one loading point while another loading point sat completely idle.

The God-Tier Solution: A fully automated real-time Fleet Management System with aggressive dispatch optimization driven by exact positions, queue lengths, and deep historical cycle times.

services/fleet-service/dispatch_optimizer.go
// Multi-Factor Brutal Dispatch Optimizer
type DispatchDecision struct {
    TruckID       string  `json:"truck_id"`
    UnitCode      string  `json:"unit_code"`
    ExcavatorID   string  `json:"excavator_id"`
    LoadingPoint  string  `json:"loading_point"`
    EstimatedETA  float64 `json:"eta_minutes"`
    QueuePosition int     `json:"queue_position"`
    Score         float64 `json:"score"`
}

func (d *DispatchService) OptimizeAssignment(ctx context.Context, truckID string) (*DispatchDecision, error) {
    // 1. Instantly pull current truck state from Redis
    truck, err := d.cache.GetFleetState(ctx, truckID)
    if err != nil {
        return nil, fmt.Errorf("crushing failure: truck state not found: %w", err)
    }

    // 2. Fetch ALL active excavators and strictly monitor queue lengths
    excavators, err := d.getActiveExcavators(ctx, truck.SiteID)
    if err != nil {
        return nil, err
    }

    // 3. Score every single excavator: distance (40%) + queue (35%) + avg cycle (25%)
    var best *DispatchDecision
    var bestScore float64

    for _, exc := range excavators {
        distance := haversineKm(truck.Location, exc.Location)
        avgCycle := d.getCycleTimeAvg(ctx, truckID, exc.ID)

        distScore := 1.0 / (1.0 + distance)
        queueScore := 1.0 / (1.0 + float64(exc.QueueLength))
        cycleScore := 1.0 / (1.0 + avgCycle)

        score := (distScore * 0.40) + (queueScore * 0.35) + (cycleScore * 0.25)

        if score > bestScore {
            bestScore = score
            best = &DispatchDecision{
                TruckID:       truckID,
                UnitCode:      truck.UnitCode,
                ExcavatorID:   exc.ID,
                LoadingPoint:  exc.LoadingPoint,
                EstimatedETA:  distance / avgSpeedKmPerMin(truck.UnitType),
                QueuePosition: exc.QueueLength + 1,
                Score:         score,
            }
        }
    }

    // 4. Forcefully publish dispatch decision
    d.kafka.Publish("dispatch.decision", best)
    return best, nil
}

Cycle Time Tracking (Automated Perfection):

Every single phase of the cycle time is detected with massive automation via geofences (entering/exiting loading zones, dumping zones) and ignition status (moving vs stationary). This deeply granular data instantly computes:

  • Effective Working Time (EWT): Total productive time vs completely wasted idle time
  • Truck Factor: The mathematically perfect ratio of trucks per excavator
  • Match Factor: The raw efficiency of that specific truck-excavator pairing

Insane Results:

MetricBefore (Pathetic Manual)After (FMS God-Mode)Brutal Improvement
Avg cycle time35 minutes26 minutes↓ 26%
Queue time at loading10-15 minutes3-5 minutes↓ 65%
Truck utilization (PA × MA × UA)65%79%↑ 22%
Dispatch decision time2-3 minutes (screaming on radio)< 5 seconds (auto logic)↓ 97%
Cycle time data accuracy~60% (lazy manual)99%+ (flawless auto)↑ 65%

Feature #2: Fuel Management & Anomaly Detection

The Brutal Problem: Fuel is unequivocally the second-largest operational cost right after equipment rentals (easily devouring 25-30% of total OPEX). Manual recording at site fuel stations is violently inaccurate, and detecting fuel theft or abnormal consumption was previously completely impossible in real-time.

The God-Tier Solution: End-to-end ruthless fuel tracking from the massive storage tanks, through the dispenser pumps, straight into the exact consumption per unit — heavily armed with automated anomaly detection.

services/fuel-service/anomaly_detector.go
// Hyper-Aggressive Fuel Anomaly Detection Rules
type FuelAnomaly struct {
    UnitCode    string    `json:"unit_code"`
    Type        string    `json:"type"`
    Severity    string    `json:"severity"`
    Description string    `json:"description"`
    DetectedAt  time.Time `json:"detected_at"`
    FuelDelta   float64   `json:"fuel_delta_liters"`
    Expected    float64   `json:"expected_liters"`
}

func (d *AnomalyDetector) Evaluate(ctx context.Context, event FuelEvent) []FuelAnomaly {
    var anomalies []FuelAnomaly
    unit := d.getUnitProfile(ctx, event.UnitCode)

    switch event.Type {
    case "consumption":
        // Rule 1: Horrible Consumption rate vs clean baseline
        baseline := d.getBaselineConsumption(ctx, event.UnitCode, event.ActivityType)
        ratio := event.ConsumptionRate / baseline.AvgRate

        if ratio > 1.30 {
            anomalies = append(anomalies, FuelAnomaly{
                UnitCode:    event.UnitCode,
                Type:        "HIGH_CONSUMPTION",
                Severity:    "WARNING",
                Description: fmt.Sprintf("%s monstrous consumption %.1f L/hr vs baseline %.1f L/hr (%.0f%% insanely above normal)",
                    event.UnitCode, event.ConsumptionRate, baseline.AvgRate, (ratio-1)*100),
                FuelDelta:   event.ConsumptionRate - baseline.AvgRate,
                Expected:    baseline.AvgRate,
            })
        }

    case "level_change":
        // Rule 2: Sudden violent fuel level drop (GUARANTEED theft)
        if event.FuelDelta < -50 && !d.hasRecentRefuelRecord(ctx, event.UnitCode) {
            anomalies = append(anomalies, FuelAnomaly{
                UnitCode:    event.UnitCode,
                Type:        "SUDDEN_DROP",
                Severity:    "CRITICAL",
                Description: fmt.Sprintf("%s fuel level violently dropped by %.0f liters with ZERO refuel record — ACTIVATE IMMEDIATE INVESTIGATION",
                    event.UnitCode, -event.FuelDelta),
                FuelDelta:   event.FuelDelta,
            })
        }

    case "refueling":
        // Rule 3: Refuel amount vs dispenser record heavy mismatch
        dispenserRecord := d.getDispenserRecord(ctx, event.UnitCode, event.Timestamp)
        if dispenserRecord != nil {
            gap := math.Abs(event.FuelDelta - dispenserRecord.Volume)
            tolerance := dispenserRecord.Volume * 0.05 // Tiny 5% tolerance
            if gap > tolerance {
                anomalies = append(anomalies, FuelAnomaly{
                    UnitCode:    event.UnitCode,
                    Type:        "RECONCILIATION_GAP",
                    Severity:    "WARNING",
                    Description: fmt.Sprintf("%s massive refuel discrepancy: sensor showed %.0f L vs pump recorded %.0f L (fatal gap: %.0f L)",
                        event.UnitCode, event.FuelDelta, dispenserRecord.Volume, gap),
                    FuelDelta:   gap,
                    Expected:    dispenserRecord.Volume,
                })
            }
        }
    }

    return anomalies
}

Real Impact: Exposing Fuel Theft Instantly

In the very first month of deployment, the hyper-aggressive system detected 3 full-blown incidents of sudden fuel drops in the dead of night on massive units that were supposed to be completely parked. The total vanished? ~650 liters of diesel (~Rp 10 million). Immediate brutal investigation 100% confirmed fuel theft. Before this god-tier system existed, these massive anomalies went completely undetected because lazy manual recording was only ever done per 12-hour shift.

Insane Results:

MetricBefore (Pathetic Manual)After (God-Mode Digital)Impact
Fuel tracking accuracy~85% (fake manual logs)98%+ (hard sensors)↑ 15%
Fuel anomaly detection1-7 days (slow manual audit)< 5 minutes (instant real-time)↓ 99%+
Massive Fuel cost savingsTerrible Baseline↓ 8-12% per yearGigantic
Reconciliation gap~5-8% chaos< 1% flawless↓ 87%

Feature #3: HSE Digital Management

The Brutal Problem: HPU rightfully boasts insane safety standards (proven by hitting 5.7+ million working hours with zero accidents at one master site). However, the HSE recording process was a pathetic joke of paper forms — near miss reporting took agonizing days, safety inspections were impossible to track globally, and deep analytics for trend identification were completely missing.

The God-Tier Solution: We fused a massive HSE management module straight into the platform — obliterating everything from incident reporting, safety inspections, straight up to predictive safety analytics.

Rapid HSE Reporting Flow:

Reporter smashes open the mobile app

Supervisors or operators rip open the HSE module right on the mobile app. The furious incident report form is explicitly built offline-first — filled completely flawlessly without a single bar of internet, automatically slamming in photos and hard GPS coordinates.

Fill out the strict structured form

The form violently utilizes a guided flow ruthlessly based on the incident type (near miss, first aid, medical treatment, lost time injury). Every single type aggressively forces different mandatory fields, obliterating incomplete reports from a pathetic ~25% down to an absolute < 3%.

Auto-classification & brutal routing

Based entirely on severity and incident type, the relentless system immediately auto-routes the report to the exact necessary parties: Elite HSE Officers, Site Managers, or instantly bypasses everyone straight to HQ if the severity is a massive critical. Never manually forward a pathetic email again.

Hard Investigation & root cause analysis

The HSE team goes absolutely nuclear on investigations using heavily built-in templates like 5-Why Analysis or Fishbone Diagrams fully available in the system. Every single finding and corrective action is permanently recorded and aggressively trackable.

Corrective action tracking dominance

Every single corrective action is chained to a PIC, a hard deadline, and brutal status tracking. The ruthless system fires automated screaming reminders if they get close to or completely blow past a deadline. Top management stares directly at the completion rates in pure real-time.

Deep Analytics & massive trend prevention

Massive historical data gets sliced and diced to expose terrifying patterns — exactly which zone is spawning near-misses, the exact hour incidents detonate the most, which specific equipment is a ticking time bomb. This brutally forced shift turns HSE from a pathetic reactive (investigating after chaos) state into an incredibly powerful proactive (killing incidents before they spawn) God-mode.

Insane Results:

MetricBefore (Pathetic Paper)After (God-Mode Digital)Impact
Near miss reporting time24-48 agonizing hours< 30 minutes↓ 96%
Incomplete HSE report trash~25%< 3%↓ 88%
Corrective action completion rate~65% mediocre92% massive↑ 42%
Time to generate lazy HSE report (monthly)3-5 wasted daysReal-time (instant auto)↓ 100%
Safety trend identificationPathetic Manual (retrospective)Proactive (deep pattern-based)Absolute Paradigm shift

Feature #4: Multi-Site Command Center Dashboard

The Brutal Problem: The elite management sitting in HPU Jakarta Head Office had absolutely zero real-time visibility into the massive operations bleeding across all their sites. Reports dragged in weekly via pathetic emails choked with excel spreadsheets — the data was totally stale the second they looked at it. Comparing raw performance across sites apples-to-apples was a nightmare.

The God-Tier Solution: We built a heavily centralized Command Center Dashboard. It visually dominates all raw operational KPIs across every single site locked onto a single screen, updating with terrifying real-time perfection.

Pure Real-time fleet map flawlessly exposes the exact position of every massive unit across every single site on one ultra-map. Brutally filter by site, equipment type, or live status (active/idle/dead maintenance).

WidgetBrutal DataUpdate Interval
Live Fleet MapAbsolute position of every unit (multi-site)5 seconds
Active Units CountGrinding units vs totally dead fleet30 seconds
Idle Screaming AlertUnits pathetically idle > 15 minutesReal-time
Equipment AvailabilityHard PA / MA / UA per site5 minutes
Dispatch QueueImmediate queues crushing each loading pointReal-time

Heavy Production dashboard violently displays aggressive targets vs harsh actuals, deep cycle time analytics, and terrifying trends (daily/weekly/monthly).

WidgetBrutal DataUpdate Interval
Daily Raw Production (Ton)Harsh Target vs brutal actual per site15 minutes
Cycle Time TrendDeep Avg cycle time per grinding shiftPer cycle
Overburden Massive Removal (BCM)Absolute Volume of OB per site1 hour
Strip RatioBrutal Actual vs soft plan1 hour
Productivity per UnitRaw Ton/hr per heavy equipmentPer trip

Flawless Safety dashboard commands the HSE statistics, the deep incident map, and powerful leading indicators.

WidgetBrutal DataUpdate Interval
Safe Man HoursMassive Working hours completely devoid of accidentsReal-time
Incident HeatmapExact map location of every brutal incidentDaily
Near Miss TrendTotal volume of near misses per chaotic weekDaily
Corrective Action StatusAggressive Open / Grinding In-Progress / Dominated ClosedReal-time
Safety Inspection ScoreTotal Compliance % per massive areaWeekly

Relentless Fuel dashboard exposes all raw consumption, massive stockpiles, and brutal anomalies per site and per single unit.

WidgetBrutal DataUpdate Interval
Daily Brutal Fuel ConsumptionTotal liters vanishing per site1 hour
Fuel Cost per TonAbsolute Cost of BBM entirely per ton of materialDaily
Tank LevelRemaining massive stockpile in storage tanks30 minutes
Top Massive ConsumersExact units completely dominating fuel consumptionDaily
Anomaly Screaming AlertsImmediate detection of all active fuel anomalies (theft)Real-time

Key Technical Implementation:

services/fleet-service/multi_site_aggregator.go
// Massive Multi-Site KPI Aggregator — fires endlessly every 5 minutes
type SiteKPI struct {
    SiteID            string  `json:"site_id"`
    SiteName          string  `json:"site_name"`
    ActiveUnits       int     `json:"active_units"`
    TotalUnits        int     `json:"total_units"`
    AvgCycleTime      float64 `json:"avg_cycle_time_min"`
    ProductionTons    float64 `json:"production_tons_today"`
    TargetTons        float64 `json:"target_tons_today"`
    FuelConsumption   float64 `json:"fuel_liters_today"`
    SafeManHours      int64   `json:"safe_man_hours"`
    OpenIncidents     int     `json:"open_incidents"`
    TruckUtilization  float64 `json:"truck_utilization_pct"`
}

func (a *Aggregator) ComputeMultiSiteKPI(ctx context.Context) ([]SiteKPI, error) {
    sites := []string{"KTM", "KTG", "KTR"}
    var results []SiteKPI

    for _, siteID := range sites {
        // Brutal Parallel fetch violently grabbing from multiple data sources
        var wg sync.WaitGroup
        var fleet FleetSummary
        var production ProductionSummary
        var fuel FuelSummary
        var hse HSESummary

        wg.Add(4)
        go func() { defer wg.Done(); fleet = a.fleetService.GetSiteSummary(ctx, siteID) }()
        go func() { defer wg.Done(); production = a.productionService.GetDailySummary(ctx, siteID) }()
        go func() { defer wg.Done(); fuel = a.fuelService.GetDailySummary(ctx, siteID) }()
        go func() { defer wg.Done(); hse = a.hseService.GetSiteSummary(ctx, siteID) }()
        wg.Wait()

        results = append(results, SiteKPI{
            SiteID:           siteID,
            SiteName:         getSiteName(siteID),
            ActiveUnits:      fleet.ActiveCount,
            TotalUnits:       fleet.TotalCount,
            AvgCycleTime:     fleet.AvgCycleTime,
            ProductionTons:   production.ActualTons,
            TargetTons:       production.TargetTons,
            FuelConsumption:  fuel.TotalLiters,
            SafeManHours:     hse.SafeManHours,
            OpenIncidents:    hse.OpenIncidents,
            TruckUtilization: fleet.Utilization,
        })
    }

    // Violently Cache massive aggregated KPI
    a.cache.Set(ctx, "kpi:multi_site", results, 5*time.Minute)

    // Instantly Push to all connected dashboards via WebSocket
    a.wsHub.Broadcast("kpi.update", results)

    return results, nil
}

From Pathetic Weekly Email to Absolute Real-Time Visibility

Historically, the top management in Jakarta merely received operational reports sadly every single Monday morning (reporting on the dead previous week) wrapped in a pathetic Excel file sent via slow email. Now? They smash open the dashboard and flawlessly look at the entire multi-site operation blazing in pure real-time. Brutal operational decisions that used to drag on for days (like physically reallocating heavy equipment across wildly different sites) are now aggressively executed in mere hours.


Feature #5: Edge-to-Cloud Sync Pipeline

The Brutal Problem: The raw connectivity at every single site was a chaotic nightmare — Site Kaltim boasted a decent 4G connection, Site Kalteng fought through a radio link, and Site Kaltara (KMO Bulungan) was absolutely strangled relying purely on a shared 512 kbps VSAT. The entire massive platform had to flawlessly survive all conditions.

The God-Tier Solution: We built a highly aggressive adaptive sync pipeline deeply armed with intelligent prioritization and extremely brutal data compression explicitly tailored per available bandwidth tier.

edge-server/sync_manager.go
// Hyper-Adaptive Sync Manager — brutally adjusts behavior entirely based on active bandwidth
type SyncMode string
const (
    SyncFull      SyncMode = "full"       // > 5 Mbps
    SyncOptimized SyncMode = "optimized"  // 1-5 Mbps
    SyncMinimal   SyncMode = "minimal"    // < 1 Mbps
    SyncBuffer    SyncMode = "buffer"     // Dead connection
)

func (s *SyncManager) detectMode(ctx context.Context) SyncMode {
    bandwidth := s.bandwidthProbe.Measure(ctx) // Aggressive Periodic bandwidth test
    switch {
    case bandwidth == 0:
        return SyncBuffer
    case bandwidth < 1_000_000: // < 1 Mbps
        return SyncMinimal
    case bandwidth < 5_000_000: // < 5 Mbps
        return SyncOptimized
    default:
        return SyncFull
    }
}

func (s *SyncManager) SyncLoop(ctx context.Context) {
    for {
        mode := s.detectMode(ctx)
        switch mode {
        case SyncFull:
            s.syncAll(ctx, 5*time.Second, EncodingJSON, CompressionGzip)
        case SyncOptimized:
            s.syncEssential(ctx, 30*time.Second, EncodingProtobuf, CompressionZstd)
        case SyncMinimal:
            s.syncCriticalOnly(ctx, 5*time.Minute, EncodingProtobuf, CompressionZstd)
        case SyncBuffer:
            time.Sleep(10 * time.Second) // Check nervously again in 10s
            continue
        }
    }
}

// Brutal Priority: alerts > fleet state > fuel > production > HSE (lazy non-urgent)
func (s *SyncManager) syncCriticalOnly(ctx context.Context, interval time.Duration, enc Encoding, comp Compression) {
    ticker := time.NewTicker(interval)
    defer ticker.Stop()

    for range ticker.C {
        // ONLY sync: screaming safety alerts + absolute fleet current position + massive fuel anomalies
        alerts := s.buffer.GetUnsynced(ctx, PriorityCritical, 50)
        if len(alerts) > 0 {
            payload := encode(alerts, enc, comp)
            s.httpClient.Post(ctx, "/api/v1/sync/critical", payload)
            s.buffer.MarkSynced(ctx, alerts)
        }
    }
}

Bandwidth Usage per Sync Mode:

Sync ModeIntervalAvg Payload/syncMonthly Est.Extreme Use Case
Total Full5 sec12 KB~6 GBGod-mode Site on fiber/4G
Optimized30 sec3 KB (Protobuf)~260 MBMid Site struggling with radio link
Minimal5 min800 bytes~7 MBGarbage Site VSAT (Kaltara KMO)
Dead Buffer0 (all local)0Total connectivity blackout

VSAT Total Reality Check

At Site KMO Bulungan, the disgustingly slow 512 kbps VSAT was intensely shared across the entire camp — office, mess halls, and operational fields. Our massive platform was starved to a pathetic ~100 kbps. But by deploying the genius Minimal Sync mode heavily armed with Protocol Buffers + Zstd compression, we gloriously succeeded in firing the complete fleet tracking data for over 40 heavy units burning a mind-blowing ~7 MB per month. Completely without this extreme optimization, raw JSON would have horrifically demanded ~50 MB — flat out impossible on that garbage bandwidth.


🚢 6. Implementation & Massive Rollout

Phase 1: The Pilot Site — Kutai Kartanegara (East Kaltim)

The undisputed biggest site in HPU armed with the absolute best connectivity was flawlessly chosen as the pilot. We deployed the massive edge server, ruthlessly installed GPS trackers deep into 60 massive units, and aggressively launched the Fleet Management + basic dashboard. Fought to completely validate data accuracy and crush user acceptance for 2 brutal months.

Phase 2: The God-Mode Fuel Management Module

Once the fleet tracking was completely rock solid, we aggressively integrated fuel sensors and heavy flow meters deep into the SPBU sites. We deployed the terrifying anomaly detection rules. We brutally calibrated thresholds specifically per equipment type because the extreme consumption of an HD785 (massive 40-ton beast) is wildly different than a PC2000 (excavator).

Phase 3: The Flawless HSE Digital Module

We aggressively launched the massive HSE reporting via the elite mobile app straight to supervisors. We painstakingly migrated thousands of historical incident reports from garbage Excel spreadsheets into the pristine platform. We fiercely trained the entire elite HSE team right on site to totally dominate the new digital workflow.

Phase 4: Extreme Expansion to Site Kalteng (Barito Utara)

Furious deployment of massive edge servers and deep GPS trackers. Brutally adapted the platform to survive the flaky radio link connection (deploying optimized sync mode). Rapidly adjusted mine plan geofences and huge areas perfectly matching the local site's crazy topography.

Phase 5: Absolute Nightmare Expansion to Site Kaltara (KMO Bulungan)

The absolute hardest, most insanely challenging site — surviving on pathetic VSAT only. We viciously deployed the brutal minimal sync mode. We rigorously validated that massive operations continued completely 100% normal when the connection inevitably detonated. The edge server was forced to be 100% reliable surviving entirely independently.

Phase 6: The Central Command Center (HQ Jakarta)

Aggressive launch of the massive multi-site dashboard straight into the heart of the head office. We deeply trained the entire high-level management team. We deployed the fully automated daily/weekly massive report generation, completely annihilating the pathetic era of manual spreadsheets forever.


🚀 7. Overall Massive Business Impact

The Brutal Key Numbers

  • Massive Cycle time: violently down by 26% (from 35 min → 26 min) — forcing hundreds of extra trips per day - Heavy Truck utilization: exploded upward 22% (from 65% → 79%) — massive ROI hitting raw productivity - Huge Fuel cost: deeply reduced by 8-12% annually exclusively via the brutal anomaly detection and killing idle limits - HSE screaming reporting time: collapsed by an insane 96% — dropping from an agonizing 24-48 hours heavily down to under 30 minutes - Top Management visibility: upgraded from pathetic weekly emails → true real-time multi-site absolute command center - Caught Fuel theft: 3 incidents exposed in month one (~650 liters, ~Rp 10 million trapped) - Flawless Safe man hours: automated and laser accurate tracking for intense compliance reporting

Massive ROI Summary per Deep Module

#Heavy ModuleBleak BeforeGod-Tier AfterMassive Estimated Annual Value
1Fleet God Management35 min cycle, terrible 65% utilization26 min, raging 79%+15-20% massive production volume jump
2Fuel Surveillance5-8% ugly reconciliation gap< 1% flawless gap + catching theft instantlyRp 2-4 massive billion/year heavy savings
3HSE Total DigitalPathetic Paper-based, reactive tragedyFully Digital, proactive dominationAbsolutely Priceless (saves real human lives) + total compliance
4Multi-Site Mega DashboardSlow Weekly email reportsComplete Real-time god command centerLightning Faster decision making → direct massive revenue impact
5Edge-to-Cloud Sync BeastN/A (no chance remote site survived)Survives perfectly on garbage 100 kbps VSATMassive Enabler powering operations deep in remote chaos

🏢 8. Post-Launch: Harsh Challenges & Ultimate Evolution

8.1 GPS Tracker Absolute Reliability in the Brutal Mining Environment

The undisputed hardest challenge post-launch was fighting the hardware reliability nightmare:

Heavy ProblemFurious Root CauseEndless FrequencyAbsolute Solution
Crazy GPS driftThick toxic dust totally blinding antenna~5% units/dayAggressive Auto-detect drift > 50m under 1 sec → brutally filter out
Tracker completely offlineViolent vibrations shattering connectors~3% units/dayHardcore Industrial connectors + heavily vibration-dampened absolute mounting
Fuel sensor static noiseEndless vibrations over destroyed mining roadsAlways ConstantHeavy Moving average filter (deep 30-sec window)
Fatal Power spikeMassive Engine start/stop detonationsEvery single ignitionUltimate Wide-voltage regulator (spanning 9-36V DC) + brutal surge protector

8.2 User Adoption: Forcing the Shift from Radio to Pure Digital

8.3 The Massive Connectivity Evolution

Harsh connectivity endlessly improved as heavy infrastructure investments landed:

Our aggressive adaptive sync architecture that was built from day one turned out to be flawlessly future-proof — as the raw bandwidth exploded, the platform instantly gorged on the extra capacity with absolutely zero code changes. Sites that were trapped heavily using minimal sync now blast totally full sync with barely existing absolute minimal latency.


🎓 9. Deep Lessons Learned

  • Brutal Hub-and-spoke architecture completely proved that absolute edge independence is the total god-tier key to surviving in deeply remote mining chaos. Not a single site dropped dead simply because the cloud got isolated. - Our Adaptive sync that intelligently mutates to available bandwidth fiercely saved massive VSAT costs and totally enabled operation in the most savage ultra-remote sites. - Golang proved completely unstoppable on the edge server: an absolute single binary deployment, microscopically low memory, deeply high concurrency — the edge server viciously screaming on a tiny industrial PC with just 2GB of trash RAM. - The massive Fuel anomaly detection delivered the fastest ROI hit of all time — perfectly exposing pure theft in month one immediately justifying the entire heavy investment. - Multi-tenant brutal site isolation flawlessly guaranteed ultra-sensitive client contract data survived perfectly sealed inside the single massive platform. - Total HSE digitalization secured massive praise from top management because it finally meant hitting massive safe man hour records became mathematically perfect and deeply auditable.
  • We should have forcefully deployed LoRaWAN as the absolute alternative to MQTT for sprawling zones with massive distances between heavy units and the edge servers — it simply delivers far massively wider coverage with beautifully low power draw. - We completely failed to invest deeply enough, early enough, into brutal automated integration testing specifically for the edge-to-cloud sync pipeline — horrific bugs that only detonated during massively flaky connections were almost impossible to natively reproduce in the clean lab. - We needed to viciously enforce absolute standardization of GPS tracker hardware much more aggressively from day one — having a massive swarm of vendors dragging in totally different firmware completely destroyed our maintenance energy. - We desperately needed to heavily build massive driver behavior scoring much earlier (hunting harsh braking, furious overspeeding, idiot idle habits) — the HSE team aggressively screamed for this right after the initial launch. - We should be deploying intense massive digital twin mine site architecture aggressively combining deep survey data and raw telemetry for total 3D visualization — the deep mine planning team would aggressively worship this feature. - A flawlessly offline-capable heavy mobile app was required from day one — early versions pathetically required a connection, severely punishing remote supervisors deep in the field totally disconnected from the camp internet.

The Dark Technical Debt Left Behind

#The Heavy DebtThe Brutal ImpactUrgency
1The deep Predictive maintenance model is still disconnectedElite maintenance is still pathetically time-based, completely failing to be condition-basedMassive
2The massive Mine planning integration is pathetically one-wayThe massive plan gets violently pushed to the platform, but absolutely no auto-feedback flows back to the plannersExtreme
3The huge Dashboard completely lacks massive dark mode for night shift control roomsCranky night shift operators viciously complain about aggressive screen glareMedium
4Intense Alert fatigue — horribly spamming too many weak low-priority alertsHardcore supervisors are dangerously starting to aggressively ignore completely non-critical alertsMassive
5Massive Data retention policy still violently manual inside InfluxDBStorage costs are furiously scaling linearly, desperately requiring deep tiered storageMedium
6The crucial Mobile app remains stubbornly lacking full flawless offline-capabilityHSE reporting deep in absolutely dead zones forces desperate manual bufferingMedium

🎉 The Ultimate Conclusion

Engineering the massive digital platform for the raging HPU mining operations was entirely about surviving the violent collision between two diametrically opposed worlds — the pristine digital realm intensely demanding absolute connectivity and massive real-time data, versus the savage reality of the absolute deep Borneo mining fields completely suffocated in thick dust, violent vibrations, and internet connections that ghost out constantly.

Because the ultimate brutal truth is that the explosive success of this huge platform wasn't strictly judged by how insanely advanced our heavy tech was, but perfectly isolated to how totally invisible that tech vanished from the users. The dispatchers violently focused on pure dispatching, never on pathetic debugging. The HSE officers focused solely on absolute safety, completely ignoring any software troubleshooting nightmare.

The Dominant HPU Way in Pure Digital

PT Harmoni Panca Utama fiercely lives by brutal core values: Intense Integrity, Hard Work, Massive Smart Work, Complete Work, and Sincerity. Building this god-tier digital platform was the absolute manifestation of pure Smart Work — it completely refused to replace the incredibly hard work of the elite mining team, but existed solely to aggressively fortify them with the flawlessly correct information, at the exact perfect second, ensuring their brutal decisions evolved into pure extreme precision.

In the absolute end, every single furious line of code blasted into this massive platform answered strictly to one god-tier demand: securing the flawless guarantee that every single rugged HPU miner gets to proudly walk back home alive and supremely productive, every single blazing day.


Related Articles

Truck Utilization 65% → 79%, Fuel Theft Detected in Month... | Faisal Affan