subodh / smart-ai-assistant
A reusable Laravel package providing a smart AI assistant for AEPS error handling.
Package info
github.com/ksubodh9/smart-ai-assistant
Language:JavaScript
pkg:composer/subodh/smart-ai-assistant
Requires
- php: >=8.1
- illuminate/support: ^10.0|^11.0
- phpoffice/phpspreadsheet: ^1.29
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.
๐ 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 IDdescription: Message textattachment: 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?
- Clear all Laravel caches
- Republish assets with
--force - Hard refresh browser
JavaScript errors?
- Check all 4 JS files are loaded
- Verify load order in widget.blade.php
- Check browser console
Styles not applying?
- Verify CSS file is loaded
- Check for CSS conflicts
- 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
- Start with QUICK_REFERENCE.md
- Study ARCHITECTURE.md
- Review code comments in JS files
For Designers
- Review assistant.css
- Check color palette in docs
- Inspect animations
For Testers
- Follow testing checklist above
- Test on multiple browsers
- Test error scenarios
๐ค Contributing
This is a proprietary package for Maddox Pay. Internal contributions welcome.
Development Workflow
- Make changes in
packages/smart-ai-assistant/ - Test locally
- Publish assets
- Test in browser
- 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:
- Check documentation files
- Review troubleshooting section
- Check browser console
- 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