Therapyship: AI-Powered Relationship Therapy Platform
🌟 Inspiration
The inspiration for Therapyship came from recognizing a fundamental gap in modern relationships: accessibility to professional guidance. In today's fast-paced world, many couples struggle with communication issues, relationship challenges, and emotional barriers, but traditional therapy can be expensive, time-consuming, and intimidating. We envisioned a platform that could provide immediate, compassionate, and professional relationship support through the power of artificial intelligence.
The project was born from the belief that everyone deserves access to relationship guidance, regardless of their schedule, budget, or location. We wanted to create a safe space where people could explore their feelings, improve communication, and strengthen their bonds with their partners through innovative AI technologies.
🎯 What We Built
Therapyship is a comprehensive AI-powered relationship therapy platform that offers multiple ways to connect and heal:
Core Features
- 🤖 AI Text Therapy: Conversational therapy sessions powered by OpenAI's GPT-3.5-turbo with specialized relationship counseling prompts
- 🎙️ Voice Therapy Sessions: Real-time voice conversations with AI therapists using ElevenLabs' advanced voice synthesis
- 📹 Video Therapy Sessions: Face-to-face interactions with realistic AI avatars through Tavus.ai integration
- ⭐ Zodiac Compatibility Analysis: AI-driven astrological compatibility insights for couples
- 📊 Progress Tracking: Comprehensive analytics and session history
- 💳 Flexible Subscription Plans: Freemium model with usage-based limitations
Technical Architecture
Built with a modern, scalable tech stack:
- Frontend: Next.js 15 with App Router, TypeScript, Tailwind CSS, Framer Motion
- Backend: Supabase with PostgreSQL, Row-Level Security (RLS)
- AI Services: OpenAI for text, ElevenLabs for voice, Tavus.ai for video
- Payments: Stripe integration with webhook handling
- UI/UX: Shadcn/ui components with custom animations
🚀 How We Built It
1. Planning & Architecture
We started by designing a serverless-first architecture that could scale efficiently:
// Centralized user rights management
export class UserRightsService {
async useTextMessage(userId: string) {
// Atomic check, reset, and decrement operations
return await this.supabase.rpc('use_text_message', { user_id: userId });
}
}
2. AI Integration Strategy
We implemented a multi-modal AI approach:
Text Therapy: Custom system prompts for relationship-focused conversations
const SYSTEM_PROMPT = `You are an experienced relationship therapist.
You help people with their relationship problems...`;
Voice Integration: Real-time voice sessions with gender-specific AI therapists
const agentId = voice === "female"
? ELEVENLABS_AGENT_ID_FEMALE
: ELEVENLABS_AGENT_ID_MALE;
Compatibility Analysis: AI-powered zodiac insights with detailed relationship advice
3. User Experience Design
We focused on creating an empathetic and accessible user experience:
- Responsive Design: Mobile-first approach with beautiful animations
- Progress Indicators: Real-time usage tracking and limits display
- Seamless Onboarding: Social login options and guided registration
4. Database Design
We implemented a sophisticated subscription and usage tracking system:
-- Key tables for user rights management
- subscription_plans: Plan definitions and limits
- user_subscriptions: User-plan relationships
- user_rights_tracking: Real-time usage counters
🎓 What We Learned
Technical Learnings
- Serverless Architecture: We learned to leverage Supabase's edge functions and PostgreSQL RPC calls for complex business logic
- AI Integration: Successfully integrated three different AI services (OpenAI, ElevenLabs, Tavus) into a cohesive user experience
- State Management: Used React's built-in state management effectively with custom hooks for complex flows
Business Insights
- Freemium Strategy: Balancing free features with premium offerings to encourage user engagement
- Usage-Based Limitations: Creating fair usage policies that encourage upgrades without limiting initial exploration
- Privacy & Security: Implementing end-to-end encryption and strict data protection for sensitive therapy conversations
UX/UI Discoveries
- Emotional Design: Using warm colors, smooth animations, and empathetic microcopy to create a safe, welcoming environment
- Progressive Disclosure: Gradually introducing features to avoid overwhelming new users
- Mobile-First Therapy: Optimizing the therapy experience for mobile devices where users feel most comfortable
🔥 Challenges We Faced
1. Real-time Voice Integration
Challenge: Managing voice session state, handling connection drops, and accurate usage tracking.
Solution: Built robust error handling and session management:
// Automatic session cleanup and usage calculation
const minutesUsed = Math.ceil(duration / 60);
await userRightsService.useVoiceMinutes(userId, minutesUsed);
2. Complex Subscription Logic
Challenge: Managing multiple usage types (daily text, monthly voice/video) with atomic operations.
Solution: PostgreSQL functions for atomic database operations:
-- Database-level atomic operations prevent race conditions
CREATE OR REPLACE FUNCTION use_text_message(user_id UUID)
RETURNS user_rights_tracking
3. Performance Optimization
Challenge: Ensuring fast load times with multiple AI service integrations.
Solution:
- Implemented lazy loading for heavy components
- Used Framer Motion for smooth animations without blocking the main thread
- Optimized API calls with proper caching strategies
4. Privacy and Security
Challenge: Handling sensitive therapy data while complying with privacy regulations.
Solution:
- Implemented Supabase Row-Level Security (RLS)
- All therapy conversations are encrypted
- Minimal data collection with user consent
🌈 Impact and Future Vision
Therapyship represents our vision of democratizing relationship therapy through technology. We've created a platform that:
- Removes barriers to accessing professional relationship guidance
- Provides 24/7 availability for those who need support
- Offers multiple interaction modes to suit different comfort levels
- Maintains affordability through intelligent pricing tiers
Future Enhancements
- Couple's Joint Sessions: Synchronized therapy sessions for both partners
- Personalized Learning Paths: AI-curated relationship improvement journeys
- Integration with Wearables: Stress and emotion tracking for better insights
- Community Features: Safe spaces for sharing experiences and support
🏆 Technical Achievements
- Multi-modal AI Integration: Successfully combined text, voice, and video AI services
- Scalable Architecture: Built with serverless technologies for automatic scaling
- Real-time Features: WebSocket integration for live voice sessions
- Complex State Management: Sophisticated user rights and subscription handling
- Beautiful UX: Crafted an empathetic and accessible user interface
Therapyship is more than just a technology project—it's our contribution to helping people build stronger, healthier relationships through the thoughtful application of artificial intelligence. Every line of code was written to support human connection and emotional well-being.
Building this platform taught us that the most powerful technology is the kind that brings people closer together, not further apart.
Built With
- bolt
- chatgpt
- cursor
- elevanlabs
- entri
- lingo
- netlify
- stripe
- supabase
- tavus
Log in or sign up for Devpost to join the conversation.