Skip to content

Packages & Dependencies

This project uses several key packages to implement specific features and functionality. Below is an overview of the main dependencies and their purposes, organized by backend (API) and frontend.

Where this lives

  • API repo: easy-otc-api (GitHub: Eliinova/the-one-otc-api)
    • Backend lockfile: composer.lock
    • Node tooling lockfile: package.json / lockfile
  • Frontend repo: ../easty-otc (sibling to easy-otc-api) — see that repo's package.json for frontend dependencies.

How to run

bash
# From the easy-otc-api repo root
composer install
npm install   # or: bun install

Admin panel (to verify package-driven features like roles/activity logs/tags) lives at https://stage-api.easyotc.com/admin on staging and http://localhost:8000/admin locally. See /access for the full URL list and credentials guidance — admin access requires the OTC_ONE_ADMIN role (app/Enums/RoleEnum.php).

API

Core Framework

Laravel 12

  • Purpose: The main PHP framework providing the foundation for the application
  • Features: Routing, middleware, authentication, database ORM, caching, and more
  • Documentation: Laravel Documentation

Authentication & Authorization

Laravel Sanctum

  • Purpose: API token authentication for SPA and mobile applications
  • Features: Token-based authentication, CSRF protection, session handling
  • Documentation: Laravel Sanctum

Spatie Laravel Permission

  • Purpose: Role-based access control and permissions management
  • Features:
    • Define roles and permissions
    • Assign permissions to roles
    • Check permissions in controllers and views
    • Super admin bypass via Gate::before
  • GitHub: spatie/laravel-permission
  • Documentation: Spatie Permission Docs

User Management

Lab404 Laravel Impersonate

Search & Indexing

MeiliSearch PHP

  • Purpose: Fast and relevant search functionality for products and entities
  • Features:
    • Typo-tolerant search
    • Fast search results
    • Faceted search capabilities
    • Real-time indexing
  • GitHub: meilisearch/meilisearch-php
  • Documentation: MeiliSearch PHP Docs

Auditing & Logging

Spatie Laravel Activity Log

URL Generation

Spatie Laravel Sluggable

Frontend

Frontend packages and dependencies will be documented here as they are added to the project.

Installation Commands

To install all dependencies:

bash
# Install PHP dependencies
composer install

# Install frontend dependencies (if working with assets)
npm install
# or
bun install

Configuration

Most packages are configured through Laravel's configuration system. Key configuration files:

  • config/auth.php - Authentication configuration
  • config/permission.php - Spatie Permission settings
  • config/laravel-impersonate.php - Impersonation settings
  • config/scout.php - MeiliSearch configuration
  • config/activitylog.php - Laravel Activity Log settings

Version Compatibility

This project is tested with:

  • PHP: 8.2+
  • Laravel: 12.x
  • PostgreSQL: 13+
  • Node.js: 18+

Security Considerations

  • All packages are regularly updated for security patches
  • Laravel Sanctum provides secure API authentication
  • Spatie Permission ensures proper access control
  • User impersonation is logged and audited
  • Spatie Laravel Activity Log provides comprehensive change tracking and user activity monitoring
  • Environment variables are used for sensitive configuration

Contributing

When adding new packages:

  1. Ensure compatibility with current Laravel version
  2. Add proper documentation
  3. Update this page with package information
  4. Include security considerations
  5. Add appropriate tests