Skip to content

Frontend

Runtime stack

  • Vite
  • React 19
  • React Router
  • TanStack Query
  • Supabase browser client
  • Recharts for analytics

Route map

Public and shared routes

RoutePurpose
/portal home
/tickets/newcreate ticket
/tickets/:idend-user ticket detail
/notificationsuser notification center
/settingsshared settings page
/profilecurrent user profile
/auth/loginsign in
/auth/registersign up
/auth/forgot-passwordpassword reset request
/auth/reset-passwordpassword reset completion
/auth/accept-inviteinvite acceptance flow

Agent and admin routes

RouteGuard
/dashboardagent or admin
/queueagent or admin
/queue/:idagent or admin
/statsagent or admin
/departmentsagent or admin
/departments/:idagent or admin

Admin-only routes

RoutePurpose
/usersuser directory
/users/:iduser detail
/developer-toolsclassifier and local-dev admin tools
/quick-actionsquick action management

App structure

AreaRole
src/approuter, layout, providers, error boundaries
src/pagesroute-level screens
src/componentsUI modules by feature
src/hooksrealtime and app-specific hooks
src/libAPI client, classifiers, formatting helpers
src/i18nmessage catalogs and locale provider

Key UX capabilities

End users

  • submit Arabic-only tickets
  • track ticket detail and comments
  • receive notification updates
  • manage basic profile and settings

Agents

  • work a live queue
  • update status and priority
  • reassign work
  • review classification details
  • apply quick actions
  • inspect audit history

Admins

  • manage users and invitations
  • inspect department-level stats
  • use developer tools and reseed utilities
  • manage quick action content

Realtime hooks

Two hooks carry most of the live behavior:

  • useRealtimeNotifications
  • useRealtimeQueue

These subscribe on mount and remove channels on unmount. The goal is simple: live updates without turning the frontend into a custom event-processing system.

API client pattern

src/lib/api.ts centralizes:

  • bearer token injection from Supabase session
  • JSON response parsing
  • typed helpers for each backend route

That keeps page components thin and makes the route surface easy to audit.

Built from the current monorepo implementation.