Back to projects
Enterprise Portal

Anaq Enterprise Portal & Management

RBAC-Secured Multi-Location Inventory & Order Management

LaravelSanctum AuthMySQLAdmin DashboardRBACREST API
Roles & Permissions
25+defined
Locations Synced
12sites
Inventory Accuracy
99.4%
Admin Users
80+active

Secure enterprise web portal featuring granular role-based access control, multi-location inventory sync, order processing pipelines, and administrative reporting. Built so permissions, locations, and order state remain consistent even with dozens of concurrent admin users.

Architecture & System Design

Access control is enforced through a policy-based RBAC layer with cached permission checks, while inventory is scoped per location with scheduled sync jobs. Orders flow through an explicit state machine to keep concurrent edits consistent.

Request Flow
Login (Sanctum)
Role/Permission Gate
Location Context Resolver
Inventory Sync Job
Order Processing Pipeline
Audit Log
Admin Reporting
  • Granular permission system with cached role/permission resolution per request
  • Location-scoped inventory synced via scheduled jobs with discrepancy detection
  • Queued order pipeline enforced through an explicit state machine
  • Full audit logging of every administrative action for compliance review

Engineering Challenges

Granular Access Control at Scale

Problem

Different departments and locations required distinct access boundaries, but permission checks couldn't be allowed to slow down requests.

Solution

Built a policy-based RBAC layer with permission caching keyed per user session, avoiding repeated database lookups on every gate check.

Result

Fine-grained access enforced with under 5ms of authorization overhead per request.

Multi-Location Inventory Drift

Problem

Inventory counts across 12 locations gradually drifted out of sync, causing overselling and reporting errors.

Solution

Introduced scheduled sync jobs with conflict resolution logic and automated discrepancy alerts for manual review.

Result

Inventory accuracy improved from roughly 92% to 99.4%.

Concurrent Order Edits

Problem

Multiple admins updating the same order simultaneously produced conflicting status transitions.

Solution

Implemented an explicit order state machine with optimistic locking to reject stale transitions.

Result

Eliminated conflicting status updates across concurrent admin sessions.

Core Features

Role-Based Access Control

Granular, cached permission checks scoped by role, location, and department.

Clean Code

InventoryPolicy — Location-Scoped Authorization
1<?php
2
3namespace App\Policies;
4
5use App\Models\User;
6use App\Models\InventoryItem;
7
8class InventoryPolicy
9{
10 public function update(User $user, InventoryItem $item): bool
11 {
12 return $user->hasPermissionTo('inventory.update')
13 && $user->locations->contains($item->location_id);
14 }
15
16 public function transfer(User $user, InventoryItem $item): bool
17 {
18 return $user->hasPermissionTo('inventory.transfer')
19 && $user->hasRole(['admin', 'regional_manager']);
20 }
21}