Skip to content

Repository files navigation

XetaSuite LogoXetaSuite Logo

Backend API for XetaSuite - Multi-Tenant Facility Management ERP

PHP 8.4+Laravel 12PostgreSQLTestsLicense MIT


📋 About XetaSuite

XetaSuite is a multi-tenant ERP (Enterprise Resource Planning) designed for comprehensive facility, equipment, and inventory management. This professional solution enables businesses to efficiently manage their sites, zones, materials, stock, and interventions (maintenance, cleaning, incidents).

🎯 Who is XetaSuite for?

XetaSuite is ideal for:

IndustryUse Cases
🏢 Facility ManagementBuilding management, workspaces, meeting rooms
🏭 Manufacturing & ProductionEquipment tracking, preventive maintenance, spare parts management
🏥 Healthcare & HospitalsMedical equipment inventory, equipment traceability, cleaning schedules
🏫 EducationSchool furniture management, IT equipment tracking
🏨 Hospitality & CateringLinen management, kitchen equipment, room maintenance
🏬 Retail & CommerceMulti-store management, product inventory, incident tracking
🏗️ ConstructionConstruction equipment management, tool tracking
🚚 Logistics & WarehousingStorage zone management, stock movement tracking

✨ Key Features

🏢 Multi-Site Management (Multi-Tenancy)

  • Multiple sites: Manage several locations from a single interface
  • Headquarters site: Centralized administration with global access
  • Per-site permissions: Each user has specific roles/permissions per site
  • Dynamic site switching: Switch between sites without logging out

🗺️ Hierarchical Zone Organization

  • Nested zones: Unlimited tree structure (Building → Floor → Room)
  • Hierarchical visualization: Intuitive tree navigation
  • Property inheritance: Configuration propagated to child zones

🔧 Equipment & Material Management

  • Complete records: Reference, brand, model, serial number, acquisition date
  • Zone assignment: Precise location for each piece of equipment
  • QR Codes: Automatic generation for quick identification
  • Full history: Traceability of all interventions on each material

📦 Stock & Inventory Management

  • Items catalog: Complete catalog with references, descriptions, units
  • Stock movements: Entries, exits, transfers with full traceability
  • QR Codes: Automatic generation for quick identification
  • Price history: Track purchase cost evolution
  • Stock alerts: Configurable thresholds for reordering

🏢 Company Management

  • Unified company model: Companies can be item providers, maintenance contractors, or both
  • Type-based filtering: Filter companies by their role (ITEM_PROVIDER, MAINTENANCE_PROVIDER)
  • Headquarters management: Centralized database managed from HQ site
  • Full traceability: Track all items and maintenances linked to each company

🛠️ Maintenance & Interventions

  • Scheduling: Preventive maintenance with configurable recurrence
  • Intervention tracking: Statuses (scheduled, in progress, completed, cancelled)
  • External contractors: Maintenance company management
  • Costs & budgets: Track expenses per intervention

🧹 Cleaning Management

  • Cleaning schedules: Configurable frequencies per zone
  • Service tracking: Validation and history of cleaning sessions
  • Quality control: Notes and comments on services

⚠️ Incident Management

  • Simplified reporting: Quick reporting with location
  • Priority levels: Critical, high, medium, low
  • Resolution workflow: Statuses and team assignment
  • Statistics: Dashboards and indicators

👥 User & Access Management

  • Secure authentication: Laravel Sanctum (SPA) + Fortify
  • Customizable roles: Admin, Manager, Operator, etc.
  • Granular permissions: Fine-grained access control per feature
  • Per-site permissions: Users can have different roles depending on the site

🌐 Internationalization

  • Multi-language: French and English included
  • User preferences: Language saved per profile
  • Extensible: Easy addition of new languages

🔔 Notifications

  • Real-time notifications: Alerts and important events
  • Notification center: Searchable history
  • Read/unread marking: Individual and bulk management

📅 Calendar & Event Categories

  • Unified calendar view: Aggregated view combining calendar events, maintenances, and incidents
  • Event categories: Organize events with customizable categories (name, color, description)
  • Full CRUD: Create, edit, delete events with drag & drop support
  • Date range filtering: Display events within specific time periods
  • Today's events: Quick banner showing current day's events
  • All-day events: Support for full-day or time-specific events
  • Custom colors: Override category color with custom event colors
  • Status-based colors: Maintenances and incidents automatically colored by status

🔍 Global Search

  • Unified search: Search across all resources from a single endpoint
  • Multi-type results: Materials, zones, items, incidents, maintenances, companies, sites
  • Permission-aware: Results filtered based on user's permissions
  • Site-scoped: Regular users see only their site's data, HQ users see all

🏗️ Technical Architecture

Technology Stack

ComponentTechnologyVersion
FrameworkLaravel12.x
LanguagePHP8.4+
DatabasePostgreSQL18+
AuthenticationLaravel Sanctum + Fortify4.x / 1.x
Permissionsspatie/laravel-permission6.x
TestingPest PHP4.x
QR Codesendroid/qr-code6.x
Activity Logspatie/laravel-activitylog4.x

Code Architecture

app/
├── Actions/{Domain}/ # Single-responsibility action classes
├── Enums/{Domain}/ # PHP enums with labels
├── Http/
│ ├── Controllers/Api/V1/ # Versioned API controllers
│ ├── Requests/V1/ # Form Requests with validation
│ ├── Resources/V1/ # JSON transformers
│ └── Middleware/ # Custom middleware
├── Models/ # Eloquent models
├── Observers/ # Lifecycle hooks
├── Policies/ # Resource authorization
└── Services/ # Complex business logic

Data Model

Site (tenant)
├── Zone (hierarchical, self-referential)
│ ├── Material (equipment)
│ │ ├── Cleanings
│ │ ├── Incidents
│ │ └── Maintenances
├── Items (stock)
│ ├── ItemMovements
│ └── ItemPrices
└── Users (with per-site roles)
Headquarters (HQ Site)
└── Companies (unified: item providers + maintenance contractors)
├── types: [ITEM_PROVIDER, MAINTENANCE_PROVIDER]
├── → Items (as supplier)
└── → Maintenances (as contractor)

🚀 Installation

Prerequisites

  • PHP 8.4 or higher
  • Composer 2.x
  • PostgreSQL 18 or higher

Setup

# Clone the repository
git clone https://github.com/XetaIO/XetaSuite-core.git
cd XetaSuite-core
# Install dependencies
composer install
# Configure environment
cp .env.example .env
php artisan key:generate
# Configure database in .env# DB_CONNECTION=pgsql# DB_DATABASE=xetasuite# ...# Run migrations and seeders
php artisan migrate --seed
# Start development server
composer run dev

Important Environment Variables

# ApplicationAPP_URL=https://xetasuite.testSPA_URL=http://localhost:5173# DatabaseDB_CONNECTION=pgsqlDB_DATABASE=xetasuite# Sanctum (SPA)SANCTUM_STATEFUL_DOMAINS=localhost:5173,xetasuite.test# SessionSESSION_DRIVER=databaseSESSION_DOMAIN=.xetasuite.test# Demo mode (optional)DEMO_MODE=false

🧪 Testing

XetaSuite uses Pest PHP for testing with comprehensive coverage:

# Run all tests
php artisan test# Run tests with filter
php artisan test --filter=CompanyController
# Run tests by directory
php artisan test tests/Feature/Observers/

📖 API Documentation

The API follows REST conventions with versioning (/api/v1/). Main endpoints:

EndpointDescription
POST /api/v1/auth/loginAuthentication
GET /api/v1/userCurrent user
PATCH /api/v1/user/siteSwitch site
GET /api/v1/sitesList sites
GET /api/v1/zonesCurrent site zones
GET /api/v1/materialsMaterials
GET /api/v1/itemsItems/Stock
GET /api/v1/maintenancesMaintenances
GET /api/v1/incidentsIncidents
GET /api/v1/cleaningsCleanings
GET /api/v1/companiesCompanies (item providers + contractors, HQ only)

🎭 Demo Mode

XetaSuite can be deployed in demonstration mode:

DEMO_MODE=true

In demo mode:

  • Destructive actions are blocked (deleting sites, users, etc.)
  • Database is reset every 6 hours
  • Test accounts available: admin@xetasuite.demo, manager@xetasuite.demo, user@xetasuite.demo

🤝 Contributing

Contributions are welcome! Please review the contribution guide before submitting a Pull Request.

# Format code before committing
vendor/bin/pint --dirty

📄 License

XetaSuite is open-source software licensed under the MIT license.


🔗 Links

About

XetaSuite is a multi-tenant ERP designed for comprehensive facility, equipment, and inventory management.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages