npm package: @kosmas10/portal
Description: A launcher portal for AI Chat Extensions applications. Provides a unified entry point to access Chat & Verify, Folder LLM Analyzer, and other AI-powered tools. Built with React and bundled for maximum reliability.
Author: Kosmas Karadimitriou
Latest version: 0.0.13

# Portal

**Version:** 0.0.8  
**Package:** `@kosmas10/portal`

A launcher portal for AI Chat Extensions applications. Provides a unified entry point to access Chat & Verify, Folder LLM Analyzer, and other AI-powered tools. Built with React and bundled for maximum reliability.

## 🎯 Key Features

- **🚀 Unified Launcher**: Single entry point for all AI Chat Extensions apps
- **📱 Responsive Design**: Works on desktop and mobile devices
- **⚡ Fast Loading**: 2-stage architecture for reliable, efficient loading
- **🔄 Auto-Updates**: Always loads the latest version of apps
- **💻 No Installation Required**: Single HTML file that runs in any modern browser
- **⚛️ Built with React**: Modern component-based architecture

## 🏗️ Architecture: 2-Stage Loading System

This application uses a **simplified 2-stage loading architecture** with bundled React:

### Stage 1: Bootstrap (User Installs This)
- **File**: `portal-bootstrap.html`
- **Purpose**: Ultra-minimal loader (~25 lines)
- **Size**: ~1KB
- **What it does**: Fetches version from package.json and loads the bundled app

### Stage 2: Bundled React Application (Auto-Updates)
- **File**: `dist/portal.html`
- **Package**: `@kosmas10/portal` (this package)
- **What it does**: Self-contained React app with all dependencies bundled

### Why This Architecture?

1. **🛡️ Future-Proof**: Stage 1 is simple and never needs to change
2. **🔄 Auto-Updates**: Stage 2 updates automatically via npm/CDN
3. **📦 Zero External Dependencies**: All code bundled in single HTML file
4. **🐛 Reliable**: No CDN dependency issues or script loading failures

## 🚀 Quick Start

### Option A: Using the Bootstrap (Recommended)

1. **Download the bootstrap file** (one time only):
   ```bash
   curl -O https://cdn.jsdelivr.net/npm/@kosmas10/portal@latest/portal-bootstrap.html
   ```

2. **Open it in your browser**:
   - Double-click the file, or
   - Open it from your browser's File menu

3. **That's it!** The application will load automatically and stay up-to-date.

### Option B: Direct CDN Link

Simply navigate to:
```
https://cdn.jsdelivr.net/npm/@kosmas10/portal@latest/portal-bootstrap.html
```

## 📖 Available Applications

The Portal provides access to:

### Chat & Verify
A chatbot with citations and highlights in source documents for easy verification of answers. Supports PDF and Word documents.

### Folder LLM Analyzer
Analyze entire folders of files using Large Language Models. Upload a folder, ask questions, and get AI-powered insights.

## 📦 Package Structure

```
@kosmas10/portal/
├── dist/
│   └── portal.html           # Bundled React application
├── portal-bootstrap.html     # Bootstrap loader (Stage 1)
├── README.md                 # This file
└── LICENSE                   # MIT License
```

## 🛠️ Development

### Prerequisites
- Node.js 18+
- npm

### Setup
```bash
cd portal
npm install
```

### Development Server
```bash
npm run dev
```

### Build
```bash
npm run build
```

This produces `dist/portal.html` - a single self-contained HTML file.

## 🌐 Browser Compatibility

- ✅ Chrome/Chromium 90+
- ✅ Firefox 88+
- ✅ Safari 14+
- ✅ Edge 90+

## 🔒 Privacy & Security

- **No Tracking**: No analytics or tracking code
- **Open Source**: Full source code available for inspection
- **Local Storage**: Any settings stored locally in browser

## 🐛 Troubleshooting

### Application Won't Load

1. Check your internet connection
2. Ensure cdn.jsdelivr.net is accessible (not blocked by firewall)
3. Try clearing browser cache
4. Check browser console for errors (F12)

## 📝 Version History

### 0.0.8 (Current)
- **Claude Artifact Support**: When running in Claude environment, apps open directly to Claude artifact URLs
- **Local File Support**: When running from file system, apps open local dist files directly
- **Improved App Launching**: Better handling of local vs CDN vs Claude environments

### 0.0.7
- **Claude Artifact Support**: When running in Claude environment, apps open directly to Claude artifact URLs
- **Local File Support**: When running from file system, apps open local dist files directly
- **Improved App Launching**: Better handling of local vs CDN vs Claude environments

### 0.0.6
- Bug fixes and improvements

### 0.0.5
- **Migrated to bundled React architecture**: Complete rewrite using React + TypeScript + Tailwind
- **Simplified 2-stage loading**: Bootstrap loads bundled app directly
- **Zero external dependencies**: All code bundled in single HTML file
- **Improved reliability**: No CDN script loading issues

### 0.0.4
- Removed all non-error console output to prevent console popups during normal operation
- Cleaner console output - only shows errors when something goes wrong
- Bootstrap file updated with cleaner code structure and version resolution

### 0.0.3
- Improved @latest handling: Resolves `@latest` to specific version numbers
- Version caching to avoid multiple fetches

### 0.0.2
- Bug fixes and improvements

### 0.0.1
- Initial release
- Launcher interface for AI Chat Extensions apps

## 🤝 Contributing

Contributions are welcome! Please visit:
https://github.com/kosmas10/ai-chat-extensions

## 📄 License

MIT License - See LICENSE file for details

## 🆘 Support

For issues, questions, or feature requests:
- **GitHub Issues**: https://github.com/kosmas10/ai-chat-extensions/issues
- **Package**: https://www.npmjs.com/package/@kosmas10/portal

## 🔗 Related Packages

- **Chat & Verify**: [@kosmas10/chat-and-verify](https://www.npmjs.com/package/@kosmas10/chat-and-verify)
- **Folder LLM Analyzer**: [@kosmas10/folder-llm-analyzer](https://www.npmjs.com/package/@kosmas10/folder-llm-analyzer)

---

**Made with ❤️ as a unified gateway to AI-powered tools**