How chris-paganon/vue-ai-tools works
Project type and purpose
• This is a full-stack Nuxt 3 web application (“VueAI.tools”) that provides a Vue-focused AI assistant.
• Key features:
• Frontend SPA/SSR via Nuxt 3 (Vue components, layouts, pages).
• Backend API routes (server/api) for authentication, chat management, subscriptions, and AI completions.
• Local or remote AI model hosting via Ollama plus a vector index (Qdrant) built by a separate Python service.
• Persistence in SQLite (via Drizzle ORM) for users, chats, subscriptions.
File structure
• Top-level directories:
• assets, components, layouts, pages, plugins, composables (client-side).
• server (server/api, server/utils, server/plugins, middleware) for Nuxt API endpoints.
• db (migrations, schema) + drizzle.config.ts for database.
• index-builder (Python service + Dockerfile) for building the Qdrant index from Vue docs.
• nuxter-config + docker-compose.yml orchestrate multi-container deployment (Nuxt app, Qdrant, Python index builder, healthcheck).
• Config files: nuxt.config.ts, tsconfig.json, eslint.config.mjs, package.json.
README for additional insights
• Describes local vs. production setup, Docker Compose services, AI model configurations via Ollama, embedding models, and how to rebuild the vector index.
• Emphasizes the separation of concerns: frontend, backend, index builder, vector DB, AI model service, email/api integrations.
Main components & their relationships
a. Frontend (Nuxt 3)
• Renders pages/routes (pages/, layouts/)
• Calls backend API (server/api/*) via HTTP
• Manages state in Pinia stores (composables/stores)
b. Backend (Nuxt server/API)
• Authentication & user management (server/api/auth)
• Chat CRUD & message endpoints (server/api/chats)
• AI completion endpoints (server/api/completion, docCompletion)
• Subscription & payment via Lemon API (server/api/lemon)
• Database access through Drizzle ORM, migrations in db/
• Middleware for auth checks (server/middleware/authMware.ts)
c. Vector index builder (Python service)
• Extracts Vue docs (assets/vue-docs)
• Generates embeddings & pushes to Qdrant
• Runs in a separate container (index-builder service)
d. Qdrant Vector Database
• Hosts the ‘vue-docs’ index for semantic document search
• Exposes HTTP API on port 6333
e. AI Model Service (Ollama)
• Hosts LLM & embedding models locally or remotely
• Invoked by backend utilities (useCohereEmbed, useCohereLLM, useDeepseekLLM)
f. External Services
• Email (SendGrid or other SMTP) for signup confirmation
• Lemon API for payment subscriptions
Architectural patterns & design principles
• Separation of concerns: clear frontend vs. backend vs. index builder
• API-driven communication: frontend ↔ backend via RESTful endpoints
• Micro-services–style split: index‐builder service separate from main app
• Modular code organization: components, composables (client), plugins, utils (server)
• Infrastructure as code: Docker Compose orchestrates the multi-container setup