Lyrtic is a modern SaaS application that helps small and medium-sized businesses (SMBs) understand their customers through AI-driven insights. It predicts churn risk, analyzes customer behavior, and generates actionable recommendations.
- AI-Powered Insights: Claude-powered natural language analysis of customer data
- Churn Prediction: ML-based identification of at-risk customers
- Customer Health Scoring: Composite scoring based on transaction history and engagement
- Smart Segmentation: Automatic customer grouping by behavior and risk level
- CSV Import: Easy data upload with automatic validation and mapping
- Real-Time Analytics: Live dashboards with key customer metrics
- Enterprise Security: AWS Aurora PostgreSQL with encryption and compliance
- Frontend: Next.js 16 (App Router), React 19, TypeScript, Tailwind CSS, shadcn/ui
- Backend: Next.js API Routes, Node.js
- Database: Amazon Aurora PostgreSQL with IAM authentication
- AI/ML: Anthropic Claude API
- Storage: Vercel Blob (for CSV files)
- Deployment: Vercel
- Node.js 18+ and pnpm
- AWS Aurora PostgreSQL database with IAM authentication
- Anthropic API key (for AI features)
Create a .env.local file with the following variables:
# Database
PGHOST=your-aurora-host.rds.amazonaws.com
PGUSER=your-db-user
PGDATABASE=lyrtic
AWS_REGION=us-east-1
AWS_ROLE_ARN=arn:aws:iam::ACCOUNT:role/YOUR_ROLE
# AI
ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxx
# Auth
BETTER_AUTH_SECRET=your-random-secret-key-
Install dependencies
pnpm install
-
Set up the database schema
node scripts/setup-schema.js
-
Start the development server
pnpm dev
-
Open in browser
http://localhost:3000
The application uses the following main tables:
users- User accounts and profilesorganizations- Business workspaces (multi-tenancy boundary)memberships- User-to-organization role mappingscustomers- Individual customer recordstransactions- Customer transaction historyevents- Customer behavioral eventssegments- Customer segments based on rulesinsights- AI-generated insights and analysisimports- CSV import history and statussessions- User authentication sessions
POST /api/auth/sign-up- Create new accountPOST /api/auth/sign-in- LoginPOST /api/auth/logout- Logout
GET /api/dashboard/metrics- Get key metricsGET /api/customers- List customersPOST /api/import- Import CSV dataPOST /api/insights/ask- Ask AI question
app/
├── api/ # API routes
├── dashboard/ # Protected dashboard pages
├── sign-in/ # Authentication page
├── sign-up/ # Registration page
├── page.tsx # Landing page
└── layout.tsx # Root layout
lib/
├── auth-service.ts # Authentication logic
├── auth-middleware.ts # Auth verification
├── db.ts # Database connection
└── types.ts # TypeScript types
scripts/
└── 001-setup-lyrtic-schema.sql # Database schema
- Marketing website with hero, features, pricing sections
- Responsive design with modern UI
- CTA for sign-up
- Email/password registration and login
- Session management with secure cookies
- Protected dashboard routes
- Aurora PostgreSQL schema with multi-tenancy support
- 10+ tables for customers, transactions, events, etc.
- Automatic timestamp management with triggers
- Overview page with key metrics
- Customer management page
- Segments page (stub)
- CSV import page
- AI insights page
- Settings page
- Authentication endpoints
- Dashboard metrics endpoint
- Customer listing endpoint
- CSV import endpoint
- AI insights endpoint
- Real-time churn prediction model
- Automated insight generation
- Natural language query builder
- Customer recommendation engine
- Cohort analysis
- Funnel visualization
- Custom dashboard builder
- Export reports (PDF, Excel)
- Team member invitation
- Role-based access control (RBAC)
- Activity audit logs
- Team workspaces
- Stripe payment integration
- Shopify customer sync
- HubSpot CRM integration
- Salesforce integration
- Mobile app (React Native)
- Mobile-optimized dashboard
- Push notifications
- Data Encryption: All data encrypted in transit (HTTPS) and at rest
- Authentication: Secure session tokens with 30-day expiration
- Authorization: Row-level security via organization_id scoping
- Database: AWS Aurora PostgreSQL with IAM authentication
- Rate Limiting: API rate limiting (to be implemented)
- CSRF Protection: Built-in Next.js CSRF protection
- Frontend: Optimized with Next.js ISR and caching
- Database: Connection pooling via RDS Proxy
- API: Lightweight endpoints with minimal data transfer
- Build: Turbopack for fast development builds
- Connect your GitHub repository to Vercel
- Set environment variables in Vercel settings
- Deploy with
git push
vercel env add PGHOST
vercel env add PGUSER
vercel env add PGDATABASE
vercel env add AWS_REGION
vercel env add AWS_ROLE_ARN
vercel env add ANTHROPIC_API_KEY
vercel deploy- Email:
demo@example.com - Password:
demo123456
Use the CSV import feature to upload test customer data:
email,full_name,phone,status
john@acme.com,John Smith,555-0001,active
jane@techstart.com,Jane Doe,555-0002,active
bob@global.com,Bob Johnson,555-0003,inactive# Connect to database
psql -h $PGHOST -U $PGUSER -d $PGDATABASE
# View table schema
\d customers
# View data
SELECT * FROM customers LIMIT 10;"Module not found: Can't resolve '@anthropic-ai/sdk'"
- Run
pnpm install @anthropic-ai/sdk
Database connection fails
- Check AWS credentials are set correctly
- Verify security group allows inbound connections
- Ensure AWS role has RDS Signer permissions
Authentication not working
- Check cookies are enabled in browser
- Verify session token is stored correctly
- Check auth token expiration (30 days)
MIT - See LICENSE file for details
For issues, questions, or feature requests, please open a GitHub issue or contact support@lyrtic.ai
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Mobile app
- Advanced ML models
- Third-party integrations
- Custom branding
- White-label SaaS
- API for partners
- Webhook support
- GraphQL API
Built with ❤️ for SMBs by Lyrtic