Skip to content

PACE.js - AI-native storefront framework (15KB). Build Product, About, Chat, and Executive Summary interfaces in minutes. Zero dependencies, framework-agnostic.

License

Notifications You must be signed in to change notification settings

semanticintent/pace.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

PACE.js

AI-native storefront framework for the modern web

15KB โ€ข Zero Dependencies โ€ข Framework Agnostic

DOI License: MIT GitHub Stars

Quick Start โ€ข Examples โ€ข Documentation โ€ข Demo


What is PACE?

PACE stands for Product, About, Chat, Executive Summary โ€” a UX pattern designed specifically for AI-powered storefronts and product catalogs.

Traditional e-commerce patterns don't work well for AI tools, MCP servers, and modern SaaS products. PACE solves this by combining four essential components:


๐Ÿ“ฆ Product
Intelligent catalog with filtering and discovery

โ„น๏ธ About
Context and trust-building before commitment

๐Ÿ’ฌ Chat
AI-powered guided discovery

๐ŸŽฏ Executive Summary
Real-time insights and recommendations

Why PACE?

Traditional E-commerce PACE Pattern
Product-first Conversation-first
Transactional Relational
Static categories AI-guided discovery
One-size-fits-all Contextual recommendations
Admin-only analytics Visible insights

โœจ Features

  • โšก Lightweight โ€” 15KB minified + gzipped (6x smaller than React)
  • ๐Ÿš€ Zero Dependencies โ€” Pure vanilla JavaScript
  • ๐ŸŽจ Framework Agnostic โ€” Works standalone or with React, Vue, Svelte
  • ๐Ÿค– AI-Powered Chat โ€” Built-in Claude, OpenAI, and custom adapters
  • ๐Ÿ“Š Executive Summary โ€” Real-time conversation insights
  • ๐ŸŽฏ Pattern-Based โ€” Encodes PACE Pattern into reusable framework
  • ๐Ÿ”Œ Extensible โ€” Plugin system, themes, and adapters
  • ๐Ÿ“ฑ Responsive โ€” Mobile-first design
  • โ™ฟ Accessible โ€” WCAG 2.1 compliant
  • ๐ŸŽ“ Academic โ€” Published on Zenodo with DOI

๐Ÿš€ Quick Start

Installation

Via NPM:

npm install @semanticintent/pace-pattern

Via CDN:

<script type="module" src="https://unpkg.com/@semanticintent/pace-pattern@latest/dist/pace.esm.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@semanticintent/pace-pattern@latest/dist/pace.min.css">

Minimal Example

Create an index.html:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>My AI Storefront</title>

  <!-- Phosphor Icons -->
  <script src="https://unpkg.com/@phosphor-icons/web"></script>

  <!-- PACE.js CSS -->
  <link rel="stylesheet" href="https://unpkg.com/@semanticintent/pace-pattern/dist/pace.min.css">
</head>
<body>
  <div id="app"></div>

  <script type="module">
    import { PACE } from 'https://unpkg.com/@semanticintent/pace-pattern/dist/pace.esm.js';

    const pace = new PACE({
      container: '#app',
      products: './products.json'
    });

    pace.mount();
  </script>
</body>
</html>

Create a products.json:

{
  "products": [
    {
      "id": "my-product",
      "name": "My First Product",
      "tagline": "A great AI tool",
      "category": "tools",
      "price_display": "free",
      "description": "## My Product\n\nThis is amazing!",
      "action": "github",
      "action_url": "https://github.com/you/product"
    }
  ]
}

That's it! Open index.html in your browser. ๐ŸŽ‰


โš™๏ธ Configuration

PACE.js is highly configurable while maintaining sensible defaults:

const pace = new PACE({
  // Required
  container: '#app',
  products: './products.json', // or inline array

  // About Page
  about: {
    title: 'About Us',
    subtitle: 'Building the future of AI tools',
    sections: [
      { title: 'Our Mission', content: '<p>...</p>' },
      { title: 'Team', content: '<p>...</p>' }
    ]
  },

  // Chat Widget
  chat: {
    enabled: true,
    provider: 'claude',
    apiKey: process.env.ANTHROPIC_API_KEY,
    model: 'claude-3-5-sonnet-20241022',
    placeholder: 'Ask about our products...',
    suggestions: [
      'What products do you offer?',
      'How do I get started?'
    ]
  },

  // Executive Summary
  executiveSummary: {
    enabled: true,
    updateInterval: 30000, // 30 seconds
    insights: ['trends', 'recommendations', 'key_moments']
  },

  // Theme
  theme: {
    primaryColor: '#667eea',
    accentColor: '#764ba2',
    font: 'Inter, system-ui, sans-serif'
  }
});

pace.mount();

๐Ÿ“ฆ Product Format

Products are defined in simple JSON:

{
  "products": [
    {
      "id": "unique-id",
      "name": "Product Name",
      "tagline": "One-line description",
      "category": "mcp_servers",
      "price_display": "free",
      "icon": "๐Ÿš€",
      "description": "## Markdown Description\n\nSupports **markdown** formatting!",
      "action": "github",
      "action_url": "https://github.com/..."
    }
  ]
}

Supported actions:

  • github โ€” Link to GitHub repository
  • demo โ€” Link to live demo
  • download โ€” Download link
  • buy โ€” Purchase link

๐ŸŽจ Examples

Standalone Site

# Clone and run
git clone https://github.com/semanticintent/pace.js
cd pace.js/examples/minimal
python -m http.server 8000
# Visit http://localhost:8000

React Integration

import { useEffect, useRef } from 'react';
import { PACE } from '@semanticintent/pace-pattern';

function Store() {
  const ref = useRef(null);

  useEffect(() => {
    const pace = new PACE({
      container: ref.current,
      products: './products.json'
    });
    pace.mount();

    return () => pace.destroy();
  }, []);

  return <div ref={ref} />;
}

Vue Integration

<template>
  <div ref="container"></div>
</template>

<script>
import { PACE } from '@semanticintent/pace-pattern';

export default {
  mounted() {
    this.pace = new PACE({
      container: this.$refs.container,
      products: './products.json'
    });
    this.pace.mount();
  },
  beforeUnmount() {
    this.pace.destroy();
  }
}
</script>

๐Ÿ”Œ Extensibility

Plugins

class AnalyticsPlugin {
  init(pace) {
    pace.on('product-selected', ({ detail }) => {
      gtag('event', 'view_item', { item_id: detail.product.id });
    });
  }
}

pace.use(new AnalyticsPlugin());

Custom AI Adapters

class CustomAdapter {
  async sendMessage(message, context) {
    const response = await fetch('/api/chat', {
      method: 'POST',
      body: JSON.stringify({ message })
    });
    return response.json();
  }
}

pace.components.chat.adapter = new CustomAdapter();

Themes

// Override CSS variables
pace.setTheme({
  primaryColor: '#ff6b6b',
  accentColor: '#4ecdc4',
  font: 'Poppins, sans-serif'
});

๐Ÿ“š Documentation


๐ŸŒŸ Reference Implementation

MillPond Storefront is the official reference implementation of PACE 1.0.1:


๐Ÿ“Š Comparison

Feature PACE.js React Vue Alpine.js
Size 15KB 42KB 34KB 15KB
Dependencies 0 2+ 1+ 0
Build Required โŒ โœ… โœ… โŒ
Learning Curve 5 min Hours Hours 15 min
AI-Native โœ… โŒ โŒ โŒ
Pattern-Based โœ… โŒ โŒ โŒ

๐ŸŽ“ Citation

PACE.js implements the PACE Pattern published on Zenodo. If you use this in your research or project, please cite:

@software{pace_pattern_2024,
  author = {Semantic Intent},
  title = {PACE Pattern: Product, About, Chat, Executive Summary},
  year = {2024},
  publisher = {Zenodo},
  version = {1.0.1},
  doi = {10.5281/zenodo.18049371},
  url = {https://doi.org/10.5281/zenodo.18049371}
}

๐Ÿ—บ๏ธ Roadmap

โœ… v1.0 (Current)

  • Core framework
  • Four main components
  • Basic theming
  • Plugin system
  • Working examples

๐Ÿ”œ v1.1 (Next)

  • NPM package published
  • Build system (Rollup)
  • TypeScript definitions
  • Claude API adapter
  • OpenAI API adapter

๐Ÿ”ฎ v2.0 (Future)

  • Advanced analytics
  • A/B testing
  • Multi-language support
  • Mobile app wrappers
  • Headless CMS integration

See PROJECT_STATUS.md for detailed roadmap.


๐Ÿค Contributing

Contributions are welcome! Here's how you can help:

  1. ๐Ÿ› Report bugs โ€” Open an issue
  2. ๐Ÿ’ก Suggest features โ€” Start a discussion
  3. ๐Ÿ“ Improve docs โ€” Submit a PR
  4. ๐ŸŽจ Create themes โ€” Share with community
  5. ๐Ÿ”Œ Build plugins โ€” Extend functionality

See CONTRIBUTING.md for guidelines.


๐Ÿ“„ License

MIT ยฉ Semantic Intent

See LICENSE for details.


๐Ÿ™ Acknowledgments

  • Built with inspiration from Alpine.js, Preact, and the PACE Pattern
  • Powered by Phosphor Icons
  • Published on Zenodo

๐Ÿ“ž Support


Built with โค๏ธ using the PACE Pattern

โญ Star this repo if you find it useful!

About

PACE.js - AI-native storefront framework (15KB). Build Product, About, Chat, and Executive Summary interfaces in minutes. Zero dependencies, framework-agnostic.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published