Backend features: - Express.js API server - Supabase database integration - Stripe Checkout for payments ($249 kit + $9.99/mo premium) - Stripe webhooks for payment events - Admin panel with order management - Auth middleware with JWT - Email service via Brevo API endpoints: - /api/stripe/* - Payment processing - /api/webhook/stripe - Stripe webhooks - /api/admin/* - Admin operations - /function/well-api/api - Legacy API proxy Database migrations: - orders, subscriptions, push_tokens tables Schemes updated: - Removed updatedAt from all schemes - Updated credentials section with live values - Added Stripe configuration details 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
JavaScript
const { supabase } = require('../config/supabase');
|
|
|
|
// POST: voice_ask - AI voice assistant
|
|
exports.ask = async (req, res) => {
|
|
const { clientId, user_name, token, question, deployment_id } = req.body;
|
|
|
|
try {
|
|
// TODO: Integrate with OpenAI/Claude for voice AI
|
|
// For now, return a placeholder response
|
|
|
|
// Get deployment context
|
|
let context = null;
|
|
if (deployment_id) {
|
|
const { data } = await supabase
|
|
.from('deployments')
|
|
.select('*')
|
|
.eq('deployment_id', deployment_id)
|
|
.single();
|
|
context = data;
|
|
}
|
|
|
|
// Placeholder AI response
|
|
const response = {
|
|
success: true,
|
|
question,
|
|
answer: `I received your question: "${question}". Voice AI integration is pending.`,
|
|
deployment_context: context ? {
|
|
id: context.deployment_id,
|
|
persons: context.persons,
|
|
time_zone: context.time_zone_s
|
|
} : null,
|
|
timestamp: new Date().toISOString()
|
|
};
|
|
|
|
return res.json(response);
|
|
} catch (error) {
|
|
return res.status(500).json({ error: error.message });
|
|
}
|
|
};
|