Introduction
Welcome to the OTC Platform documentation!
This project is a modern, full-stack application designed to streamline product management, user administration, and e-commerce workflows. It consists of a Laravel API backend and a Nuxt.js frontend, offering a robust and scalable solution for both developers and end-users.
In this documentation, you'll find everything you need to get started, from installation instructions to advanced features and troubleshooting tips.
Features
- Multi-tenant Architecture: Support for multiple insurance carriers
- Role-based Access Control: Super admins, admins, and members with Laravel Permissions
- Product Management: Flexible categorization system with polymorphic relationships
- Shopping Cart: Full cart functionality with carrier and member associations
- Member Impersonation: Admins can impersonate members for purchases and support purposes
Packages & Dependencies
This project uses several key packages to implement specific features:
User Impersonation
- lab404/laravel-impersonate - Allows admins to impersonate users for testing and support purposes
Roles & Permissions
- spatie/laravel-permission - Handles role-based access control and permissions throughout the application
Search Engine
- meilisearch/meilisearch-php - Provides fast and relevant search functionality for products and other entities
Requirements
- PHP 8.4+
- Composer 2.8+
- Node.js 22+
- Bun 1.2+
- PostgreSQL 13+
- Redis 8.0+
- Meilisearch 1.15+
Installation
Clone the repository
bashgit clone <repository-url> cd the-one-otc-apiInstall dependencies
bashcomposer installEnvironment setup
bashcp .env.example .env php artisan key:generateConfigure database Edit
.envfile with your database credentials:envDB_CONNECTION=pgsql DB_HOST=127.0.0.1 DB_PORT=5432 DB_DATABASE=otc_api DB_USERNAME=your_username DB_PASSWORD=your_passwordRun migrations and seeders
bashphp artisan migrate:fresh --seedStart the development server
bashphp artisan serve
Database Structure
Core Tables
users- Authentication and basic user info (with roles: super_admin, admin, member)carriers- Insurance companies (multi-tenant)members- Member-specific data (personal info, plan details)products- OTC productscarts- Shopping carts with carrier/member associationscategorizations- Polymorphic categorization system
Roles & Permissions
- super_admin: All permissions (via Gate::before)
- admin: Can impersonate members
- member: No special permissions
API Endpoints
Documentation coming soon...
Development
Running Tests
php artisan testCreating New Migrations
php artisan make:migration create_new_tableCreating New Models
php artisan make:model ModelName -mLicense
This project is proprietary software.