Sveltekit Eventsourced Funnel screenshot

Sveltekit Eventsourced Funnel

Updated: 17 Dec 2021
6 Stars

sveltekit eventsourced funnel - demonstates how to build sveltekit app with event sourcing via the sourced lib and svelte stores backed by local storage

Categories

Overview:

This article discusses a project called “sveltekit-eventsourced-funnel” which showcases the creation of a SvelteKit project using event sourcing. The project demonstrates several key features, including the use of Plain Old JavaScript Object (POJOs) for event sourced models, the implementation of the repository pattern for persistence using local storage, and the separation of logic from components. The article also mentions the inclusion of Tailwind with a JIT compiler for easy UI copying and pasting. The project itself is a marketing and sales funnel, where each step is represented as a route in the application. The Funnel model, located in the src/lib/models/Funnel.js file, contains the main logic of the application. The article mentions that the project has been bootstrapped with create-svelte and provides further reading resources on event sourcing.

Features:

  • POJOs for event sourced models: The project uses Plain Old JavaScript Objects (POJOs) to implement event sourcing for models.
  • Repository pattern for persistence: The application utilizes the repository pattern for persistence, storing data using local storage.
  • Separation of logic from components: Similar to Redux, the logic in this project is external to the components, allowing for easy integration of analytics and other functionality by hooking into events.
  • Tailwind with JIT compiler: The project includes Tailwind with a Just-In-Time (JIT) compiler, making it easier to copy and paste UI components from various sources such as Tails, TailwindUI, and Shuffle.

Installation:

To install the “sveltekit-eventsourced-funnel” project, follow these steps:

  1. Clone the project repository:

    git clone <repository_url>
    
  2. Navigate to the project directory:

    cd sveltekit-eventsourced-funnel
    
  3. Install the project dependencies:

    npm install
    
  4. Start the development server:

    npm run dev
    
  5. Access the project in your browser at the specified URL.

Summary:

The “sveltekit-eventsourced-funnel” project demonstrates the implementation of event sourcing in a SvelteKit project. It showcases the use of POJOs for event sourced models and the repository pattern for persistence using local storage. The separation of logic from components allows for easy integration of additional functionality through event hooks. The project also includes Tailwind with a JIT compiler for convenient UI component copying. This project serves as a useful example for developers looking to create SvelteKit projects with event sourcing.