Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/raceliciouss/YUSEN-LIMO-WAREHOUSE/llms.txt

Use this file to discover all available pages before exploring further.

All persistent state in the YUSEN LIMO Warehouse System is managed through named browser storage keys. auth.js owns the authentication keys; app.js owns everything else. No server-side persistence is used — all data lives in the browser’s Local Storage (and, for one transient key, Session Storage). Understanding these keys is essential when debugging unexpected UI state, building data export tools, or implementing a migration path to a backend database.

Key Reference

KeyStorage TypeValue TypeManaged ByDescription
warehouseAuthAccountsLocal StorageJSON string (array)auth.js / AuthServiceArray of all user account objects. Seeded with two default accounts if missing.
warehouseAuthSessionLocal StorageJSON string (object)auth.js / AuthServiceSession for the currently logged-in user: userId, role, name, employeeId, position. Present only while logged in.
warehouseShipmentsLocal StorageJSON string (array)app.jsAll raw shipment records (inbound and outbound). Source of truth for inventory, activity, and dashboard data.
warehouseProfileLocal StorageJSON string (object)app.jsCurrent user’s profile metadata: firstName, lastName, employeeId, position, email, phone.
warehouseProfilePicturesLocal StorageJSON string (object)app.jsMap of userId → base64 data URL. Each entry holds the profile picture for one user as a full data:image/...;base64,... string.
warehouseNotificationStateLocal StorageJSON string (array)app.jsArray of notification items with id, type, title, description, meta, time, and read boolean. Rebuilt from recent shipments each time the notification panel opens.
sidebarCollapsedLocal Storagestring ('true' / 'false')app.jsStores the user’s sidebar expand/collapse preference. Read on every page load to restore the last-used layout state.
warehouseLiveSearchSelectionSession StorageJSON string (object)app.jsTransient cross-page search value set when a user selects an item from the live search panel. Shape: { targetPage: 'inventory' | 'activity', value: string }. Consumed and removed immediately after the destination page loads.

Key Details

warehouseAuthAccounts

Stores the complete account list managed by AuthService. The array is read on every AuthService method call and written back after any mutation (create, update, delete, reset password, toggle status). If this key is missing or its value is an empty array, AuthService.initializeAuth() seeds it with the two default accounts (admin001 and emp001).
// Read directly (prefer AuthService.getAccounts() in application code)
const accounts = JSON.parse(localStorage.getItem('warehouseAuthAccounts') || '[]');
console.table(accounts.map(({ userId, role, status }) => ({ userId, role, status })));

warehouseAuthSession

Written by AuthService.authenticateUser() on successful login and removed by AuthService.logout(). All page-load authentication guards call AuthService.isAuthenticated(), which reads this key.
const session = JSON.parse(localStorage.getItem('warehouseAuthSession') || 'null');
// { userId: 'admin001', role: 'admin', name: 'Juan Cruz', employeeId: 'ADM-001', position: 'Administrator' }

warehouseShipments

The central data store for all warehouse transactions. Each array element is one raw shipment record (either inbound or outbound). Records are prepended (newest first) by the save shipment handler. getStoredShipments() applies a migration pass on read to backfill missing releaseDate, releaseTime, releasePlate, and releaseDriver fields on older outbound records. saveStoredShipments() always writes the full array and dispatches warehouse:data-updated to trigger UI refreshes.

warehouseProfile

Stores display-only profile metadata for the current user. Fields are merged with defaults on every write via saveStoredProfile(). The employeeId and position fields are overridden from the active AuthService session on each save to stay in sync with the auth account record.

warehouseProfilePictures

An object map where each key is a userId and each value is either a data:image/...;base64,... string or null. Storing images as base64 in Local Storage is convenient for a purely client-side system, but the encoded size is approximately 33 % larger than the original binary file.
warehouseProfilePictures can grow large quickly. A single high-resolution JPEG can easily exceed 1 MB when base64-encoded, and browsers typically enforce a 5–10 MB total Local Storage quota per origin. If the system is used by many employees with profile pictures, this key alone could cause quota errors that silently prevent all other writes. Consider compressing images before encoding (resize to ≤ 256 × 256 px), periodically removing entries for deleted users, or migrating profile pictures to IndexedDB or a backend file store.

warehouseNotificationState

An array of notification item objects built from the most recent shipments. The notification panel loads this state on open, marks items as read on interaction, and saves it back. It is rebuilt (not appended) each time new shipments are detected, so stale notifications are automatically replaced.

sidebarCollapsed

A simple boolean string: 'true' if the sidebar is collapsed, 'false' (or absent) if it is expanded. Read by app.js on DOMContentLoaded to restore the previous sidebar state. Written whenever the user clicks the sidebar toggle button.

warehouseLiveSearchSelection

A Session Storage key (not Local Storage) used for single-page-navigation state. When a user picks a result from the global live search panel on the dashboard, the system writes the target page and value to this key, then navigates to the appropriate page (inventory.html or the activity section of dashboard.html). The destination page reads and clears the key immediately on load, applying the value to its search input.

Inspecting Keys in the Browser Console

Use these snippets to inspect storage state during development or debugging:
// View all shipments
const shipments = JSON.parse(localStorage.getItem('warehouseShipments') || '[]');
console.log(`${shipments.length} raw records`);
console.table(shipments.slice(0, 5)); // preview newest 5

// View current session
const session = JSON.parse(localStorage.getItem('warehouseAuthSession') || 'null');
console.log(session);

// View all accounts (userId + role + status only)
const accounts = JSON.parse(localStorage.getItem('warehouseAuthAccounts') || '[]');
console.table(accounts.map(({ userId, role, status }) => ({ userId, role, status })));

// Check notification state (read vs unread count)
const notifications = JSON.parse(localStorage.getItem('warehouseNotificationState') || '[]');
const unread = notifications.filter(n => !n.read).length;
console.log(`${unread} unread / ${notifications.length} total notifications`);

// Check profile picture sizes
const pics = JSON.parse(localStorage.getItem('warehouseProfilePictures') || '{}');
Object.entries(pics).forEach(([userId, dataUrl]) => {
  const kb = dataUrl ? Math.round(dataUrl.length * 0.75 / 1024) : 0;
  console.log(`${userId}: ~${kb} KB`);
});

Resetting the App to Defaults

To wipe all warehouse data and return the system to its initial seeded state:
  1. Open DevTools (F12) → Application tab → Local Storage → select your origin.
  2. Delete all keys that begin with warehouse (warehouseAuthAccounts, warehouseAuthSession, warehouseShipments, warehouseProfile, warehouseProfilePictures, warehouseNotificationState).
  3. Also delete sidebarCollapsed if you want the sidebar preference reset.
  4. Reload the page — AuthService.initializeAuth() runs automatically and re-creates the two seeded accounts (admin001 / Admin@123 and emp001 / Employee@123).
Alternatively, run the following snippet in the browser console for a factory reset of all warehouse keys:
// Clear all warehouse-prefixed Local Storage keys
Object.keys(localStorage)
  .filter(k => k.startsWith('warehouse'))
  .forEach(k => {
    localStorage.removeItem(k);
    console.log(`Removed: ${k}`);
  });

// Also clear the sidebar preference
localStorage.removeItem('sidebarCollapsed');

// Reload to re-seed default accounts
location.reload();
Session Storage (warehouseLiveSearchSelection) is automatically cleared by the page that reads it, or when the browser tab/session is closed. You do not need to clear it manually during a factory reset.

Build docs developers (and LLMs) love