subodh/smart-ai-assistant

A reusable Laravel package providing a smart AI assistant for AEPS error handling.

Maintainers

Package info

github.com/ksubodh9/smart-ai-assistant

Language:JavaScript

pkg:composer/subodh/smart-ai-assistant

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2025-12-08 09:36 UTC

This package is auto-updated.

Last update: 2026-03-18 06:16:57 UTC


README

A modern, intelligent chat assistant for Laravel applications with automatic error detection, file attachments, and bilingual support.

Version Laravel License

๐ŸŒŸ Features

  • โœ… Auto Error Detection - Automatically scans pages for errors
  • โœ… Clickable Error Tags - Interactive chips for found errors
  • โœ… Modern Chat UI - WhatsApp/ChatGPT-inspired design
  • โœ… File Attachments - Upload images, PDFs, and documents
  • โœ… Fullscreen Preview - View attachments in fullscreen modal
  • โœ… Bilingual Support - English and Hindi responses
  • โœ… Typing Indicators - Animated dots while waiting
  • โœ… Smart Context - Includes error context in queries
  • โœ… Responsive Design - Works on mobile and desktop
  • โœ… Smooth Animations - Professional transitions and effects

๐Ÿ“ธ Screenshots

See the visual mockups showing the modern, premium design!

๐Ÿš€ Quick Start

Installation

This package is already installed in your Laravel application.

Deployment

# Clear caches
php artisan cache:clear
php artisan view:clear

# Publish assets
php artisan vendor:publish --tag=smart-ai-assistant-assets --force
php artisan vendor:publish --tag=smart-ai-assistant-views --force

# Hard refresh browser
# Ctrl + Shift + R

Usage

Add the widget to any Blade template:

<x-smart-assistant-widget />

That's it! The assistant will appear as a floating button in the bottom-right corner.

๐Ÿ“š Documentation

Document Description
UPGRADE_SUMMARY.md Complete upgrade overview
DEPLOYMENT_GUIDE.md Step-by-step deployment
README_UPGRADE.md Feature documentation
ARCHITECTURE.md System architecture
QUICK_REFERENCE.md Developer quick reference
CHANGELOG.md Version history

๐ŸŽฏ How It Works

1. Panel Opens

  • Shows welcome message: "Hello! I'm Soniya"
  • Automatically scans page for errors
  • Displays status: "Scanning your page..."

2. Error Detection

  • Scans for: .alert-danger, .invalid-feedback, .text-danger, .smart-error
  • Displays errors as clickable tags
  • Shows warning icon (โš ๏ธ)

3. User Interaction

  • Click error tag โ†’ Sends to API โ†’ Shows AI response
  • Or type manual message โ†’ Send to support
  • Attach files for context

4. AI Response

  • Returns English and Hindi solutions
  • Displays in chat bubble format
  • Auto-scrolls to bottom

๐ŸŽจ Customization

Change Colors

Edit public/css/assistant.css:

#smart-assistant-toggle {
    background: linear-gradient(135deg, #YOUR_COLOR_1 0%, #YOUR_COLOR_2 100%);
}

Change Assistant Name

Edit resources/views/components/widget.blade.php:

<div class="sa-welcome-title">Hello! I'm YOUR_NAME</div>

Add Error Selectors

Edit public/js/assistant.js:

const errorSelectors = [
    '.alert-danger',
    '.your-custom-selector'
];

๐Ÿ”ง API Endpoints

Error Query

POST /smart-assistant/help

Request:

{
    "error_text": "Error message",
    "page_url": "https://example.com"
}

Response:

{
    "answer_en": "English solution",
    "answer_hi": "Hindi solution",
    "source": "known"
}

Chat Message

POST /customer-support/raise/ticket

FormData:

  • maddox_id: User ID
  • description: Message text
  • attachment: File (optional)

๐Ÿ“ File Structure

packages/smart-ai-assistant/
โ”œโ”€โ”€ public/
โ”‚   โ”œโ”€โ”€ css/
โ”‚   โ”‚   โ””โ”€โ”€ assistant.css
โ”‚   โ””โ”€โ”€ js/
โ”‚       โ”œโ”€โ”€ ui-manager.js
โ”‚       โ”œโ”€โ”€ api-manager.js
โ”‚       โ”œโ”€โ”€ file-preview.js
โ”‚       โ””โ”€โ”€ assistant.js
โ”œโ”€โ”€ resources/
โ”‚   โ””โ”€โ”€ views/
โ”‚       โ””โ”€โ”€ components/
โ”‚           โ””โ”€โ”€ widget.blade.php
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ Http/
โ”‚   โ”‚   โ””โ”€โ”€ Controllers/
โ”‚   โ”œโ”€โ”€ Models/
โ”‚   โ””โ”€โ”€ SmartAiAssistantServiceProvider.php
โ”œโ”€โ”€ config/
โ”‚   โ””โ”€โ”€ smart-ai-assistant.php
โ”œโ”€โ”€ database/
โ”‚   โ””โ”€โ”€ migrations/
โ””โ”€โ”€ routes/
    โ””โ”€โ”€ web.php

๐Ÿงช Testing

Manual Testing Checklist

  • Panel opens with welcome message
  • Error scanning detects errors
  • Error tags are clickable
  • Chat messages display correctly
  • File attachment works
  • Fullscreen preview opens
  • Send button works
  • API responses display
  • Mobile responsive works
  • No console errors

Browser Testing

  • Chrome 90+
  • Firefox 88+
  • Safari 14+
  • Edge 90+
  • Mobile browsers

๐Ÿ› Troubleshooting

Changes not appearing?

  1. Clear all Laravel caches
  2. Republish assets with --force
  3. Hard refresh browser

JavaScript errors?

  1. Check all 4 JS files are loaded
  2. Verify load order in widget.blade.php
  3. Check browser console

Styles not applying?

  1. Verify CSS file is loaded
  2. Check for CSS conflicts
  3. Inspect elements in DevTools

See DEPLOYMENT_GUIDE.md for more troubleshooting tips.

๐Ÿ“Š Version History

v2.0.0 (2025-12-04)

  • Complete UI/UX overhaul
  • Modular JavaScript architecture
  • File attachment system
  • Fullscreen preview modal
  • Modern chat interface
  • Comprehensive documentation

v1.0.0 (2025-11-29)

  • Initial release
  • Basic error detection
  • Simple chat interface

See CHANGELOG.md for detailed history.

๐Ÿ—๏ธ Architecture

Modular Design

  • ui-manager.js - UI interactions and state
  • api-manager.js - Backend communications
  • file-preview.js - File handling and preview
  • assistant.js - Main controller

Data Flow

User Action โ†’ UI Manager โ†’ API Manager โ†’ Backend
                โ†“              โ†“
         Update UI โ† Parse Response

See ARCHITECTURE.md for detailed diagrams.

๐ŸŽ“ Learning Resources

For Developers

  1. Start with QUICK_REFERENCE.md
  2. Study ARCHITECTURE.md
  3. Review code comments in JS files

For Designers

  1. Review assistant.css
  2. Check color palette in docs
  3. Inspect animations

For Testers

  1. Follow testing checklist above
  2. Test on multiple browsers
  3. Test error scenarios

๐Ÿค Contributing

This is a proprietary package for Maddox Pay. Internal contributions welcome.

Development Workflow

  1. Make changes in packages/smart-ai-assistant/
  2. Test locally
  3. Publish assets
  4. Test in browser
  5. Document changes

๐Ÿ“„ License

Proprietary - Maddox Pay

๐Ÿ‘ฅ Credits

Developed for: Maddox Pay
Version: 2.0.0
Last Updated: December 4, 2025

๐Ÿ“ž Support

For issues or questions:

  1. Check documentation files
  2. Review troubleshooting section
  3. Check browser console
  4. Contact development team

๐ŸŽฏ Roadmap

Future Enhancements

  • Voice input support
  • Multi-language support (beyond EN/HI)
  • Advanced analytics
  • Custom themes
  • Keyboard shortcuts
  • Search history
  • Export chat history

๐ŸŒŸ Why Choose Smart AI Assistant?

Before

  • Basic error detection
  • Simple UI
  • Limited functionality
  • No file support
  • Minimal documentation

After (v2.0)

  • โœ… Advanced error detection with tags
  • โœ… Modern, premium UI
  • โœ… Full file attachment system
  • โœ… Fullscreen previews
  • โœ… Comprehensive documentation
  • โœ… Mobile responsive
  • โœ… Smooth animations
  • โœ… Bilingual support

Ready to get started? Check out DEPLOYMENT_GUIDE.md!

Built with โค๏ธ for Maddox Pay
Powered by Maddox AI