@spectrumsense/spectrum-chat-dev
Version:
Embeddable AI Widget - Add trusted, evidence-based answers directly to your website. Simple installation, enterprise-grade security.
78 lines (56 loc) โข 2.16 kB
Markdown
# Spectrum Chat Examples
This directory contains example implementations of the Spectrum Chat widget, organized by server type.
## ๐ Directory Structure
```
examples/
โโโ mock/ # Mock server examples (port 8001)
โโโ real/ # Real API server examples (port 8000)
โโโ README.md # This file
```
## ๐ Quick Start
### Option 1: Mock Server (Recommended for Development)
1. **Start mock server:**
```bash
node mock-api-server-8001.js
```
2. **Start web server:**
```bash
python -m http.server 3000
```
3. **Open examples:**
- http://localhost:3000/examples/mock/plain-html-example.html
### Option 2: Real API Server (Production Testing)
1. **Start your API server on port 8000**
2. **Start web server:**
```bash
python -m http.server 3000
```
3. **Open examples:**
- http://localhost:3000/examples/real/plain-html-example.html
## ๐ Available Examples
### Custom Element Examples
- **`plain-html-example.html`** - Basic custom element implementation
- **`template-base.html`** - Base template with global configuration
- **`template-home.html`** - Home page extending base template
- **`template-page1.html`** - Additional template pages
- **`template-page2.html`** - Additional template pages
- **`template-page3.html`** - Additional template pages
## ๐ง Configuration
### Mock Server Examples
- **API URL**: `http://localhost:8001/api/v1/conversations`
- **Purpose**: Development and testing
- **Data**: Simulated responses
### Real Server Examples
- **API URL**: `http://localhost:8000/api/v1/conversations`
- **Purpose**: Production testing
- **Data**: Real API responses
## ๐งช Testing
Both example sets support:
- โ
**Custom element mode** - Individual page integration
- โ
**Template system mode** - Global configuration
- โ
**Session storage** - Conversation persistence
- โ
**Cross-page navigation** - State management
## ๐ Documentation
- [Mock Server Examples](mock/README.md) - Development setup
- [Real Server Examples](real/README.md) - Production setup
- [Testing Instructions](../TESTING_INSTRUCTIONS.md) - Comprehensive testing guide