Pronto is a reference implementation of a food delivery application built with Svelte. It demonstrates how to integrate Salesforce Personalization and Data Cloud for real-time event tracking.
Live Demo: https://pronto-0cbc99400f5d.herokuapp.com/
This project serves as a proof-of-concept for:
- Event Tracking: capturing user interactions (Identity, Catalog Views, Cart actions) and sending them to Salesforce.
- Frontend Architecture: using Svelte v4 with Vite for a performant, component-based UI.
- State Management: utilizing native Svelte Stores for handling cart and session state.
- Framework: Svelte 4
- Build: Vite
- State: Svelte Stores
- Analytics: Salesforce Interactions SDK (WebSDK)
src/lib/websdk.js: Wrapper for the Salesforce SDK. Handles initialization and event payloads.src/lib/stores.js: Centralized store forcartanduserstate.src/App.svelte: Main layout and initialization logic.
- Node.js 16+
- npm 8+
git clone <repo>
npm install-
Copy
.env.exampleto.env:cp .env.example .env
-
Fill in the required environment variables in
.env:TOKEN_ENDPOINT_URLSALESFORCE_PROXY_URLSLACK_WEBHOOK_URL
Run the local dev server:
npm run devBuild for production:
npm run buildThis project is configured to run on Heroku as a static site using serve.
-
Install the Heroku CLI: Download and install the Heroku CLI for your OS.
-
Login to Heroku:
heroku login
-
Create a new Heroku app:
heroku create
-
Deploy:
git push heroku main
-
Open the app:
heroku open
Note: The project uses a Procfile to execute npm start, which runs serve -s dist -l $PORT. Ensure your dist folder is built before local testing, but Heroku will handle the build automatically if npm install runs successfully.