Frontend for the Laravel multi-tenant backend. The app focuses on auth state, tenant context, RBAC-aware UI, and API integration.
- Install dependencies:
npm install - Configure API base URL in
.env:VITE_API_BASE_URL=http://localhost/api/v1 - Run the app:
npm run dev
src/api/: centralized API client + endpoint wrapperssrc/state/: auth, tenant, projects, and tasks contextssrc/components/: reusable UI building blockssrc/pages/: route-level screenssrc/types/: type-safe API models and enums
React Context providers store:
- Auth token + user (
AuthProvider) - Active organization and role (
OrgProvider) - Projects (
ProjectProvider) - Tasks (
TaskProvider)
State is kept in memory and persisted in localStorage for token + active org so the session survives reloads.
axiosclient insrc/api/client.ts- Request interceptor injects:
Authorization: Bearer <token>X-Organization-IDfor tenant-scoped endpoints
- Response interceptor triggers a session-expired event on
401to log users out cleanly.
Permission checks are centralized in src/permissions.ts.
- Owners / Managers: create/edit projects, assign tasks
- Members: update tasks assigned to them only
UI hides or disables unauthorized actions without hardcoding permissions in individual components.
Add screenshots under docs/screenshots/ and link them here.
This frontend follows backend standards:
- Tenant is required via
X-Organization-ID. - Auth token uses
Authorization: Bearer .... - Error responses follow
{ message, errors, code }.