Svelte standalone web app for stock chatbot.
this app made with Svelte Standalone - https://standalone.brenoliradev.com/
How to create a Svelte standalone app?
1.Create a Svelte App: a. npx sv create my-app (you can add tailwind) b. cd my-app c. npm install
Clean Up – Remove svelte boilerplate code (e.g., routes, components). Files to delete: a. src/components/Counter.svelte (if exist) b. src/assets/svelte.svg (if exist) c. src/routes/+page.svelte (if exists)
Install Svelte Standalone a. npm install -D svelte-standalone@latest
Generates boilerplate code for a new standalone component a. npx standalone create b. Name your component: Enter a name for your component (e.g., payments). c. Choose an embedding strategy (for the chatbot option B is teh best): A. Explicit Call (Single Instance): Mounts the component once using window.payments.start(). B. Explicit Call (Multiple Instances): Allows mounting multiple instances with window.payments.start(). C. Auto-Embed with Target ID: Automatically appends to an element with a specified id. D. Auto-Embed with Target Class: Automatically appends to elements with a specified class. E. Auto-Embed on Body: Automatically appends to the
when downloaded.now look at src/_standalone/name_of_your_component (e.g payments)
a. create file and name it embed.js and put this code in it:
import { autoEmbedWithTarget } from 'svelte-standalone';
import Example from './index.svelte'; // your embedabble
autoEmbedWithTarget(Example, 'example');
b. index.svelte - this is the file where you code your regular svelte code
c. for using tailwind you need to import tailwind in each index.svelte component jsut add in the