// backend/realtime.jsw import { publish } from 'wix-realtime'; /** * Broadcast a payload to everyone in a chat room. * Channel naming: room: */ export function broadcast(roomId, payload) { return publish(`room:${roomId}`, payload); }
top of page

Your New AI Assistant

9104DC6B-ECCC-48BD-9F0A-646CC646095C.PNG

Get AI-Generated Business Solutions in Seconds

All Your Business Needs in a Single AI-Powered Workspace

A

DEEP DIVE ANALYSIS IN SECONDS

Experience the power of our business solutions and tools built around the needs of entrepreneurs and business owners like you. With our deep dive analysis capabilities, you can get the information you need to stay ahead of the competition and succeed in today's fast-paced business world.

B

DATA VISUALIZATION

This innovative platform has everything you need to manage your business in one place. From scheduling appointments to managing customer data, our platform streamlines all your day-to-day operations. Say goodbye to tedious tasks and hello to more time to focus on what really matters— growing your business. With our state-of-the-art CRM, data visualization and creative visuals, you will have all the tools you need to take your business to the next level.

C

CUSTOM AI SOLUTIONS

Say goodbye to the headaches of monotonous tasks that take up so much of your time. At our company, we leverage the power of automation and AI to help business owners streamline their processes and maximize their potential. We’re dedicated to providing cutting-edge digital solutions that are tailored to your business needs, so you don’t have to lift a finger. Our digital assistant is here to ensure that your workflow is always optimized and efficient.

D

BUILD FUNNELS THAT WORK

Streamline the buying process and ensure that customers are satisfied with their purchase.

From lead generation to customer retention, we are here to help you implement a sales funnel strategy that works. 

E

KEEP YOUR DATA SECURE

In today's digital age, security is more important than ever. Protecting your business and your clients’ data from cyber threats can make or break your company. That’s why we offer the latest, most advanced security solutions. Our team of experts in website and funnel development will ensure your website and funnel security is fully set up to prevent hackers and cybercriminals. Partner with us to protect your business and maintain your client's trust.

A Seamless User Experience

FEATURE 1

FLEXIBLE PLATFORM

FEATURE 2

FULLY SECURED

FEATURE 3

TIME SAVER

FEATURE 4

KEEP TRACK

FEATURE 5

MORE FOCUS

FEATURE 6

DYNAMIC BUT SIMPLISTIC

Automate Your Business and Enjoy More Freedom

The modern business environment demands businesses to automate and streamline their operations in order to keep up with the pace of competition. Our AI-powered systems can help you achieve this, allowing you to focus on growing your brand while we take care of the rest. Our cutting-edge technology provides the tools you need to grow your business with confidence, increasing the efficiency of your operations and allowing you to reach new heights.

EF9C3D41-B6E1-4CFE-ADF2-FA4926DD4C5C.png

Get All the Tools You Need In a Single Platform

bottom of page
// backend/data.js import { broadcast } from 'backend/realtime'; /** * Fires after a document is inserted into the Messages collection * (Collection name: Messages -> function name: Messages_afterInsert) */ export function Messages_afterInsert(item, context) { // Keep the payload lean; it's sent to all subscribers. const payload = { _id: item._id, text: item.text, userId: item.userId, userName: item.userName, roomId: item.roomId, createdAt: item.createdAt }; // Fire-and-forget broadcast; don't block the insert lifecycle. broadcast(item.roomId, payload); return item; } // backend/data.js import { broadcast } from 'backend/realtime'; /** * Fires after a document is inserted into the Messages collection * (Collection name: Messages -> function name: Messages_afterInsert) */ export function Messages_afterInsert(item, context) { // Keep the payload lean; it's sent to all subscribers. const payload = { _id: item._id, text: item.text, userId: item.userId, userName: item.userName, roomId: item.roomId, createdAt: item.createdAt }; // Fire-and-forget broadcast; don't block the insert lifecycle. broadcast(item.roomId, payload); return item; } // Page code (e.g., Chat page) import wixData from 'wix-data'; import wixUsers from 'wix-users'; import { subscribe, unsubscribe } from 'wix-realtime'; // If you use Wix Members profile names, you can also import: // import { currentMember } from 'wix-members'; let roomId = 'global'; // default room (or drive from #roomPicker) let myUser = null; let realtimeSub = null; $w.onReady(async () => { myUser = wixUsers.currentUser; initRepeaterItemUI(); await loadMessages(); // Realtime subscribe resubscribe(); // Send message $w('#sendButton').onClick(sendCurrentMessage); $w('#messageInput').onKeyPress((e) => { if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); sendCurrentMessage(); } }); // Optional: switch rooms if ($w('#roomPicker')) { $w('#roomPicker').onChange(async () => { roomId = $w('#roomPicker').value; await loadMessages(); resubscribe(); }); } }); function initRepeaterItemUI() { $w('#messagesRepeater').onItemReady(($item, itemData) => { const mine = itemData.userId === (myUser?.id ?? 'anon'); // Hide both by default, then show one $item('#leftBubble').collapse(); $item('#rightBubble').collapse(); if (mine) { $item('#rightText').text = itemData.text || ''; $item('#rightMeta').text = metaText(itemData); $item('#rightBubble').expand(); } else { $item('#leftText').text = itemData.text || ''; $item('#leftMeta').text = metaText(itemData); $item('#leftBubble').expand(); } }); } function metaText(item) { const name = item.userName || (item.userId ? `User ${item.userId.slice(0,6)}` : 'User'); const ts = item.createdAt ? new Date(item.createdAt).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) : ''; return `${name} • ${ts}`; } async function loadMessages() { const results = await wixData.query('Messages') .eq('roomId', roomId) .ascending('createdAt') .limit(200) // adjust / paginate as needed .find(); $w('#messagesRepeater').data = results.items; focusInput(); } function focusInput() { setTimeout(() => { if ($w('#messageInput')) $w('#messageInput').focus(); }, 50); } async function sendCurrentMessage() { const text = ($w('#messageInput').value || '').trim(); if (!text) return; const item = { text, userId: myUser?.id || 'anon', userName: await getDisplayName(), // or null roomId // createdAt is auto-set in the collection (Default: Now) }; await wixData.insert('Messages', item); // Triggers afterInsert -> broadcast $w('#messageInput').value = ''; } async function getDisplayName() { // Option A (simple): use email local-part if available try { if (myUser?.loggedIn) { const email = await myUser.getEmail(); if (email) return email.split('@')[0]; } } catch (e) { /* ignore */ } // Option B (comment in if using Wix Members): // try { // const member = await currentMember.getMember(); // return member?.profile?.nickname || member?.loginEmail || 'Member'; // } catch (e) {} return myUser?.loggedIn ? 'Member' : 'Guest'; } function resubscribe() { // Clean up the previous subscription if any if (realtimeSub) { try { unsubscribe(realtimeSub); } catch (e) {} realtimeSub = null; } // Subscribe to the current room channel realtimeSub = subscribe(`room:${roomId}`, (message) => { const payload = message?.payload; if (!payload) return; const data = $w('#messagesRepeater').data || []; data.push(payload); $w('#messagesRepeater').data = data; focusInput(); }); }