Carlsson Insurance Portal is a comprehensive hierarchical sales and commission management system built with Laravel and React. It is designed to handle complex insurance policy life cycles, agent hierarchies (multi-level), production tracking, and automated reporting for bonuses and allowances.
- Hierarchical Agent System: Manage agents with multi-level relationships (Leader, Team, Agency).
- Customer & Policy Holders: Centralized database for clients and insured individuals.
- Products & Programs: Configurable insurance products, riders, investment funds, and financing programs.
- Agency & Contests: Manage agency structures and sales contests (Bonanza, Sem-Consistent, etc.).
- Policy Management: Full CRUD for insurance policies.
- OCR Automation: Intelligent extraction of policy data from PDF documents using OCR, reducing manual entry.
- Receipt Tracking: Manage premium payments and billing cycles.
- Production Reports: Detailed analysis of sales performance (FYP, APE, Cases).
- Commission & Bonus Calculation: Automated monthly, semester, and annual reports calculating:
- Basic Commission
- Overriding Commission (Leader/Agency levels)
- Recruit Bonuses
- Production Bonuses (MDRT, Super Achiever)
- Allowance/Financing Calculations
- Performance Optimized: Uses advanced SQL optimization (CTEs and Request Caching) to handle heavy aggregations for annual reports without timeouts.
- Operational Reports: Birthday lists, Due Dates, and Policy Lapses.
- Framework: Laravel 12
- Database: MySQL (Heavy use of raw SQL optimizations and pivot tables)
- Authentication: Laravel Fortify
- PDF Processing:
smalot/pdfparser,helgesverre/extractor
- Framework: React 19
- Bridge: Inertia.js (Monolithic-like DX with SPA performance)
- Styling: Bootstrap 5, Sass
- Build Tool: Vite
- Charts: Chart.js, ApexCharts
- PHP >= 8.2
- Composer
- Node.js & NPM
- MySQL
-
Clone the repository
git clone https://github.com/yourusername/richkingdom.git cd InsurancePortal -
Install PHP Dependencies
composer install
-
Install Frontend Dependencies
npm install
-
Environment Setup Copy the example environment file and configure your database credentials.
cp .env.example .env php artisan key:generate
-
Database Migration Run migrations to set up the schema.
php artisan migrate
-
Build Assets
npm run build
-
Run Locally Start the development server (requires two terminals or background processes).
# Terminal 1: Laravel Server php artisan serve # Terminal 2: Vite Dev Server npm run dev
- OCR Policy Import: Upload a policy PDF, and the system auto-fills the entry form with applicant details, premiums, and riders.
- Excel Export: Native support for exporting complex reports (like Monthly Income) to Excel.
- Dynamic Dashboard: Real-time overview of business performance.
This project is open-sourced software licensed under the MIT license.