07/11
Case Study
New June 1, 2025 GovernmentKemenperinPHP

Business Matching — Kemenperin, Ministry of Industry

Three eras across 2024–2026 — the complete development history of Kemenperin’s Business Matching platform, from a PHP 5 monolith to the Svelte + Go + Python system running at bm-online.id today.

Year
2025
Focus
Government
Reading
6 min· 13 sections
Published
Web
Business Matching — Kemenperin, Ministry of Industry
Full Capture
Business Matching — Kemenperin, Ministry of Industry — detailed view

Project Overview

Business Matching is Kemenperin’s (Ministry of Industry, Republic of Indonesia) program for connecting Indonesian manufacturers and IKM actors with buyers, distributors, and export channels. The digital platform behind it has been rebuilt across three eras since 2024 — one era per year, each matching the technology of its moment while preserving the program’s core mission. This case study documents the full arc: the 2024 PHP 5 monolith, the 2025 transition year that carried both the PHP 8 modernization and the decoupled React + Hono architecture, and the current Svelte + Go + Python system running at bm-online.id.

"The program never stopped running through three years of rebuilds. Each era kept the matching workflow intact while the technology underneath changed entirely."

Engineering Notes Kemenperin Business Matching

The Evolution — 3 Eras, One Mission

Every rewrite preserved the program’s core workflow while replacing the foundation underneath it.

01

01. PHP 5 — The First Platform · 2024

The original Business Matching platform: a server-rendered PHP 5 monolith where company registration, product catalogs, and matchmaking requests all flowed through a single codebase backed by one MySQL database.

02

02. PHP 8 → React + Hono — The Decoupling Year · 2025

One year, two architectures: the PHP 8 modernization wrapped early in 2025 — typed internals, Composer, PDO, a real admin panel — then by December the platform split into a React SPA and a Hono TypeScript API, with JWT auth and PostgreSQL replacing sessions and MySQL.

03

03. SvelteKit + TypeScript → Go → Python — bm-online.id · 2026 — Present

The 2026 platform: a SvelteKit app server that owns auth, SSR, and writes — a Go backend mirroring the hot reads and running realtime aggregation — and Python services for embeddings and forecasting.

03 Eras

One era per year — 2024, 2025, and 2026.

2024–26 Service Window

Continuous operation across three calendar years and three eras.

05 Languages

PHP, TypeScript, Svelte, Go, and Python across the eras.

bm-online.id Live Platform

The current Svelte + Go + Python system in production.

The Timeline — Year by Year

Three eras, three different concepts — each year rebuilt the platform on a new stack.

2024 — The Monolith

PHP 5, server-rendered, one MySQL database. Company registration, product catalogs, and matching requests through a single codebase. Proved the model — industry would match online.

2025 — The Decoupling Year

Two rebuilds in one year: PHP 8 professionalized the monolith, then the platform split into a React SPA and a Hono TypeScript API — JWT auth, PostgreSQL, a real API contract.

2026 — The Constellation

SvelteKit serves, Go mirrors, Python thinks. A service constellation at bm-online.id — Neon Postgres, realtime aggregation, ML embeddings and forecasting behind one Go gateway.

Era 01 · 2024 — PHP 5 — The First Platform

The first incarnation of Business Matching for Kemenperin ran on PHP 5 — a classic server-rendered monolith where every page was generated on request. IKM (small & medium industry) actors could register a company, list products in a catalog, and submit matching requests ahead of ministry-run business matching events. It did the job. Manufacturers adopted a digital matching channel for the first time, and ministry staff gained an admin view over participants. But the stack was aging fast: no dependency isolation, legacy mysql_* patterns in places, and an increasingly brittle deployment on shared hosting. Recap — Proved the model — industry would match online — but the runtime had no headroom left.
Business Matching PHP 5 — early interface, February 2024

Early PHP 5 interface — February 2024

Business Matching PHP 5 — platform view, March 2024

PHP 5 platform — March 2024

Business Matching PHP 5 — admin view, March 2024

PHP 5 admin — March 2024

Era 02 · 2025 — PHP 8 → React + Hono — The Decoupling Year

The middle year carried two rebuilds. Early 2025 finished the PHP 8 modernization the previous era started — same monolith shape, professional internals: typed function signatures, Composer-managed dependencies, PDO prepared statements, tests covering the critical paths, and a dedicated admin panel for curating participants, approving companies, and scheduling one-on-one matching sessions. By the end of the year the system split in two: a React single-page app for participants and a Hono-powered TypeScript API serving the data. JWT-based auth replaced server sessions, PostgreSQL replaced MySQL, and the matching workflow became an explicit API contract instead of implicit page logic. Decoupling unlocked a genuinely mobile-friendly experience for factory-floor users and let the API serve more than one consumer — at the cost of two codebases, two deploy pipelines, and validation rules duplicated on both sides. Recap — The monolith professionalized, then decoupled — a real API and a real SPA, at the price of double the maintenance.
Business Matching PHP 8 — dashboard, January 2025

PHP 8 dashboard — January 2025

Business Matching PHP 8 — company management

Company management

Business Matching PHP 8 — matching workflow

Matching workflow

Business Matching PHP 8 — event scheduling

Event scheduling

Business Matching PHP 8 — participant list

Participant list

Business Matching PHP 8 — reports

Reports

Business Matching PHP 8 — settings

Settings

Business Matching PHP 8 — February 2025 view

PHP 8 platform — February 2025

Business Matching React — participant home, December 2025

React participant app — December 2025

Business Matching React — company profile

Company profile, decoupled

Business Matching React — matching interface

Matching interface

Business Matching React — directory view

Directory view

Business Matching React — detail view

Detail view

Business Matching React + Hono — December 2025

React + Hono — December 2025

Business Matching React + Hono — dashboard

React dashboard

Business Matching React + Hono — final build

React + Hono final build

Era 03 · 2026 — Present — SvelteKit + TypeScript → Go → Python — bm-online.id

Era four is the current production system at bm-online.id — a service constellation, not another monolith. SvelteKit is the primary application server: it owns Better Auth sessions, SSR, the public REST API, and every write to Neon Postgres via Drizzle. The Go backend mirrors the hot read paths at higher throughput and runs the realtime aggregation layer — a 3-second watermark poller feeding Phoenix Channels and SSE. Python owns the compute-heavy ML work through two dedicated services: ONNX embeddings behind a Rust LRU/TTL cache for codification similarity, and a Prophet forecast service with Indonesian holiday regressors. Go calls them over typed internal APIs and stays the single public gateway — one binary in front, purpose-built services behind. The screenshots below are the live public analytics surface — procurement demand rendered straight from production data: 61 categories and 1,003+ items across Barang, Jasa, and Lainnya, with the distribution charts the realtime layer keeps current. Recap — Not a rewrite — a constellation. SvelteKit serves, Go mirrors, Python thinks.
Business Matching Online — live procurement category dashboard, November 2026

bm-online.id — procurement categories, November 2026

Business Matching Online — category distribution, 61 categories and 1,003 items

Category distribution — 61 categories, 1,003 items

Business Matching Online — procurement distribution by type

Distribution by type — Barang, Jasa, Lainnya

System Architecture — Era 03 in Production

The 2026 platform is a service constellation, not a monolith. SvelteKit is the primary application server — it owns auth, SSR, the public REST API, and every write to the database. The Go backend mirrors the hot read paths at higher throughput and runs the realtime aggregation layer. Python owns the compute-heavy ML work through two dedicated services. Everything sits behind Cloudflare (WAF, rate limits, R2 CDN). Neon Postgres is the single source of truth — pgvector for embedding similarity, pg_trgm for code search. The full engineering document lives in the repository at src/lib/contents/kemenperin/business-matching/ARCHITECTURE.md.

Service Constellation

Every service and its role — browsers hit Cloudflare first; Neon is the only writer’s target.

Hot Read Path — Layered Cache

How dashboard and list reads stay fast: L1 memory → Upstash L2 → Go mirror → stale-on-outage.

Realtime Fan-Out

Three realtime surfaces — Phoenix Channels for dashboards, SSE for live values, watermark-driven so Neon can scale to zero.

Service Map

The moving parts behind bm-online.id — each bounded, each replaceable.

SvelteKit :5173 — Primary App Server

Owns auth (Better Auth, HTTP-only cookies), SSR, the public REST API with scoped API keys, and every write via Drizzle. Idle-aware replication polling lets Neon scale to zero; heap-capped at 1GB on Railway.

Go :8080 — Read Mirror & Realtime Core

oapi-codegen-generated OpenAPI mirror of the hot read paths, a 3s watermark poller that aggregates dashboard snapshots, Redis/NATS publisher, built-in WS hub, and a general reverse proxy with LRU cache and circuit breaker.

Phoenix :4000 — Dashboard Channels

Subscribes Redis Pub/Sub with circuit breaker and dead-letter, rebroadcasts dashboard:update over Phoenix Channels. HTTP-poller fallback to Go when Redis is down; token-based WS auth.

Python :5001/:5003 — ML Services

ONNX all-MiniLM-L6-v2 embeddings behind a Rust LRU/TTL cache (:5002) so repeat inference never hits Python; Prophet forecast service with Indonesian holiday regressors and nightly recompute.

Neon Postgres — Source of Truth

pgvector HNSW index stores codification embeddings for in-DB cosine similarity; pg_trgm GIN indexes power KBLI/HS-code/SIRUP search; pg_stat_statements for diagnostics.

Edge & Infra — Cloudflare + Upstash + MinIO

WAF and edge rate limits, R2 CDN serving immutable hashed assets, Upstash Redis as L2 cache and Go↔Phoenix bus, MinIO for uploads, Meilisearch :7700 for full-text search. One shared openapi.yaml contract generates Go stubs and SvelteKit types.

09+ Services

SvelteKit, Go, Phoenix, two Python services, Rust cache, Meilisearch, MinIO, n-eight.

3s Realtime Poll

Watermark interval when SSE subscribers exist — 5.5min idle for Neon scale-to-zero.

03 Cache Layers

In-memory L1, Upstash L2, and a 1h stale tier served on Go outage.

openapi.yaml API Contract

Single source — oapi-codegen for Go, openapi-typescript for SvelteKit.

Lessons Carried Forward

What three years of rebuilding the same government platform teach you.

Rewrite Beats Patch

Each era replaced the foundation rather than patching it. Migrations were planned around program milestones — never mid-event — so the platform never went dark for participants.

Decouple Only When It Pays

The React + Hono split was right for its moment — real mobile usage, multiple API consumers. When the team no longer needed that flexibility, the Svelte + Go era consolidated again.

Type the Contracts

Every era tightened the contract between frontend and backend: PHP 8 types, then TypeScript end-to-end, then shared schemas between Svelte and Go. Each step deleted a class of integration bugs.

Own the Deploy

From FTP uploads on shared hosting to single-binary Go deploys — each era made shipping safer. The current stack deploys in minutes with a rollback story that actually works.

Where It Stands Today

bm-online.id is the living result of all three eras — the same Business Matching program Kemenperin started on PHP 5 in 2024, now running on a Svelte + Go + Python stack that actively improves matches. The history above documents what changed, why it changed, and what each version looked like in production.