A comprehensive assistant chatbot with real-time stock market data and AI-powered responses.
This repository contains both frontend and backend components of the chatbot:
/client
: Frontend web component built with Svelte/server
: Backend API built with FastAPIEach directory contains its own detailed README with specific setup and implementation instructions.
The frontend is implemented as a standalone web component that can be embedded in any website:
The web component approach allows for easy integration with various platforms, including WordPress and other content management systems, through Google Tag Manager or direct embedding.
The backend provides intelligent responses and real-time financial data:
For detailed setup instructions, refer to the README files in the respective directories:
The application is designed for flexible deployment:
The chatbot can be integrated into any website by including the JavaScript bundle and inserting a custom HTML tag:
<script src="https://your-host.com/swc.iife.js"></script>
<swc-chatwidget></swc-chatwidget>
For WordPress sites, Google Tag Manager integration is recommended for easier management.
Create a GTM account and connect via the GTM4WP plugin in WordPress.
Add a new Custom HTML tag and insert:
<script src="https://your_vps_hosting_the_component/swc.iife.js" id="swc-script-loader"></script>
<script>
(function() {
console.log('[SWC Debug V2] Inline script started.');
function createAndAppendWidget() {
if (customElements.get('swc-chatwidget')) {
console.log('[SWC Debug V2] Definition found. Appending widget...');
try {
var chatWidget = document.createElement('swc-chatwidget');
document.body.appendChild(chatWidget);
console.log('[SWC Debug V2] Successfully appended swc-chatwidget.');
} catch (e) {
console.error('[SWC Debug V2] Error creating/appending element:', e);
}
} else {
console.error('[SWC Debug V2] swc-chatwidget still not defined!');
}
}
if (customElements.get('swc-chatwidget')) {
console.log('[SWC Debug V2] Element defined. Creating immediately.');
createAndAppendWidget();
} else {
console.log('[SWC Debug V2] Waiting for loader script…');
var loader = document.getElementById('swc-script-loader');
if (!loader) {
console.error('[SWC Debug V2] Could not find loader script tag!');
return;
}
loader.addEventListener('load', function() {
console.log('[SWC Debug V2] Loader loaded. Attempting creation.');
createAndAppendWidget();
});
loader.addEventListener('error', function(event) {
console.error('[SWC Debug V2] Error loading swc.iife.js!', event);
});
console.log('[SWC Debug V2] Fallback listeners attached.');
}
})();
</script>
<script>
console.log("here from gtm");
</script>