web app · 2024 – 2026
LaporKan
Full-stack developer
A corruption reporting platform for Indonesia. Citizens report anonymously, admins verify each report and forward it to the authority that can act on it, and verified summaries appear on a public map without the reporter's identity.
LaporKan began in 2024 as a Software Engineering case study at BINUS Malang, built on CodeIgniter 3 as a neighbourhood complaint service. In 2026 I rewrote it on CodeIgniter 4.7 and PHP 8.4, fixed the security and data problems in the old code, and reframed it around the case study's actual subject: reporting corruption anywhere in Indonesia.
Business rules live in service classes and a typed status enum, not in controllers or views. 116 automated tests, PHPStan level 6, and the CodeIgniter coding standard run on every push through GitHub Actions against a real MariaDB service.
- category
- Civic reporting platform, CodeIgniter 3 to 4 rewrite
- year
- 2024 – 2026
- role
- Full-stack developer
- tech stack
Audit first: what the CodeIgniter 3 version got wrong
Before writing new code, I read every controller and model of the old app and logged each problem, so the rewrite could include a test that catches it again.
selected findings from the audit
| finding | in CodeIgniter 3 | fix in CodeIgniter 4 |
|---|---|---|
| Insecure direct object reference | Any citizen could view, edit, or delete another citizen's report by changing the ID in the URL | Every citizen query is scoped to the signed-in account; anything else returns 404 |
| No CSRF on destructive actions | Delete and logout were plain GET links | POST, PUT, and DELETE routes with global CSRF protection |
| Cross-site scripting | User input printed without escaping in most views | All views rewritten with escaped output |
| Account enumeration and brute force | Different messages for a wrong username and a wrong password, with no attempt limit | One generic message, session regeneration, and 5 attempts per minute per IP and username |
| Whole repository in the web root | Application code, framework, and an SQL dump were reachable from the web | Only the public folder is exposed |
| Citizens could not submit reports | The form never sent a required column, so every insert failed | Location is a required step of the report flow |
| Any status to any status | Staff could move a report from new straight to done | Allowed transitions defined in a PHP enum |
| Non-transactional deletes | MyISAM tables without foreign keys | InnoDB tables with foreign keys and transactions |
A status flow the server enforces
Reports move through five stages, from received to followed up by the authority. The rules for each step sit in one enum that the services, views, and tests all share.
Only allowed transitions
A new report can move to under verification or invalid, a verified one to valid or invalid, then to forwarded, then to followed up. Any other change is refused by the service layer, not just hidden in the interface.
Forwarding names the authority
When a report is forwarded, the admin records the receiving authority, such as the KPK or a regional inspectorate. It appears in the reporter's tracker and in the report history.
Two vocabularies, one state
Each status has a short label for admins and a plain-language explanation for the reporter, so staff and citizens read the same state in words that fit them.
Reasons are required
Marking a report invalid requires a written reason, which the reporter sees in place of the next step.
Protecting the reporter
A corruption report can put the person who wrote it at risk, so privacy rules are enforced on the server and covered by tests.
Confidential identity
Reporters can hide their identity from operators. Only an administrator can reveal it, and every reveal is written to the activity log.
Public pages show admin summaries only
A report appears publicly only after it is verified and an admin writes an anonymised summary. The chronology, institution, people involved, evidence, and admin messages never reach a public page.
Private evidence
Up to 3 photos or PDFs per report, stored outside the web root and served only to the reporter and admins. PDFs must start with a real PDF header.
Location data removed from photos
Every uploaded photo is re-encoded, which strips EXIF data such as GPS position and phone model.
Small numbers hidden on the map
Provinces with fewer than 5 public reports show "<5" instead of an exact count, so a single report is harder to trace to a small area.
From a phone to the right authority
The report form is a five-step flow that saves each answer as a draft, so a reporter can leave and come back. After sending, they get a report number and can follow its progress on the public tracker without logging in.
what a report captures
- Type of corruption, from 8 categories such as bribery, extortion, and procurement fraud
- What happened, the institution, and the people involved
- Date of the incident and estimated value
- Province and regency or city, from 38 provinces and 514 regencies and cities
- Up to 3 evidence files
An admin workspace built for volume
The demo data holds 1,506 reports, so the admin tools are designed to stay fast to scan and operate.
Dashboard with a national map
Counts by stage sit above a choropleth of all 38 provinces drawn with D3, filterable by status, next to the reports that have waited longest.
Keyboard-friendly inbox
Status tabs with counts, filters by type, province, and date range, search across report text, institution, and number, bulk status changes, and shortcuts: / to search, J and K to move between rows, and Enter to open.
Report review
Each report shows its details, evidence, and history beside a response form that only offers the statuses allowed from the current one, plus the anonymised public summary the admin writes before publishing.
From course assignment to a system people could trust
The 2024 version worked in a demo, but it let users read each other's data and could not save a report at all. The rewrite kept the original schema and password hashes working through migrations, moved every rule into tested services, and reframed the product around the people it has to protect: reporters who take a risk by speaking up.
strategic takeaways
- Audit legacy code before rewriting it, and turn every finding into a test so it cannot return.
- Put state transitions in one typed place and enforce them on the server, not only in the interface.
- Design privacy into what each role can see, then test that private data never reaches public pages.