Case study
Live productPasalBaru: old-to-new Criminal Code converter
A website and an Android app that show where an old Criminal Code article sits in the new Code (Law 1/2023), with the official text, penalties, and Law 1/2026 changes.
- Role
- Product planning, data verification, development, testing, and launch
- Stack
- Astro 7
- TypeScript
- Python
- Tesseract OCR
- satori
- openpyxl
- PWA
- Android TWA
- Status
- Online:Visit pasalbaru.id: PasalBaru (opens another site)
This product’s source code is private. The evidence is in the test results below and on the live site.

The problem
Since January 2, 2026, Indonesia’s National Criminal Code (Law No. 1 of 2023) has replaced the Dutch-era Code, and some of its articles were adjusted again by Law No. 1 of 2026 on criminal law adjustments. Article numbers that people memorized for years, such as theft or fraud, have moved.
Law students, lawyers, paralegals, journalists, and the general public need a quick way to find which article an old one has become, with official text they can trust.
The solution
PasalBaru maps 139 frequently used old articles to their counterparts in the new Code. Each mapping page shows the old and new text side by side, their elements and differences, the penalty with its fine category in rupiah, and any changes made by Law 1/2026.
The new Code’s text comes from official copies that are scanned images. The text is read twice and the two readings are compared. Every quoted article is then checked word by word against the image of its page. Mappings that are still open to debate are labeled "Masih ditinjau" (under review).
Key features
- Search by old article number, new article number, or keyword, processed on the user’s device
- 139 mapping pages with official text side by side, penalties, and fine categories
- A page for the Law 1/2026 adjustments, with labels on the articles it changed
- An image card to share for every mapping, plus a WhatsApp link
- Installable on a phone as a PWA, with pages already visited readable offline, and an Android APK available as a direct download
- Paid products: a KUHP concordance table (A4 PDF and filterable Excel) and a KUHAP (Criminal Procedure Code) concordance table with 362 mappings from Law 8/1981 to Law 20/2025
- No accounts and no cookies; error reports from users are kept for at most 180 days
Technical challenges
Official text from scanned copies
The official copies of Law 1/2023 and Law 1/2026 are scanned images. Their text is read twice, by Tesseract and from the PDF’s text layer. Words that both readings agree on are accepted, while differences are checked against a word list or flagged as uncertain. Text not yet checked by hand is labeled "hasil OCR" (OCR output) on the site.
A validator before every release
Every mapping goes through an automated validator. Article numbers must exist, quotes must match the structured text exactly, cited articles must already be verified, and fine categories and prison terms are cross-checked against the quote. Paid products use high-confidence mappings only.
Fast, and readable when the signal drops
The site is static (Astro) and runs under a strict CSP with no inline scripts. Its service worker fetches pages from the network first and falls back to the cache. New data arrives right away, and pages already visited stay readable offline.
Share cards generated automatically
The card image for every mapping is generated at build time with satori and resvg from the same data as its page. When a mapping is updated, its card changes too, with no manual editing.
Test results
Lighthouse (mobile)
Home page
Measured page: /
Mapping page: theft
Measured page: /pasal/pencurian/
Measured on October 25, 2026 with Lighthouse 13.5.0 in mobile mode, directly against the live site. Scores are the median of 3 runs.
Automated tests
- End-to-end tests on the live site: search, article pages, share cards, the PWA and offline mode, security headers, and accessibility and color contrast with axe, on a Pixel 7 and desktop Chrome Playwrightreport of October 25, 2026142
- Data accuracy tests for the KUHAP concordance table: mapping and quote validator pytestreport of October 12, 202626
168 tests in total, all passing according to the project’s test reports on the dates shown.
