Skip to content

πŸ”§ Modular Interactive Story Template | n8n Chatbot Integration | Web Components Architecture | Cross-browser Compatible | Perfect for creating engaging story experiences with AI narrator support

License

Notifications You must be signed in to change notification settings

octavadi/interactive-story-project

Repository files navigation

πŸ“– Interactive Story Project

GitHub HTML5 CSS3 JavaScript

Template sistem untuk membuat interactive story dengan integrasi chatbot n8n. Proyek ini menggunakan arsitektur modular dengan chatbot template yang dapat digunakan ulang di berbagai proyek story.

✨ Demo

Interactive Story Demo

πŸš€ Features

πŸ“– Story Features

  • βœ… Interactive story content dengan pilihan cerita
  • βœ… Editable text (double-click to edit)
  • βœ… Image upload untuk scenes
  • βœ… Responsive design untuk semua device
  • βœ… Navigation system yang intuitif
  • βœ… Chat history dan save progress

πŸ€– Chatbot Features

  • βœ… n8n workflow integration
  • βœ… Real-time chat dengan typing indicators
  • βœ… Configurable bot personality
  • βœ… Multiple persona templates
  • βœ… Message history dan context awareness
  • βœ… Error handling & retry mechanism
  • βœ… Webhook security protection

πŸ”§ Technical Features

  • βœ… Cross-browser compatibility (Chrome, Safari, Edge, Firefox)
  • βœ… Mobile-first responsive design
  • βœ… Web Components architecture
  • βœ… Modular template system
  • βœ… Comprehensive debugging tools
  • βœ… Performance optimized
  • βœ… PWA ready

πŸ—οΈ Project Structure

interactiveStory_proj/
β”œβ”€β”€ πŸ“„ index.html                    # Main story page
β”œβ”€β”€ πŸ“„ discussion.html               # Discussion page
β”œβ”€β”€ 🎨 styles/                       # Styling files
β”‚   β”œβ”€β”€ main.css                     # Core styles
β”‚   β”œβ”€β”€ index.css                    # Homepage styles
β”‚   β”œβ”€β”€ discussion.css               # Discussion page styles
β”‚   └── browser-compatibility.css    # Cross-browser support
β”œβ”€β”€ ⚑ js/                           # JavaScript files
β”‚   β”œβ”€β”€ main.js                      # Main story logic
β”‚   β”œβ”€β”€ browser-polyfills.js         # Browser compatibility
β”‚   β”œβ”€β”€ error-handler.js             # Error management
β”‚   β”œβ”€β”€ performance-utils.js         # Performance utilities
β”‚   └── chat-history-manager.js      # Chat history functionality
β”œβ”€β”€ πŸ€– chatbot-template/             # Reusable chatbot system
β”‚   β”œβ”€β”€ components/                  # Chat UI components
β”‚   β”œβ”€β”€ js/                          # Core chatbot logic
β”‚   β”œβ”€β”€ styles/                      # Chatbot styling
β”‚   β”œβ”€β”€ tools/                       # Debugging tools
β”‚   β”œβ”€β”€ examples/                    # Configuration examples
β”‚   └── docs/                        # Template documentation
β”œβ”€β”€ πŸ§ͺ testing/                      # Test files
β”‚   β”œβ”€β”€ test-chat-history.html
β”‚   β”œβ”€β”€ test-discussion.html
β”‚   β”œβ”€β”€ browser-test.html
β”‚   └── test-markdown-cleanup.html
β”œβ”€β”€ 🧩 components/                   # Shared components
β”‚   └── shared-footer.js
β”œβ”€β”€ πŸ–ΌοΈ assets/                       # Static assets
β”‚   β”œβ”€β”€ images/                      # Story images
β”‚   └── icons/                       # UI icons
└── πŸ› οΈ scripts/                      # Utility scripts
    β”œβ”€β”€ cleanup-old-files.sh
    └── setup-new-project.sh

πŸš€ Quick Start

πŸ“‹ Prerequisites

  • Web browser yang modern (Chrome 60+, Safari 12+, Edge 79+, Firefox 65+)
  • Local web server (optional, untuk development)
  • n8n instance untuk chatbot integration

🎯 Running Locally

  1. Clone repository
git clone https://github.com/yourusername/interactive-story-project.git
cd interactive-story-project
  1. Open in browser
# Langsung buka file
open index.html

# Atau gunakan local server (recommended)
python -m http.server 8000
# Then visit http://localhost:8000
  1. Configure chatbot (optional)
# Buka bot configuration
open chatbot-template/botSetting.html

βš™οΈ Configuration

πŸ€– Bot Setup

  1. Setup n8n workflow: Import chatbot-template/examples/n8n-chatbot-workflow.json
  2. Configure bot settings: Buka chatbot-template/botSetting.html
  3. Set webhook URL: Update endpoint di konfigurasi bot
  4. Choose persona: Pilih dari predefined templates
  5. Test connection: Gunakan diagnostic tools

🎨 Customization

// Configure story-specific bot
const storyConfig = {
    botName: "Story Narrator",
    botDescription: "Your guide through this adventure",
    botAvatar: "πŸ“š",
    webhookUrl: "YOUR_WEBHOOK_URL_HERE", // Jangan commit URL asli!
    theme: {
        primaryColor: "#3b82f6",
        secondaryColor: "#60a5fa"
    }
};

window.ConfigManager.saveConfig(storyConfig);

πŸ› οΈ Development

πŸ†• Creating New Story Project

# Gunakan setup script
./scripts/setup-new-project.sh my-new-story

# Atau manual copy template
cp -r chatbot-template/ /path/to/new-project/

πŸ§ͺ Testing

# Browser compatibility test
open testing/browser-test.html

# Chat history test
open testing/test-chat-history.html

# Webhook connection test
open chatbot-template/tools/test-webhook-connection.html

# n8n diagnostic
open chatbot-template/tools/n8n-diagnostic.html

πŸ“± Browser Support

Browser Version Status
Chrome 60+ 🟒 Full Support
Safari 12+ 🟒 Full Support
Edge 79+ 🟒 Full Support
Firefox 65+ 🟒 Full Support

πŸ”’ Security

⚠️ Important: Jangan commit webhook URLs atau API keys ke repository!

  • Gunakan environment variables untuk sensitive data
  • Webhook URLs dan secrets sudah di-exclude dalam .gitignore
  • Test konfigurasi menggunakan file local yang tidak di-track git

πŸ“š Documentation

🀝 Contributing

  1. Fork repository ini
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add some amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open Pull Request

πŸ› Troubleshooting

Common Issues

  • Webhook 404: Pastikan n8n workflow sudah aktif
  • Config Not Saving: Cek localStorage availability di browser
  • Components Not Loading: Periksa script loading order
  • CORS Errors: Configure n8n CORS settings

Debug Tools

  • Gunakan testing/browser-test.html untuk compatibility testing
  • Check chatbot-template/tools/ untuk debugging utilities
  • Buka browser console untuk error messages
  • Test webhook connectivity dengan diagnostic tools

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Built with modern web standards
  • Powered by n8n for chatbot integration
  • Icons and images generated with AI assistance
  • Cross-browser compatibility tested extensively

πŸŽ‰ Next Steps

  1. πŸ“– Explore Documentation: Familiarize dengan template system
  2. πŸ§ͺ Test Integration: Gunakan diagnostic tools
  3. 🎨 Customize: Apply story theme dan branding
  4. πŸš€ Create New Stories: Use setup script untuk new projects
  5. 🀝 Contribute: Share improvements back ke community

πŸš€ Happy storytelling! Mari buat interactive stories yang amazing! πŸš€

About

πŸ”§ Modular Interactive Story Template | n8n Chatbot Integration | Web Components Architecture | Cross-browser Compatible | Perfect for creating engaging story experiences with AI narrator support

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published