Building the Demo Mode: Making Data Accessible in Sqrdo

In this second installment of our Sqrdo development blog series, I want to dive into one of the most important features we've implemented: Demo Mode. This feature has been fundamental in making Sqrdo accessible to users who want to explore the platform before connecting their actual Squarespace store.

Why Demo Mode Matters

When developing Sqrdo, I quickly realized that there was a significant "chicken and egg" problem. Users need to see the value of the dashboard before they'll go through the effort of connecting their store's API credentials, but they can't see the value without connecting first.

Demo Mode solves this problem by providing realistic, pre-populated data that showcases all of Sqrdo's capabilities without requiring any API configuration. This creates a frictionless onboarding experience where users can immediately understand the platform's benefits.

The Technical Implementation

Adding Demo Mode was more complex than simply creating static mockups. I wanted it to feel like a real, interactive experience. Here's how I approached it:

1. Creating a Global Demo Context

I implemented a React context provider (DemoModeProvider) that wraps the entire application, making the demo state accessible throughout all components. This allowed any part of the application to check if demo mode is active and respond accordingly.

2. Consistent Demo Data Across Components

For each major data type (analytics, customers, orders, products), I created realistic sample datasets that showcase the range of scenarios a store owner might encounter:

  • Sales trends with seasonal variations
  • A diverse customer base with different purchase patterns
  • Various order statuses and fulfillment states
  • Products across multiple categories with different performance metrics

3. API Route Integration

One of the most important aspects was updating all the API routes to prioritize demo mode checks. This ensures that when demo mode is active, the application returns mock data instead of attempting to make real API calls

4. User Interface Enhancements

To ensure users always know when they're viewing demo data, I added clear indicators throughout the interface:

  • A prominent "Demo Mode" badge in the header
  • Informational notices on data visualizations
  • Quick-access toggle in the settings to switch between demo and live modes
  • Helpful prompts that guide users toward connecting their real store when they're ready

Challenges and Solutions

Implementing Demo Mode wasn't without its challenges:

1. Maintaining Consistency

One of the biggest challenges was ensuring that the demo data remained consistent across different views. For example, if a user views an order in the Orders list and then clicks on it for details, the expanded view needed to show the same information.

I solved this by creating a comprehensive demo data store with relationships between entities, similar to a real database structure.

2. Realistic Data Patterns

Simply generating random numbers wouldn't create a realistic experience. Instead, I analyzed actual commerce patterns and created algorithms that generated plausible sales trends, including:

  • Weekly peaks and valleys in sales
  • Seasonal variations
  • Product popularity correlations
  • Geographic distribution of customers

3. Refactoring Existing Components

Adding Demo Mode to an already functioning application required careful refactoring to avoid disrupting existing functionality. I methodically updated each component to:

  • Check for demo mode status before making API calls
  • Handle demo data in the same format as real data
  • Maintain all interactive functionality even when using demo data

The Impact of Demo Mode

Since implementing Demo Mode in version 0.3.0, we've seen significant improvements in user engagement. New users can now:

Immediately explore the full functionality of Sqrdo

Understand the value proposition without technical setup

Experiment with different views and features in a risk-free environment

Make an informed decision about connecting their actual store

From a development perspective, Demo Mode has also become invaluable for testing new features without needing to set up complex test environments with real API connections.

Future Enhancements

Looking ahead, I'm planning several enhancements to Demo Mode:

  • Customizable Demo Data: Allow users to adjust parameters to better match their store's characteristics
  • Guided Tours: Integrate interactive tours that showcase specific features using demo data
  • Demo API Playground: Allow developers to experiment with the API without affecting real data
  • Extended Historical Data: Add more historical context to better demonstrate trend analysis features

Conclusion

Demo Mode has become a cornerstone of the Sqrdo experience, significantly reducing the barrier to entry for new users while providing a rich, interactive preview of the platform's capabilities.

In our next blog post, I'll discuss the development of the analytics dashboard and how we've approached data visualization to provide meaningful insights for Squarespace store owners.

Built by meireles at jnpr.dsgn