ACPL Construction ERP.
A multi-tenant construction ERP centralizing budgets, timelines, inventory, workforce, and geotagged task verification across multiple construction sites.
Backend Architecture
- Laravel 11 REST API: 17+ controllers, 50+ endpoints — site management, worker assignments, inventory transactions, task logging, vendor management.
- Multi-tenant SaaS design with organization-level data isolation.
- Database: 46+ migrations across 10+ interconnected tables, with soft deletes, JSON columns for flexible transaction-item schemas, and organization-scoped filtering.
- Laravel Sanctum cookie-based auth with CSRF protection.
- Google Maps geocoding for location-based camera/image management; file uploads for worker documents and multi-image task logs.
Frontend Architecture
- Next.js 15 / React 19 with permission-based route protection (React Context + custom hooks).
- Geotagged task verification: automatic GPS coordinate extraction, EXIF metadata embedding (piexifjs), reverse geocoding, and client-side image compression.
- Parallel data fetching with
Promise.allacross 18+ components. - Reusable form components (Formik/Yup) and data tables (TanStack: sorting, pagination, filtering) across 20+ pages.
The Hard Part
Trustworthy geotagged verification from the field
Task verification had to survive real field conditions: extract GPS coordinates from device photos, embed EXIF metadata, reverse-geocode to a human-readable location, and compress images client-side so uploads stayed fast on patchy site connectivity — all while keeping the record tamper-evident enough that a site manager could trust it.
Key Features
- 100+ daily task logs from workers across multiple sites.
- 4-role RBAC: super_admin, admin, site_manager, worker.
- Inventory transaction types — purchase, transfer, allocation, usage, return, adjustment — with automated low-stock alerts and request-approval workflows.
- Unified dashboard: budgets, timelines, inventory, and workforce with cross-site aggregated statistics.
- Audit trails across operations; deployed on AWS Lightsail (Apache reverse proxy + SSL).
Trade-offs & What v2 Adds
Why JSON storage for transaction items?
Flexibility for varying item structures versus rigid normalized tables.
Why cookie-based auth over tokens?
Better CSRF protection in an SPA context.
What v2 would add
Server Components for SEO, React Query/SWR caching, WebSockets for live dashboards, Elasticsearch, and event sourcing for transaction history.
Want the full walkthrough?
Happy to walk through the multi-tenant model, geotagging pipeline, and inventory workflows in detail.