Ensure you have:
- Node.js 18+ installed (Download)
- pnpm installed (
npm install -g pnpm) - Git installed
- Azure Account with credits (Free Account)
- Supabase Account (Free Account)
# Clone the repository
git clone https://github.com/yourusername/samvaad.git
cd samvaad
# Install dependencies
pnpm install-
Go to Azure Portal
-
Click "Create a resource"
-
Search for "Azure OpenAI"
-
Create a new resource:
- Name:
samvaad-openai(or your choice) - Subscription: Your subscription
- Resource Group: Create new or use existing
- Region: Choose closest to you (e.g.,
eastus,westus2) - Pricing Tier: Standard S0 (for production) or use free tier if available
- Name:
-
Once created, go to "Deployments" → "Manage deployments"
-
Create a new deployment:
- Model:
gpt-4orgpt-35-turbo - Deployment name:
gpt-4(note this name) - Wait for deployment to complete
- Model:
-
Copy the endpoint URL from "Keys and Endpoint" page:
- It looks like:
https://samvaad-openai.openai.azure.com/
- It looks like:
-
Copy one of the API keys (KEY 1 or KEY 2)
- In Azure Portal, create a new "Speech" resource
- Name it
samvaad-speech - Choose the same region as your OpenAI resource
- Copy the API key and region
- Create a "Translator" resource
- Name it
samvaad-translator - Choose the same region
- Copy the API key
- The endpoint is:
https://api.cognitive.microsofttranslator.com
- Create a "Cognitive Services" resource
- Enable "Text Analytics API"
- Copy the endpoint and API key
- Go to Supabase Dashboard
- Create a new project
- Wait for database to be ready (2-3 minutes)
- Go to "SQL Editor"
- Copy the contents of
supabase/migrations/20250313212230_init.sql - Paste and run it in the SQL Editor
- Go to "Settings" → "API"
- Copy:
- Project URL (looks like:
https://xxxxx.supabase.co) - anon/public key (starts with
eyJ...)
- Project URL (looks like:
Create a .env.local file in the project root:
# Supabase (Required)
NEXT_PUBLIC_SUPABASE_URL=https://xxxxx.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJ...
# Azure OpenAI (Required)
AZURE_OPENAI_ENDPOINT=https://samvaad-openai.openai.azure.com
AZURE_OPENAI_API_KEY=your_key_here
AZURE_OPENAI_DEPLOYMENT=gpt-4
AZURE_OPENAI_API_VERSION=2024-02-15-preview
# Azure Speech Services (Optional)
NEXT_PUBLIC_AZURE_SPEECH_KEY=your_key_here
NEXT_PUBLIC_AZURE_SPEECH_REGION=eastus
# Azure Translator (Optional)
NEXT_PUBLIC_AZURE_TRANSLATOR_KEY=your_key_here
NEXT_PUBLIC_AZURE_TRANSLATOR_ENDPOINT=https://api.cognitive.microsofttranslator.com
NEXT_PUBLIC_AZURE_TRANSLATOR_REGION=eastus
# Azure Cognitive Services (Optional)
NEXT_PUBLIC_AZURE_COGNITIVE_ENDPOINT=https://samvaad-cognitive.cognitiveservices.azure.com
NEXT_PUBLIC_AZURE_COGNITIVE_KEY=your_key_here# Start development server
pnpm dev
# Open browser
# Navigate to http://localhost:3000- Click "Get Started" on the landing page
- Sign up with email or OAuth provider
- Complete your profile
- Start using Samvaad!
-
Error: "API key is invalid"
- Solution: Double-check your API key in
.env.local - Make sure there are no extra spaces
- Solution: Double-check your API key in
-
Error: "Deployment not found"
- Solution: Check your deployment name matches
AZURE_OPENAI_DEPLOYMENT - Verify the deployment is active in Azure Portal
- Solution: Check your deployment name matches
-
Error: "Rate limit exceeded"
- Solution: Check your Azure quotas
- Consider using
gpt-35-turbofor development (cheaper)
-
Error: "Invalid API key"
- Solution: Use the
anonkey, not theservice_rolekey - Verify the URL is correct (should end with
.supabase.co)
- Solution: Use the
-
Error: "Table does not exist"
- Solution: Run the migration SQL script again
- Check the SQL Editor for any errors
- The app will fallback to Web Speech API if Azure Speech is not configured
- Check browser console for specific errors
- Verify microphone permissions are granted
- The app works without Azure Translator
- Translation features will be disabled if not configured
- Check API key and endpoint are correct
- Push your code to GitHub
- Import project in Vercel
- Add all environment variables
- Deploy!
- Install Azure CLI
- Run:
az webapp up --name samvaad-app --runtime "NODE:18-lts"- Configure environment variables in Azure Portal
- Deploy!
-
Azure OpenAI GPT-4: ~$0.03 per 1K tokens
- Estimated: $10-50/month for moderate usage
-
Azure Speech Services:
- Free tier: 5 hours/month
- Standard: ~$1 per hour
-
Azure Translator:
- Free tier: 2M characters/month
- Standard: $10 per 1M characters
-
Text Analytics:
- Free tier: 5K transactions/month
- Standard: $1 per 1K transactions
Total Estimated Cost: $20-100/month for moderate usage
- Free tier: 500MB database, 2GB bandwidth
- Pro tier: $25/month (if needed)
- Never commit
.env.localto Git - Use environment variables in production
- Enable Row Level Security in Supabase (already configured)
- Rotate API keys regularly
- Monitor Azure costs and set up alerts
- Use Azure Key Vault for production secrets
For issues or questions:
- Check the README.md
- Review IMAGINE_CUP.md for project details
- Open an issue on GitHub
Happy Learning and Advocating with Samvaad! 🚀