React Interface for XetaSuite - Multi-Tenant Facility Management ERP
XetaSuite-React is the modern and responsive user interface for XetaSuite, a multi-tenant ERP dedicated to facility, equipment, and inventory management.
This SPA (Single Page Application) communicates with the Laravel backend via Sanctum stateful authentication (secure cookies).
- Secure login: Authentication via Laravel Sanctum (cookies)
- Forgot password: Email-based password reset
- Profile management: Personal information editing
- Password change: With current password validation
- Overview: Key statistics and indicators per site
- Site selector: Quick switching between locations
- Custom widgets: Real-time charts and metrics
- Visual tree: Navigate through zone hierarchy
- Nested creation: Add sub-zones in cascade
- Paginated list: Advanced search and filters
- Detailed records: Complete equipment information
- QR Codes: Display and download for identification
- History: View past interventions
- Item catalog: List view with search
- Stock movements: Entry/exit transfers with full traceability
- QR Codes: Display and download for identification
- Price history: Track purchase cost evolution
- Unified company model: Companies can be item providers, maintenance contractors, or both
- Type-based display: Visual badges showing company roles (Item Provider, Maintenance Provider)
- Tabbed detail view: Items tab and Maintenances tab based on company type
- Headquarters management: Centralized database managed from HQ site
- Full traceability: Track all items and maintenances linked to each company
- Forms: Create and edit interventions
- Statuses: Workflow tracking (scheduled β completed)
- Quick reporting: Simplified form
- Visual priorities: Color-coded urgency levels
- Resolution: Processing workflow
- Scheduling: Frequency management
- Validation: Session confirmation
- Users: Create, edit, deactivate
- Roles: Define access profiles
- Permissions: Granular per-site attribution
- Notification center: Complete history
- Real-time badge: Unread indicator in header
- Bulk actions: Mark all as read
- Interactive calendar: FullCalendar-based view with month, week, day, and list modes
- Unified display: Calendar events, maintenances, and incidents in one view
- Toggle visibility: Show/hide maintenances and incidents independently
- Event categories: Color-coded categories for organizing events
- Drag & drop: Move events by dragging, resize for duration changes
- Quick creation: Click on calendar to create event at that time
- Event modal: Rich form with searchable category dropdown
- Today's banner: Dashboard widget showing current day's events
- Category management: Full CRUD interface for event categories
- Multi-language: French and English
- Auto-detection: Browser language
- User preference: Saved choice
- Design System: Based on TailAdmin
- Dark mode: Light/dark theme toggle
- Responsive: Mobile and tablet optimized
- Collapsible sidebar: Workspace efficiency
- Quick access:
Ctrl+K/Cmd+Kkeyboard shortcut or header search icon - Unified search: Search across materials, zones, items, incidents, maintenances, companies, sites
- Keyboard navigation: Navigate results with arrow keys, select with Enter
- Type indicators: Visual icons and colors for each result type
- Permission-aware: Only shows results the user is allowed to see
- Mobile support: Accessible via search button in header on mobile devices
| Component | Technology | Version |
|---|---|---|
| UI Library | React | 19.2+ |
| Language | TypeScript | 5.9+ |
| Build Tool | Vite | 7.2+ |
| Styling | Tailwind CSS | 4.1+ |
| Routing | React Router | 7.9+ |
| HTTP Client | Axios | 1.13+ |
| i18n | i18next + react-i18next | 25.x / 16.x |
| Calendar | FullCalendar | 6.x |
| Charts | ApexCharts | 4.x |
| Notifications | React Toastify | 11.x |
src/
βββ app/ # Application entry point
β βββ routes/ # Route configuration
β βββ i18n/ # Internationalization
β β βββ locales/ # Translation files
β βββ styles/ # Global styles
β βββ App.tsx # Main component
β βββ AppRoutes.tsx # Route generator
β
βββ features/ # Business modules
β βββ Auth/ # Authentication
β β βββ services/ # Repository + Manager
β β βββ store/ # React Context
β β βββ hooks/ # useAuth, useRequireAuth
β β βββ views/ # Login, reset pages, etc.
β βββ Sites/ # Site management
β βββ Zones/ # Zone management
β βββ Materials/ # Material management
β βββ Items/ # Stock management
β βββ Maintenances/ # Interventions
β βββ Incidents/ # Reports
β βββ Cleanings/ # Cleanings
β βββ Companies/ # Company management (item providers & contractors)
β βββ Users/ # Users
β βββ Roles/ # Roles
β βββ Permissions/ # Permissions
β βββ Notifications/ # Notifications
β
βββ shared/ # Shared code
βββ api/ # httpClient, urlBuilder
βββ components/ # Reusable UI components
β βββ ui/ # Button, Modal, Alert, Table
β βββ form/ # Input, Select, Checkbox
β βββ common/ # Pagination, DeleteConfirmModal
βββ hooks/ # Utility hooks
βββ types/ # Global TypeScript types
// Repository: Raw API calls
export const CompanyRepository = {
getAll: async (params?) => {
const response = await httpClient.get('/api/v1/companies', { params });
return response.data;
},
};
// Manager: Error handling + transformation
export const CompanyManager = {
getAll: async (params?) => {
try {
const data = await CompanyRepository.getAll(params);
return { success: true, data };
} catch (error) {
return { success: false, error: handleApiError(error) };
}
},
};- Node.js 18 or higher
- npm or yarn
- XetaSuite-core backend configured
# Clone the repository
git clone https://github.com/XetaIO/XetaSuite-React.git
cd XetaSuite-React
# Install dependencies
npm install
# Configure environment
cp .env.example .env
# Start development server
npm run dev# API URL (empty to use Vite proxy)
VITE_API_URL=
# In production
VITE_API_URL=https://api.xetasuite.com# Development server (http://localhost:5173)
npm run dev
# Production build (with TypeScript check)
npm run build
# Preview production build
npm run preview
# ESLint linter
npm run lint1. GET /sanctum/csrf-cookie β Retrieves CSRF token
2. POST /api/v1/auth/login β Authentication
3. Session cookie created β Used for all requests
const httpClient = axios.create({
baseURL: import.meta.env.VITE_API_URL || '',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-Requested-With': 'XMLHttpRequest',
},
withCredentials: true, // Required for Sanctum
withXSRFToken: true, // Auto-include XSRF token
});import { useAuth } from '@/features/Auth/hooks';
function MyComponent() {
const { hasPermission, hasRole, hasAnyPermission } = useAuth();
return (
<div>
{hasPermission('company.create') && (
<Button>Create Company</Button>
)}
{hasRole('admin') && <AdminPanel />}
</div>
);
}<Route element={
<RequireAuth permissions={['material.viewAny']}>
<AppLayout />
</RequireAuth>
}>
<Route path="/materials" element={<MaterialListPage />} />
</Route>Colors are defined in src/app/styles/index.css:
@theme {
--color-brand-500: #465fff;
--color-success-500: #22c55e;
--color-error-500: #ef4444;
--color-warning-500: #f97316;
}<div className="bg-white dark:bg-gray-900 text-gray-800 dark:text-white">
Theme-adaptive content
</div>i18n.init({
resources: {
en: { translation: en },
fr: { translation: fr },
},
fallbackLng: 'en',
detection: {
order: ['cookie', 'localStorage', 'navigator'],
},
});import { useTranslation } from 'react-i18next';
function MyComponent() {
const { t } = useTranslation();
return <h1>{t('common.welcome')}</h1>;
}Contributions are welcome!
# Run linter before committing
npm run lintXetaSuite-React is open-source software licensed under the MIT license.
- Laravel Backend: XetaSuite-core
- Issues: GitHub Issues