Replatforming the Bakorwil III Malang portal from WordPress to a headless Next.js and Payload CMS architecture, measured with Google Lighthouse and Core Web Vitals.
Bakorwil III Malang's public site ran on a monolithic WordPress install loading more than 40 CSS and JavaScript files from assorted plugins, making it slow and hard to extend. I rebuilt it from scratch as a headless prototype: content modeling, admin panel, custom modules, and deployment. The prototype runs on Vercel and is under evaluation by the agency.
Built with Next.js, Payload CMS, and MongoDB following the Rational Unified Process (RUP). In Google Lighthouse lab audits the homepage rose from 57 to 100 and LCP fell from 5.2s to 1.9s, in line with Indonesia's SPBE e-government agenda (Presidential Regulation No. 95/2018).
- category
- Headless CMS replatform, full-stack
- year
- 2025 – 2026
- role
- Full-stack developer
- tech stack
Problem investigation: the fragility of monolithic WordPress
Bakorwil III Malang serves as the pivotal coordinator across nine regencies and municipalities in East Java. For a public agency of this magnitude, its official portal is the frontline interface for citizens, researchers, student interns, and inter-agency civil servants.
Yet a baseline Google Lighthouse audit of the live WordPress site put the homepage's Performance score at just 57 out of 100. Largest Contentful Paint (LCP) took 5.2 seconds, well over Google's ≤ 2.5s standard, and Speed Index reached 11.7 seconds.
legacy WordPress homepage, lab audit
Why the shift to a headless stack?
Bypassing fragile plugin patchworks by separating the content repository from the client presentation layer.
Next.js
Delivers hybrid rendering: Server-Side Rendering (SSR) for dynamic views and Static Site Generation (SSG) for static public portals. Features automatic code-splitting, route compression, and modern image optimization.
Payload CMS
A code-first headless CMS built with Node.js and TypeScript. Unlike plugin-heavy PHP platforms, Payload is code-configured without injecting unnecessary scripts into the client frontend.
MongoDB
Document-oriented NoSQL database storing JSON-like dynamic BSON documents. Well suited for modular page builder blocks where each layout section requires flexible content structures.
Software design and system functionality
Visitor functionality
Viewing post lists and details
Visitors can access all published official news articles with server-side pagination, category taxonomy filtering, and read complete articles on detail pages with automated view counter increments.
Instant multi-field article search
Visitors can search news via keywords indexed across titles, meta descriptions, and slugs, returning sub-50ms query responses without third-party search plugins.
Viewing regional coordination agenda
Visitors can view the official coordination agenda spanning regional jurisdictions, complete with event titles, descriptions, schedules, and venue locations.
Viewing internship directory (SiMagang)
Visitors can browse the public intern directory where participant operational statuses (Upcoming, Active, Completed) are dynamically computed from calendar dates without manual toggling.
Submitting and viewing public comments
Visitors can submit feedback comments on published news articles with name, email, and message, processed through an automated pre-publication moderation queue before public display.
Accessing public informational pages
Visitors can access agency profile pages, statutory duties, jurisdictional maps, and transparency reports rendered dynamically through polymorphic content block schemas.
Admin functionality
Admin login and role-based access
Administrators sign in to the control dashboard using bcrypt-hashed credentials secured with role-based JWT sessions and brute-force login rate limiting.
Post and content lifecycle management
Administrators create, draft, edit, publish, and delete news articles. Publishing automatically triggers on-demand ISR hooks to purge and refresh public edge caches.
Polymorphic page builder management
Administrators compose and manage public pages using modular polymorphic blocks without touching code or relying on external web developers.
Automated 7-tier media pipeline
Administrators upload and manage image assets, automatically compressed to WebP and generated into 7 responsive viewport sizes for optimal LCP scores.
Category and taxonomy management
Administrators organize articles into categories with automated SEO-friendly URL slug generation and relationship mapping.
SEO and Open Graph metadata configuration
Administrators configure custom title tags, meta descriptions, social media preview cards, and crawler indexing directives for every article and page.
Comment moderation queue
Administrators review incoming public comments in a triage queue, approving or rejecting submissions before they appear on the live portal.
Regional coordination agenda management
Administrators schedule and publish regional coordination meetings, leadership forums, and agency activities with date ranges and venues.
SiMagang internship records management
Administrators manage intern records with strict chronological date integrity validation (end date after start date) and academic institution tracking.
Bespoke modules free from plugin lock-in
Translating real-world provincial government operations into modular, high-performance web applications free from third-party plugin lock-in and performance decay.
SiMagang (Sistem Informasi Magang)
Bakorwil III Malang regularly hosts interns from dozens of universities across East Java. I built an automated internship subsystem that calculates student operational statuses dynamically based on calendar dates (Upcoming, Active, Completed), complete with institutional filtering, data roster export, and a visual analytics dashboard for institutional distribution and division capacity monitoring.
Dynamic layout blocks designer
Provincial agency communications staff require flexibility to create and update public web pages (agency profiles, regulatory notices, transparency reports) without developer dependency or the performance penalties of monolithic visual page builders like Elementor. Utilizing modular content blocks in Payload CMS, staff can assemble custom compositions of Hero Blocks, RichText Content, Service Grids, Document Tables, and Media Galleries with dynamic URLs and on-demand ISR cache revalidation.
Layout flexibility and hero carousel
On the legacy WordPress site, administrators were constrained by the rigid Newsmatic theme which prohibited layout adjustments. To publish urgent announcements on the homepage, staff had to rely on popups that disrupted navigation and degraded layout stability. With Next.js and Payload CMS, the layout architecture is flexible: replacing intrusive popups with a native Announcement Carousel integrated into the Home Hero section with flawless visual stability (CLS 0.000).
Lighthouse results: homepage from 57 to 100
Google Lighthouse lab audits of the ten lowest-scoring pages, comparing the legacy WordPress site with the prototype deployed on Vercel.
homepage, core web vitals: prototype, with WordPress struck through
performance score by page
| page | WordPress | Next.js + Payload | gain |
|---|---|---|---|
| Homepage | 57 | 100 | +43 |
| SiMagang (Internship) | 67 | 100 | +33 |
| Regional Map | 71 | 98 | +27 |
| Photo Gallery | 75 | 99 | +24 |
| Awards | 77 | 98 | +21 |
| Budget & Transparency | 77 | 100 | +23 |
| History | 78 | 100 | +22 |
| Duties & Functions | 83 | 99 | +16 |
| Location & Address | 87 | 99 | +12 |
| Performance Reports | 87 | 100 | +13 |
Validation
Black box testing
| scope | coverage | result |
|---|---|---|
| Visitor (A1 – A7) | Post lists, pagination, filters, view counters, search, events, internships, comments and replies | 100% pass |
| Admin auth and posts (B1 – B2) | Credential auth, draft protection, cache revalidation, full article CRUD | 100% pass |
| Admin agenda and internships (B3 – B4) | Event scheduling, internship date validations, automated status heuristics | 100% pass |
| Pages and media (B5 – B7) | Modular page block builder, automated 7-tier responsive media generation | 100% pass |
| Comment moderation (B8) | Comment moderation queues, public approvals, and spam filtering | 100% pass |
User Experience Questionnaire (UEQ)
| scale | mean | benchmark |
|---|---|---|
| Efficiency | 2.058 | Excellent (highest) |
| Attractiveness | 1.828 | Excellent |
| Perspicuity | 1.817 | Excellent |
| Stimulation | 1.692 | Good |
| Dependability | 1.617 | Good |
| Novelty | 1.250 | Positive |
Modernizing regional government portals with modern web standards
By separating content management from presentation with Next.js and Payload CMS, the Bakorwil III Malang portal delivers fast load times and clean maintainability. The evaluative prototype runs on Vercel and is under evaluation by the agency.
key strategic recommendations for public sector web
- Phase out monolithic, plugin-heavy WordPress setups for citizen-facing portals subject to high concurrent traffic.
- Adopt code-configured headless CMSs (such as Payload CMS) enabling PR teams to manage content without incurring frontend runtime debt.
- Institutionalize Core Web Vitals (LCP, INP, CLS) as non-negotiable compliance criteria in e-government software procurement.