Skip to content

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

Roles & Permissions

Search Engine

Requirements

  • PHP 8.4+
  • Composer 2.8+
  • Node.js 22+
  • Bun 1.2+
  • PostgreSQL 13+
  • Redis 8.0+
  • Meilisearch 1.15+

Installation

  1. Clone the repository

    bash
    git clone <repository-url>
    cd the-one-otc-api
  2. Install dependencies

    bash
    composer install
  3. Environment setup

    bash
    cp .env.example .env
    php artisan key:generate
  4. Configure database Edit .env file with your database credentials:

    env
    DB_CONNECTION=pgsql
    DB_HOST=127.0.0.1
    DB_PORT=5432
    DB_DATABASE=otc_api
    DB_USERNAME=your_username
    DB_PASSWORD=your_password
  5. Run migrations and seeders

    bash
    php artisan migrate:fresh --seed
  6. Start the development server

    bash
    php 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 products
  • carts - Shopping carts with carrier/member associations
  • categorizations - 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

bash
php artisan test

Creating New Migrations

bash
php artisan make:migration create_new_table

Creating New Models

bash
php artisan make:model ModelName -m

License

This project is proprietary software.