Skip to content

Vue.js multi-agent chat application with Python backend

Notifications You must be signed in to change notification settings

sbayer2/VueMultiAgentCreator

Repository files navigation

Vue Multi-Agent Creator

A modern web application for managing OpenAI assistants with a Vue.js frontend and FastAPI backend.

πŸš€ Live Demo

✨ Features

  • πŸ” User Authentication - Secure JWT token authentication with bcrypt password hashing
  • πŸ€– Assistant Management - Create, edit, update, and delete OpenAI assistants with full CRUD operations
  • πŸ’¬ Real-time Chat - Live chat with responses using http sse connections
  • πŸ“ File Management - Upload and manage files with OpenAI code interpreter integration
  • πŸ”„ Live Updates - support for real-time chat and assistant interactions
  • πŸ“± Responsive Design - Mobile-first design with Tailwind CSS
  • ☁️ Cloud Ready - Fully deployed on Google Cloud Platform with Cloud Run and Cloud SQL
  • 🎯 Assistant-Specific Threads - Each assistant maintains its own conversation history
  • πŸ”§ Form Validation - Robust form validation with Vue composables

πŸ†• Latest Updates (2025-10-21)

βœ… Image Display Persistence - FULLY WORKING

  • Fixed image display after browser refresh - images now persist correctly
  • Resolved OpenAI file purpose issue - images use purpose='vision' (downloadable) instead of purpose='assistants'
  • Fixed timestamp display showing "Jan 21, 1970" - now shows correct dates with proper Unix timestamp conversion
  • Fixed image type recognition - properly detects image_file, image, and image/* types
  • Removed authentication requirement from image endpoint - allows browser <img> tags to load images
  • Fixed image URL routing - uses absolute backend URLs instead of relative paths that caused 404 errors

βœ… Forgot Password Feature

  • Added complete password recovery workflow with email delivery
  • Implemented Gmail SMTP integration with App Password authentication
  • Created secure JWT reset tokens with 1-hour expiry
  • Designed HTML email templates with reset links
  • Added ForgotPasswordView and ResetPasswordView components

βœ… Documentation

  • Created comprehensive docs/ directory with architecture, deployment, and authentication guides
  • Added detailed changelog tracking all project changes
  • Included token optimization strategies for cost management

πŸ—οΈ Architecture

  • Frontend: Vue 3 + TypeScript + Vite + Tailwind CSS + Pinia
  • Backend: FastAPI + SQLAlchemy + MySQL 8.0
  • Real-time: WebSocket with native implementation
  • Deployment: Docker + Google Cloud Run + Cloud SQL
  • Authentication: JWT tokens with bcrypt hashing
  • Storage: Google Cloud SQL with Secret Manager

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • Python 3.11+
  • MySQL 8.0+
  • OpenAI API key

Development Setup

  1. Clone the repository
git clone https://github.com/sbayer2/VueMultiAgentCreator.git
cd VueMultiAgentCreator
  1. Set up environment variables
# Backend
cd backend
cp .env.example .env
# Edit .env with your configurations

# Frontend
cd ../frontend
cp .env.example .env.local
# Edit .env.local with your API URL
  1. Install dependencies
# Backend
cd backend
pip install -r requirements.txt

# Frontend
cd ../frontend
npm install
  1. Start development servers
# Backend (from backend directory)
python main.py

# Frontend (from frontend directory)
npm run dev

🐳 Docker Setup

# Start all services (frontend, backend, MySQL, Redis)
docker-compose up

# Build for production
docker-compose up --build

🌐 Production Deployment

Google Cloud Run

The application is currently deployed on Google Cloud Platform:

  1. Set up Google Cloud project
gcloud config set project mythic-aloe-467602-t4
  1. Deploy using Cloud Build
gcloud builds submit --config cloudbuild.yaml
  1. Monitor logs
gcloud logging read "resource.type=cloud_run_revision" --limit=20 --project=mythic-aloe-467602-t4

πŸ“– API Documentation

Visit the interactive API documentation:

πŸ—‚οΈ Project Structure

VueMultiAgentCreator/
β”œβ”€β”€ frontend/                    # Vue.js 3 frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/         # Reusable Vue components
β”‚   β”‚   β”‚   β”œβ”€β”€ auth/          # Authentication components
β”‚   β”‚   β”‚   β”œβ”€β”€ chat/          # Chat interface components
β”‚   β”‚   β”‚   β”œβ”€β”€ assistant/     # Assistant management
β”‚   β”‚   β”‚   └── common/        # Base UI components
β”‚   β”‚   β”œβ”€β”€ views/             # Page components
β”‚   β”‚   β”œβ”€β”€ stores/            # Pinia state management
β”‚   β”‚   β”œβ”€β”€ composables/       # Vue composables (useForm, useWebSocket)
β”‚   β”‚   β”œβ”€β”€ layouts/           # Layout components
β”‚   β”‚   └── utils/             # Utilities and API client
β”‚   β”œβ”€β”€ public/                # Static assets
β”‚   └── nginx.conf             # Production nginx config
β”œβ”€β”€ backend/                    # FastAPI backend
β”‚   β”œβ”€β”€ api/                   # API endpoints
β”‚   β”‚   β”œβ”€β”€ auth.py           # Authentication routes
β”‚   β”‚   β”œβ”€β”€ assistants.py     # Assistant CRUD operations
β”‚   β”‚   β”œβ”€β”€ chat.py           # Chat and messaging
β”‚   β”‚   └── files.py          # File upload/management
β”‚   β”œβ”€β”€ models/               # SQLAlchemy database models
β”‚   β”œβ”€β”€ utils/                # Configuration and utilities
β”‚   └── main.py               # FastAPI application entry point
β”œβ”€β”€ cloudbuild.yaml            # Cloud Build configuration
└── docker-compose.yaml       # Local development setup

πŸ”§ Key Components

Frontend Features

  • Vue 3 Composition API with TypeScript
  • Pinia for state management with persistence
  • Tailwind CSS for responsive styling
  • Form validation with custom composables
  • Real-time chat with WebSocket integration
  • File upload with drag-and-drop support

Backend Features

  • FastAPI with automatic OpenAPI documentation
  • SQLAlchemy ORM with MySQL database
  • JWT authentication with bcrypt password hashing
  • WebSocket support for real-time communication
  • OpenAI Assistants API integration
  • File management with OpenAI code interpreter

Database Models

  • User: Authentication and user management
  • UserAssistant: Assistant configurations and metadata
  • FileMetadata: File upload tracking and management

πŸ§ͺ Testing

Development Testing

# Frontend linting and type checking
cd frontend
npm run lint
npm run type-check

# Backend testing
cd backend
python -m pytest

Production Testing

  • Health Check: GET /health
  • Database Test: GET /test-db
  • Authentication Test: Register/login flow

🀝 Contributing

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

πŸ“‹ Development Commands

Frontend Commands

npm run dev          # Start development server
npm run build        # Production build
npm run preview      # Preview production build
npm run lint         # Lint and auto-fix
npm run type-check   # TypeScript type checking

Backend Commands

python main.py       # Start development server
uvicorn main:app --reload  # Alternative start method

Cloud Deployment

gcloud builds submit --config cloudbuild.yaml  # Full deployment
gcloud logging read "resource.type=cloud_run_revision" --limit=20  # Check logs

πŸ“„ License

MIT License - see the LICENSE file for details.

πŸ› Known Issues & Fixes

βœ… Resolved Issues

  • Image Display After Refresh: Fixed OpenAI file purpose and URL routing - images now persist after browser refresh (2025-10-21)
  • Timestamp Display: Fixed "Jan 21, 1970" bug with proper Unix timestamp conversion (2025-10-21)
  • Image Type Recognition: Fixed filter to detect all image types (image_file, image, image/*) (2025-10-21)
  • Image Authentication: Removed auth requirement from image endpoint for browser compatibility (2025-10-21)
  • Update Assistant Button: Fixed form validation and data population (2025-09-18)
  • File Management: Implemented proper MMACTEMP pattern for image/document separation
  • Authentication Flow: JWT token management with proper validation
  • Chat Initialization: Assistant-specific thread management working correctly

πŸ†˜ Support

For issues and feature requests, please visit the GitHub Issues page.

About

Vue.js multi-agent chat application with Python backend

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •