To continue providing the best service and quality of work to our clients, we will be revising the pricing for our sprint based Svelte and SvelteKit development services . The new pricing will be effective from 1st March 2024 .

Stay tuned for more details, and feel free to reach out to us for any questions.

Building an MVP Fast with SvelteKit: How We Created a Google Analytics Dashboard in 3 Weeks

Justin's profile pic

Justin Ahinon

Enter your email to get this article emailed to you

As web developers, startups or agencies, we often face the challenge of building minimum viable products (MVPs) quickly . Recently, our team at Okupter took on this challenge when creating Dashlitics, a simplified dashboard for visualizing Google Analytics data.

In just three weeks, we successfully built an MVP that extracts key data from Google Analytics and displays it in easy-to-understand charts and summaries. This allows users to instantly gain insights into their website's performance without navigating complex data tables.

In this case study, we'll share how we rapidly developed this MVP using SvelteKit, Svelte's flagship web framework. We'll cover:

  • Why we chose SvelteKit and how its features enabled agile development

  • Optimizations we made, like refactoring state management

  • Results we achieved in the short 3-week timeframe

  • Key learnings that can help other teams build MVPs efficiently

Whether you're already using SvelteKit or considering it for your next project, we think this case study provides valuable insights. With the right technologies and techniques, you can develop working prototypes incredibly quickly.

Shipping the Dashlitics MVP with SvelteKit in three weeks

Choosing Our Tech Stack

When embarking on any new project, one of the most crucial decisions is choosing the right technologies. For Dashlitics, we wanted a stack that would enable rapid, agile development, so we could build an MVP quickly.

After evaluating different options, we ultimately chose SvelteKit as our core framework. SvelteKit met all our criteria:

Performance

Svelte is known for one of the most performance UI framework out there . It's fast, it's lightweight and it has a small footprint. This is a huge advantage when building a dashboard that needs to load a lot of data and display it in real-time.

Svelte gets this performance by compiling your code at build time.

This means that there is no virtual DOM, no framework code to load and no runtime library. The result is a small bundle size and a fast loading time.

Simplicity

Svelte's clean, intuitive syntax and small API surface area meant we could develop features rapidly with less overhead.

Developer Experience

Svelte is also known for its developer experience. It's easy to learn, easy to use, well documented, and it has a small learning curve. In fact, writing Svelte code is actually writing vanilla JavaScript, HTML and CSS. This makes it easy to get started and to get productive quickly.

Flexibility

We appreciated how SvelteKit gave us freedom over structuring and routing in our app.

In addition to SvelteKit, we utilized other modern web technologies:

  • TypeScript - For type safety, reducing bugs, and enhancing developer experience.

  • Tailwind CSS - For quick styling using utility-first CSS classes.

  • PlanetScale - As our MySQL database service. This gives us interesting features like nice local environment, migrations handling, revert and rollback features, etc.

  • Chart.js - As our chart library. It integrates nicely with Svelte without needing a wrapper, and is highly customizable.

This combination gave us the ideal setup for crafting our MVP efficiently.

Specifically, SvelteKit enabled:

  • Creating custom components like charts and filters using Svelte's declarative syntax.

  • Integrating data from the Google Analytics API into our app seamlessly.

  • Quickly building pages and routes to handle different data views and filters.

  • Leveraging SvelteKit features like code splitting to optimize performance.

In short, we found SvelteKit to be the perfect match for spinning up a performant, agile MVP app in a matter of weeks.

Ship That MVP!

Tired of slow development? Get your minimal viable product powered by SvelteKit in just weeks .

Our productized sprints provide the skills and speed to rapidly prototype your app idea.

Just $2.5k per sprint, no long-term contracts .

Building the MVP

Constructing Core Components with Svelte

As experienced Svelte developers, we felt right at home constructing the core components in Svelte. The declarative, component-focused nature of Svelte was ideal for rapidly developing the custom data visualization elements that formed the heart of Dashlitics.

For example, we were able to quickly build reusable charts that accepted analytics data as props, handling things like axes, labels, interactivity, and responsive design with just a bit of clean Svelte code.

Svelte's compiler took care of optimizing these components into highly performant JavaScript. This meant snappy, smooth chart interactions right off the bat - crucial for data-heavy dashboards.

We also leveraged Svelte features like stores and context APIs for state management between components. This helped us coordinate filters, selected data, etc. across the app.

Dashlitics dashboard with SvelteKit and Chart.js

Streamlined Authentication with SvelteKit

As with any SaaS application, we needed to implement user authentication and access controls in Dashlitics. This is rarely a core product feature, but rather a necessary component in the background .

Thankfully, SvelteKit provided useful tools that allowed us to rapidly add auth to Dashlitics with minimal overhead.

Specifically, we:

  • Used SvelteKit hooks on load to check auth state on each page. This abstracted auth logic away from components and server functions.

  • Stored the user's authenticated state in locals rather than a global store. This kept auth status localized to each request.

  • Created wrapper components that conditionally showed UIs based on $page.locals.user . This allowed us to easily gate certain views like settings or billing.

Overall, SvelteKit’s capabilities like hooks, locals, and stores greatly accelerated what could have been time-consuming boilerplate work.

We were able to focus efforts on the core product features rather than get bogged down implementing standard auth workflows .

Integrating Live Data with SvelteKit

Fetching live data from the Google Analytics API was a breeze thanks to SvelteKit's built-in capability for server-side data fetching. We were able to integrate real-time analytics data into Dashlitics components without headaches.

Developing Pages and Routes

When it came time to combine these pieces into pages, SvelteKit’s file-system-based routing helped us progress rapidly. We could add new pages like “Overview Dashboard”, “Geo Analytics” and wire up routing in a logical, readable way.

Results

By the end of the 3-week sprint, we had built a solid, working MVP that delivered on our vision. For a new product, progress was rapid thanks to SvelteKit's performance, simplicity, and extensibility.

Key Challenges and Learnings

As with any new project, we encountered some challenges and made key optimizations along the way while building the Dashlitics MVP.

Refactoring State Management

Initially, we relied heavily on Svelte stores to manage state globally. Over time, this led to hard-to-manage complexity as stores were updated in unpredictable ways across the app.

Thankfully, we realized the solution was right in front of us - SvelteKit's routing system! We refactored to put state into URLs instead, using query parameters and typed endpoints to manage filters, selected data, etc.

This “a-ha” moment greatly simplified our architecture.

The URL became the single source of truth, eliminating confusion with stores .

Benefits of the State Refactor

Refactoring state management into the URL via routing delivered huge benefits:

  • It simplified our architecture and logic flow tremendously.

  • URLs and query params became predictable sources of state.

  • We got native browser benefits like history, linking, and bookmarking for free.

  • Server-side data fetching could derive state from endpoints and URLs.

Looking back, this refactor exemplified the flexibility of SvelteKit. We were able to improve our codebase significantly without wasting previous effort.

Performance Optimizations

We also made optimizations like code splitting routes and lazy loading heavy dependencies. SvelteKit's modular design made these enhancements straightforward.

While not the most exciting work, these improvements noticeably boosted load times and runtime performance.

Key Takeaway

Looking back, our biggest lesson was the power of SvelteKit’s routing for state management. Leaning into the framework’s design rather than over-relying on stores was the right path forward.

This exemplified SvelteKit’s flexibility - we creatively adapted it to our needs, rather than being constrained by prescriptive opinions. The result was a major improvement to our architecture.

Results and Benefits

In the end, we were thrilled with what we accomplished in just 3 weeks of focused sprints to build the Dashlitics MVP .

SvelteKit was absolutely key in allowing us to progress so rapidly from concept to working prototype.

Dashlitics reports

Milestones Achieved

In the short timeframe, we:

  • Built over 15 custom Svelte data visualization components like charts, tables and filters.

  • Integrated live Google Analytics data through API calls.

  • Constructed 5 core pages including overview dashboard, geo analytics, real-time reports and user settings.

  • Implemented user authentication flows for demo accounts.

  • Optimized and refactored the app architecture for maintainability.

The SvelteKit Advantage

We couldn't have moved so fast without SvelteKit's capabilities:

  • Rapid component development in Svelte.

  • Built-in data fetching and declarative endpoints.

  • File-system based routing for organic project structure.

  • Stores for state management between components.

  • Code splitting and lazy loading for optimized performance.

SvelteKit removed so much repetitive work that we could focus efforts on the unique value of Dashlitics .

What's Next

We're thrilled with the initial MVP, but even more excited to keep enhancing Dashlitics. Next up, we'll focus on:

  • Adding more advanced analytics like funnel reporting.

  • Expanding custom dashboard functionality based on user feedback.

  • Exploring SvelteKit SSR for SEO benefits.

  • Integrating visualization options like Charts.js.

Thanks to our agile foundation, we're confident future development will move smoothly and quickly.

Ship That MVP!

Tired of slow development? Get your minimal viable product powered by SvelteKit in just weeks .

Our productized sprints provide the skills and speed to rapidly prototype your app idea.

Just $2.5k per sprint, no long-term contracts .

Conclusion

SvelteKit for Efficient MVPs

Based on our experience building the Dashlitics MVP, we enthusiastically recommend SvelteKit for rapid, agile prototype development .

SvelteKit removes the repetitive work of building MVPs so you can focus on crafting unique value vs implementing boilerplate. Its performance and simplicity enabled us to go from idea to working product much faster than otherwise possible.

For any team looking to build a lightweight MVP, prototype, concept demo or even production grade application, SvelteKit is an excellent choice to expedite the process.

Partnering for Your MVP

We hope this case study provides valuable insights into leveraging SvelteKit to build MVPs efficiently.

If you're looking to create your own minimal viable product, the Okupter team would love to help!

Our productized SvelteKit development service specializes in crafting tailored prototypes based on your specific goals and constraints.

Here's how it works:

  • 2 Week Sprints  - Each sprint, we'll collaborate to determine the priority tasks and features to complete in that cycle. This allows us to remain agile and adaptable.

  • Fixed $5k/Month Price  - Simple predictable pricing, no hourly billing. Cancel anytime.

  • Hands-on Founder Access  - You'll work directly with myself, Okupter's founding engineer. I have 2+ years of Svelte/SvelteKit experience delivering production apps.

Whether you need a customer-validation MVP, internal concept prototype, or a Hackathon project built with SvelteKit, we can partner to make it happen efficiently.

Reach out anytime to get the conversation started on how we can help expedite your next idea!

You might also like these blog posts

A lovely bath

Can SvelteKit be Used for Landing Pages? Absolutely, Here's Why and How

Discover the power of SvelteKit in creating high-converting landing pages. Learn why SvelteKit is the go-to choice for developers at Okupter, a leading Svelte development agency

A lovely bath

Top 5 React Alternatives for Web Applications Development

Explore the alternatives to React such as Svelte, Vue, Angular, and more. Learn why they matter and how they can drive your project's success.