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
- Backend lockfile:
- Frontend repo:
../easty-otc(sibling toeasy-otc-api) — see that repo'spackage.jsonfor frontend dependencies.
How to run
# From the easy-otc-api repo root
composer install
npm install # or: bun installAdmin 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
- Purpose: Allows admins to impersonate users for testing and support
- Features:
- Secure user impersonation
- Audit logging of impersonation sessions
- Middleware protection
- GitHub: lab404/laravel-impersonate
- Documentation: Lab404 Impersonate Docs
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
- Purpose: Comprehensive logging and auditing system for Laravel applications
- Features:
- Model change tracking
- User activity logging
- Audit trail generation
- Security monitoring
- Compliance support
- GitHub: spatie/laravel-activitylog
- Documentation: Spatie Laravel Activity Log Docs
URL Generation
Spatie Laravel Sluggable
- Purpose: Generate URL-friendly slugs from model attributes
- Features:
- Automatic slug generation from model attributes
- Unique slug handling
- Custom slug generation rules
- Slug regeneration options
- GitHub: spatie/laravel-sluggable
- Documentation: Spatie Laravel Sluggable Docs
Frontend
Frontend packages and dependencies will be documented here as they are added to the project.
Installation Commands
To install all dependencies:
# Install PHP dependencies
composer install
# Install frontend dependencies (if working with assets)
npm install
# or
bun installConfiguration
Most packages are configured through Laravel's configuration system. Key configuration files:
config/auth.php- Authentication configurationconfig/permission.php- Spatie Permission settingsconfig/laravel-impersonate.php- Impersonation settingsconfig/scout.php- MeiliSearch configurationconfig/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:
- Ensure compatibility with current Laravel version
- Add proper documentation
- Update this page with package information
- Include security considerations
- Add appropriate tests