Perjadin
Duty Trip Proposal & Automated Travel Allowance System

Project at a Glance
- Problem: Calculating employee duty trip allowances manually across varying distances, provinces, islands, and overseas destinations is error-prone and slows down HR (
SDM) proposal reviews. - Deliverables: A fullstack LIVT (Laravel, Inertia.js, Vue 3, Tailwind CSS) and MySQL web application implementing
Master Citycoordinate management, automated Haversine distance & tiered daily allowance calculation, aDuty Trip Proposalapproval workflow (Proposed,Approved,Rejected) with auto-generated ticket numbers (DTP-0000000x), and role-based access control (StaffvsSDM). - Core Stack: Laravel, Inertia.js, Vue 3, Tailwind CSS, MySQL.
- Practical Value: Built solo in 2024 as an open-source implementation of a real-world recruitment test case study found on a developer forum, demonstrating clean business-rule encapsulation, geospatial distance calculation, and monolithic SPA delivery with Inertia.js.
Project Overview
Perjadin (Perjalanan Dinas) is a 2024 personal engineering case study built solo from a recruitment test specification shared on a developer forum. Implemented using the LIVT stack (Laravel, Inertia.js, Vue 3, Tailwind CSS) backed by MySQL, the application models an internal corporate Duty Trip Proposal workflow.
Employees (Staff) submit duty trip requests specifying origin city, destination city, start/end dates, and travel reasons. The system automatically computes the trip duration, calculates inter-city distance in kilometers from stored city coordinates using the Haversine formula, determines the applicable tiered daily allowance rate (within province, inter-province, inter-island, or overseas), and routes the proposal to HR (SDM) for review and approval or rejection.
Interface Specimen

Duty Trip Proposals & Ticket Detail Modal (Ticket DTP-00000002): Status filter tabs (All, Proposed, Approved, Rejected), searchable ticket ledger, and live allowance breakdown (Total Day: 5 days, Allowance Info: 138 KM, Rp 200.000 / day, Total Allowance: Rp 1.000.000).
Context & The Problem
The recruitment case study specification focused on solving realistic HR and administrative workflow requirements cleanly without over-engineering:
- Geospatial Distance & Tiered Allowance Rules: Travel allowance rates depend on both exact distance between origin and destination cities (in KM) and geographic scope (same province, different province, different island, or overseas), multiplied by total trip days.
- Structured Approval Workflow: Proposals must carry sequential ticket identifiers (
DTP-0000000x), clear lifecycle states (Proposed->Approved/Rejected), and filterable status views. - Role-Based Separation: Regular employees (
Staff) should submit and track their own proposals, while HR (SDM) users manageUser Management,Master Cityreference data, and approve or reject incoming duty trip proposals.
System Architecture
Perjadin uses a monolithic SPA architecture powered by Laravel and Inertia.js, eliminating the need for a separate REST API layer while still delivering smooth Vue 3 interactivity:
+-------------------------------------------------------------------+
| SPA Client (Vue 3 + Tailwind CSS) |
| Inertia.js Page Transitions, Modals & Reactive Calculations |
+---------------------------------+---------------------------------+
| Inertia XHR Protocol
+---------------------------------v---------------------------------+
| Laravel Application Core |
| +--------------------+ +------------------+ +---------------+ |
| | Haversine Distance | | Duty Trip Ticket | | RBAC (Staff / | |
| | & Allowance Engine | | Approval Flow | | SDM) & Cities | |
| +---------+----------+ +--------+---------+ +-------+-------+ |
+------------|----------------------|--------------------|----------+
+----------------------+--------------------+
| Eloquent ORM
+-----------------------------------v-------------------------------+
| Primary Database (MySQL) |
| Users/Roles, Master Cities (Lat/Lng/Region), Duty Proposals |
+-------------------------------------------------------------------+
Architectural Decisions
- LIVT Stack (Laravel + Inertia.js + Vue 3 + Tailwind CSS): Inertia.js bridged Laravel controllers directly with Vue 3 page components, giving the application instant modal workflows, status tab filtering, and responsive UI transitions without maintaining separate API authentication and frontend routing stacks.
- Server-Validated Business Rules:
While the Vue 3 modal gives instant visibility into trip duration, KM distance, and total allowance, the final Haversine distance computation, tier selection, and ticket number generation (
DTP-0000000x) are enforced authoritatively on the Laravel backend before persistence. - Structured Geographic Reference Data (
Master City): Storing latitude, longitude, province, island, and domestic/overseas flags inMaster Citykeeps distance and allowance tier calculations deterministic and easy to audit.
Engineering Challenges & Solutions
1. Deterministic Inter-City Distance & Multi-Tier Allowance Calculation
Computing accurate allowances across combinations of short-distance, inter-province, inter-island, and overseas trips requires combining geospatial math with clear conditional business rules.
- Solution: Implemented the Haversine formula against
Master Citylatitude/longitude coordinates inside a dedicated Laravel calculation service, paired with explicit geographic tier rules (distance threshold + province/island/overseas flags) to derive the daily rate and total allowance deterministically from start and end dates.
2. Sequential Ticket Numbering & Role-Scoped Proposal Lifecycle
Duty trip tickets (DTP-0000000x) and status transitions (Proposed -> Approved / Rejected) must remain consistent while enforcing strict permission boundaries between Staff and SDM roles.
- Solution: Encapsulated ticket ID formatting, status transitions, and role-based query scoping in Laravel middleware and controller/service policies so
Staffusers only submit and view their own proposals whileSDMmanages reference data and executes approval decisions.
Outcomes & Key Learnings
- Completed and open-sourced a clean LIVT stack implementation of a real-world recruitment case study covering geospatial Haversine calculations, tiered allowance rules, ticketed approval workflows, and
Staff/SDMRBAC. - Demonstrated how Inertia.js + Vue 3 pairs with Laravel to deliver fast, maintainable internal enterprise workflows without unnecessary API duplication.