Platform for real-time speech translation in video calls. Eliminates language barriers for international teams. Features AI-powered chat with semantic search capabilities using Upstash Vector database.
Mind.com is a VitePress website with multilingual support, integrated with Pipedrive CRM, and AI Chat powered by Upstash Vector database. The project includes:
- 📄 VitePress documentation with support for 12+ languages
- 🔗 API endpoints for CRM integration
- 🚀 OAuth authorization through external service
- 📝 Contact forms with lead submission to Pipedrive
- 📊 Google Analytics integration via GTM
- 🤖 AI Chat with semantic search using Upstash Vector database
- 🔍 Automatic language detection for multilingual responses
packages/mind-com/
├── docs/ # VitePress documentation
│ ├── .vitepress/
│ │ ├── config/ # VitePress configuration
│ │ │ ├── i18n/ # Localization configurations
│ │ │ ├── en.ts # English localization
│ │ │ └── shared.ts # Shared settings
│ │ └── theme/ # Custom theme
│ │ ├── components/ # Vue components
│ │ ├── composables/ # Vue composables
│ │ └── styles/ # CSS styles
│ ├── en/ # English content
│ └── i18n/ # Translations to other languages
├── api/ # Vercel API endpoints
│ ├── config/ # API configuration
│ │ ├── corsConfig.ts # CORS domain verification
│ │ └── pipedriveConfig.ts # Pipedrive CRM configuration
│ ├── demo/ # Demo endpoints
│ ├── lib/ # API utilities
│ │ └── aiChatLib.ts # Semantic search tool for AI Chat
│ ├── types/ # TypeScript type definitions
│ ├── chat.ts # AI Chat endpoint
│ ├── signUp.ts # User registration
│ ├── submitForm.ts # Form submission
│ └── SECURITY.md # API security documentation
├── scripts/ # Automation scripts
└── __tests__/ # Tests
The project uses configuration constants defined in docs/.vitepress/config/index.ts. These constants need to be properly configured for different environments:
// Site URL (production domain)
const SITE_URL = "https://mind.com"
// Pages to exclude from indexing and sitemap
const NOINDEX_PAGES = ["exp/", "chat"]
// Right-to-left languages
const RTL_LOCALES = ["ar", "fa", "ur"]// Main application domains
const APP_DOMAIN = "inter.mind.com" // Production domain
const APP_DOMAIN_DEV = "dev.inter.mind.com" // Development domain// OAuth client ID (public, safe to expose)
const oauthClientId = "vca"
// OAuth endpoints (auto-generated based on environment)
const oauthProviderUrl = appBaseUrl + "/auth"
const checkoutUrl = appBaseUrl + "/checkout"// Google Tag Manager ID
const GTM_ID_TO_USE = process.env.GTM_ID
// Production detection
const isProduction = process.env.VERCEL_ENV === "production"✅ Safe to expose:
- Domain names
- OAuth client IDs
- Public configuration flags
- GTM IDs
❌ Never expose:
- API tokens
- Private keys
- Database credentials
- Internal secrets
To adapt the project for your domain:
-
Update domain constants:
const APP_DOMAIN = "your-domain.com" const APP_DOMAIN_DEV = "dev.your-domain.com"
-
Update site URL:
const SITE_URL = "https://your-docs-site.com"
-
Configure OAuth client:
const oauthClientId = "your-oauth-client-id"
-
Set environment variables in Vercel:
GTM_ID: Your Google Tag Manager IDVERCEL_ENV: Set automatically by VercelPIPEDRIVE_API_TOKEN: Your Pipedrive API token
The project includes an AI-powered chat system with semantic search capabilities using Upstash Vector database and OpenAI embeddings.
- 🤖 AI-powered responses using Anthropic Claude models
- 🔍 Semantic search through InterMind documentation
- 🌐 Automatic language detection from user questions
- 📚 Context-aware answers using Upstash Vector database
- 🛡️ Domain-protected API endpoints
- ⚡ Ultra-fast indexing with batch processing
- 💬 Real-time chat widget deployed on production sites
- Document Indexing: Documentation is processed into chunks and stored in Upstash Vector
- Semantic Search: AI uses
semanticSearchToolto find relevant information - Context Generation: Retrieved information is used to generate accurate responses
- Language Detection: AI automatically responds in the user's question language
# AI Chat Configuration
UPSTASH_VECTOR_REST_URL=your_upstash_vector_url
UPSTASH_VECTOR_REST_TOKEN=your_upstash_vector_token
OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key-
Create Upstash Vector Index:
- Dimensions:
384(for text-embedding-3-small) - Metric:
cosine
- Dimensions:
-
Index Documents:
# Build project to generate documentation pnpm build # Index documents to Upstash Vector (ultra-fast batch processing) pnpm index:docs
-
API Endpoint:
POST /api/chat- Main chat endpoint with semantic search integration
- User asks questions in any language
- AI automatically detects language and responds accordingly
- For InterMind-specific questions, semantic search finds relevant documentation in Upstash Vector
- Responses include context from vector database for accuracy
- All requests are domain-protected for security
- Real-time streaming responses with interactive chat widget
For detailed setup instructions, see AIChat-VectorDB-Setup.md.
The project is designed to run on Vercel, utilizing its serverless functions for API endpoints and static site generation for the documentation. The Vercel configuration is located in packages/mind-com/vercel.json.
Environment variables are automatically loaded by vercel pull command into packages/mind-com/.vercel/.env.development.local:
# Pipedrive CRM
PIPEDRIVE_API_TOKEN=your_pipedrive_token
# AI Chat & Upstash Vector Database
UPSTASH_VECTOR_REST_URL=your_upstash_vector_url
UPSTASH_VECTOR_REST_TOKEN=your_upstash_vector_token
OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key
# Vercel environment
VERCEL_ENV=development|preview|production
# OAuth settings (configured automatically through code)
# Domains are determined from VERCEL_ENV:
# - production: inter.mind.com
# - development: dev.inter.mind.com- Node.js 20+
- pnpm
- Vercel CLI
-
Install dependencies:
pnpm install
-
Setup Vercel CLI:
npm i -g vercel vercel login
-
Link project to Vercel:
# Link to existing Vercel project vercel link --repo # Follow instructions to select team/scope and project
-
Download environment variables:
# Downloads variables from Vercel project # Creates packages/mind-com/.vercel/.env.development.local vercel pull
# Run frontend only (without API)
pnpm dev
# Available at http://localhost:5173# Run with API endpoints and full Vercel simulation
vercel dev
# Available at http://localhost:3000
# API endpoints work at /api/*Vercel dev provides:
- Full production environment simulation
- Working API endpoints
- Environment variables from
.vercel/.env.development.local - Automatic restart on changes
# Production build
vercel [--prod]
# Translate content to all languages
pnpm translate
# Check HTML tag balance in translated files
pnpm translate:check
# Check specific language
pnpm translate:check ruThe project is configured for automatic deployment via Vercel on push to main branch.
# Deploy to preview environment
vercel
# Deploy to production
vercel --prodThe project uses:
- Build Command:
pnpm build(automatically detected) - Output Directory:
docs/.vitepress/dist - Root Directory:
packages/mind-com - Node.js Version: 22.x (automatic)
{
"cleanUrls": true,
"headers": [
{
"source": "/assets/(.*)",
"headers": [{ "key": "Cache-Control", "value": "max-age=31536000, immutable" }]
}
]
}{
"functions": {
"../../api/**/*.ts": {
"runtime": "@vercel/node@3.0.0"
}
}
}All API endpoints are protected by domain verification. See SECURITY.md for detailed security configuration and allowed domains.
API endpoints for CRM integration. Configuration settings are defined in pipedriveConfig.ts.
Available endpoints:
POST /api/signUp- User registration with lead creationPOST /api/submitForm- Contact form submission with lead creationPOST /api/chat- AI Chat with semantic search capabilities
// Sign up example
const response = await fetch("/api/signUp", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
name: "John Doe",
email: "john@example.com",
params: {
plan: "Pro",
method: "Google",
},
utm: {
source: "website",
medium: "organic",
},
}),
})
// Contact form example
const response = await fetch("/api/submitForm", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
name: "John Doe",
email: "john@example.com",
kind: "Demo Request",
message: "Interested in your service",
webSite: "https://example.com",
}),
})
// AI Chat example
const response = await fetch("/api/chat", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
messages: [{ role: "user", content: "What are InterMind's pricing plans?" }],
mode: "basic", // or "followup"
}),
})Comprehensive test suite for API endpoints and utilities. See tests/README.md for detailed testing documentation including:
- Unit tests for API endpoints with full mocking
- UTM utility testing with browser API simulation
- Integration tests for end-to-end traffic flow validation
- Coverage reporting and CI/CD integration
AuthButton component handles OAuth flow:
- Development:
https://dev.inter.mind.com/auth - Production:
https://inter.mind.com/auth
Integration via Google Tag Manager:
- Production GTM ID:
GTM-YOUR_PRODUCTION_ID - Test GTM ID:
GTM-YOUR_TEST_ID
Supported languages:
- 🇺🇸 English (primary)
- 🇪🇸 Español
- 🇨🇳 中文
- 🇩🇪 Deutsch
- 🇫🇷 Français
- 🇧🇷 Português
- 🇯🇵 日本語
- 🇦🇪 العربية
- 🇮🇳 हिन्दी
- 🇹🇷 Türkçe
- 🇰🇷 한국어
- 🇷🇺 Русский
Localization configuration is located in docs/.vitepress/config/locales.ts.
The project includes an automatic translation script using AI models.
File scripts/translateConfig.js contains settings for automatic translation:
export const config = {
// Translation directories
rootDir: "../docs/en", // Source English content
rootTranslateDir: "../docs/i18n", // Page translations
configDir: "../docs/.vitepress/config", // VitePress configuration
configTranslateDir: "../docs/.vitepress/config/i18n", // Config translations
// Supported languages
languages: {
ar: { code: "ar", name: "Gulf Arab & MSA" },
zh: { code: "zh", name: "Mandarin" },
es: { code: "es", name: "Spanish (México)" },
hi: { code: "hi", name: "Hindi" },
ja: { code: "ja", name: "Japanese" },
pt: { code: "pt", name: "Portuguese (Brazil)" },
ru: { code: "ru", name: "Russian" },
de: { code: "de", name: "German" },
fr: { code: "fr", name: "French" },
tr: { code: "tr", name: "Turkish" },
ko: { code: "ko", name: "Korean" },
},
// AI models for translation
models: {
claude: { name: "claude-4-sonnet-20250514" },
gpt4: { name: "gpt-4.1-mini" },
grok: { name: "grok-2-latest" },
},
// Exclusions and filters
exclude: ["test"], // Exclude from translation
allowedExtensions: [".md", ".vue", ".svg"], // Allowed extensions
}# Run automatic translation
pnpm translate
# Script translates:
# - Markdown files from docs/en/ to docs/i18n/{language}/
# - VitePress configurations from config/ to config/i18n/
# - Vue components and SVG files when neededThe script can:
- Preserve structure: Markdown markup, frontmatter, links remain unchanged
- SEO optimization: Translates title and description with search optimization in mind
- Cultural adaptation: Adapts content for target audience specifics
- Technical accuracy: Doesn't translate technical terms and product names
- HTML validation: Automatically checks and balances HTML tags to prevent build errors
Not translated:
- Technical terms (API, OAuth, etc.)
- Product names (InterMIND, Pipedrive)
- Link anchors and URLs
- Code and technical configuration
Translated:
- All user-facing content
- Meta tags for SEO
- Image alt text
- Tables and diagrams
After translation, verify HTML tag balance:
# Check all translated files
pnpm translate:check
# Check specific language
pnpm translate:check ru
# The script will report:
# ✅ Balanced files (correct HTML structure)
# ❌ Unbalanced files (missing closing tags)Important: Always run translate:check before committing translations to catch HTML structure issues early.
For more details on translation fixes and validation, see: ../../scripts/TRANSLATION_FIX_2025.md
- Analytics: Vercel Analytics + Speed Insights
- Status page: https://status.mind.com/
- Error tracking: Built into Vercel
# Check environment variables
vercel env ls
# Update variables (creates .vercel/.env.development.local)
vercel pull
# Restart dev server
vercel dev# Rebuild project
pnpm build
# Check configuration
cat docs/.vitepress/config/locales.ts- Check domain settings in code
- Ensure
VERCEL_ENVis set correctly - Verify redirect URI in OAuth provider
- Code: Apache License 2.0
- Content: Creative Commons Attribution-ShareAlike 4.0
Details in LICENSE.md.

