How symaiotics/mpersona-vue-v1 works
Project type and purpose
• From the README and file tree, mPersona is a full-stack persona-management tool. This package is the Vue.js single-page frontend (deployed as an Azure Static Web App) that communicates with a Node.js API/WebSocket backend and Azure Blob Storage, and in turn orchestrates calls to external LLM services (OpenAI, Anthropic).
File structure
• Top-level:
• staticwebapp.config.json, GitHub Actions workflow → deployment on Azure Static Web Apps
• public/ → static assets and redirect rules
• index.html → SPA entry point
• vite.config.js, postcss.config.js, tailwind.config.js → build & styling pipeline
• src/:
• main.js, App.vue → application bootstrap
• router.js → route definitions (Home, Chat, KnowledgeProfiles, etc.)
• pages/ → page-level Vue components (views)
• components/ → UI widgets, panels, file-draggers, persona editors, chat windows, etc.
• composables/ → Vue Composition API hooks that encapsulate all API, WebSocket, and Storage interactions (useAxios, useWebsockets, useFiles, useKnowledgeProfiles, etc.)
• utils/ → shared utilities (axios instance, JSON/code extractor, chart helpers)
• css/ → Tailwind + custom styles
README for additional insights
• Key environment variables:
• SELF: front-end host URL
• API_URL: REST endpoint for Node.js server
• WEBSOCKET_URL: WebSocket endpoint
• STORAGE_URL: Azure Blob Storage base URL
• Build scripts: npm run dev/build, automated via GitHub Actions
1. End User & Browser (runs the Vue SPA)
2. Vue SPA layers:
– Router & Views (src/pages)
– UI Components (src/components)
– State & API layers (src/composables + src/utils/axios)
3. Static Web App Hosting (Azure Static Web Apps / CDN)
4. Node.js Backend:
– REST API (HTTP)
– WebSocket Server
5. Azure Blob Storage
6. External LLM Services (OpenAI, Anthropic)
7. CI/CD Pipeline (GitHub Actions)
b. Relationships & interactions:
– Browser →[HTTP(S)]→ Azure CDN → serves index.html & JS bundles → Browser
– Vue SPA →[HTTP REST]→ Node.js REST API →[DB/Logic]→ External LLM
– Vue SPA →[WebSocket]→ Node.js WS Server → pushes chat updates back → Browser
– Node.js API →[HTTPS]→ Azure Blob Storage for file uploads/downloads
– CI/CD →[push to Main branch]→ GitHub Actions → build & deploy to Azure Static Web Apps
c. Architectural patterns & design principles:
– Single-Page Application (SPA) with clear separation: presentation (components), state/data (composables), routing (router.js)
– Composition API for modular, reusable data‐fetching hooks
– Two-channel communication: REST for CRUD, WebSocket for live chat events
– Static hosting of UI, dynamic interactions via API & WS
d. Key technologies to annotate:
– Vue.js 3, Vite, Tailwind CSS
– Axios (custom instance in src/utils/axios)
– Composition API (src/composables)
– GitHub Actions & Azure Static Web Apps
– Node.js (external), Azure Blob Storage, OpenAI/Anthropic LLM services