Skip to content

george11642/SmileScore

Repository files navigation

SmileScore

AI-powered oral hygiene guidance platform with subscription management and affiliate system.

Project Structure

SmileScore/
├── web/                 # Next.js web application
├── mobile/              # React Native/Expo mobile application
├── supabase/            # Database migrations
└── docs/                # Documentation

Tech Stack

  • Web: Next.js 14+, TypeScript, Tailwind CSS
  • Mobile: React Native/Expo, TypeScript
  • Backend: Next.js API Routes, Vercel Serverless
  • Database: Supabase (PostgreSQL)
  • Auth: Supabase Auth
  • Storage: Supabase Storage
  • Payments: Stripe Checkout
  • AI: OpenAI Vision API
  • Emails: Resend

Setup Instructions

Prerequisites

  1. Node.js 18+ installed
  2. Supabase account and project
  3. Stripe account
  4. OpenAI API key
  5. Resend account

1. Supabase Setup

  1. Create a new Supabase project at https://supabase.com
  2. Go to SQL Editor and run migrations in order:
    • supabase/migrations/20250118000001_initial_schema.sql
    • supabase/migrations/20250118000002_rls_policies.sql
    • supabase/migrations/20250118000003_seed_routine_templates.sql
  3. Create a storage bucket named user-photos with public access
  4. Get your project URL and anon key from Settings > API

2. Stripe Setup

  1. Create products and prices in Stripe Dashboard:
    • Essential Monthly: price_essential_monthly
    • Essential Yearly: price_essential_yearly
    • Pro Monthly: price_pro_monthly
    • Pro Yearly: price_pro_yearly
  2. Set up webhook endpoint: https://your-domain.com/api/webhooks/stripe
  3. Subscribe to events:
    • checkout.session.completed
    • customer.subscription.created
    • customer.subscription.updated
    • customer.subscription.deleted
    • invoice.payment_failed
  4. Get your webhook secret from the webhook configuration

3. Environment Variables

Web App (web/.env.local)

NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key

NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret

OPENAI_API_KEY=your_openai_api_key

RESEND_API_KEY=your_resend_api_key
RESEND_FROM_EMAIL=noreply@yourdomain.com

NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_APP_NAME=SmileScore

Mobile App (mobile/.env)

EXPO_PUBLIC_SUPABASE_URL=your_supabase_project_url
EXPO_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key
EXPO_PUBLIC_APP_URL=https://your-app-domain.com
EXPO_PUBLIC_APP_NAME=SmileScore

4. Install Dependencies

# Web app
cd web
npm install

# Mobile app
cd ../mobile
npm install

5. Run Development Servers

# Web app (from web directory)
npm run dev

# Mobile app (from mobile directory)
npm start

Deployment

Web App (Vercel)

  1. Push code to GitHub
  2. Import project in Vercel
  3. Add environment variables
  4. Deploy

Mobile App (EAS)

  1. Install EAS CLI: npm install -g eas-cli
  2. Login: eas login
  3. Configure: eas build:configure
  4. Build: eas build --platform ios or eas build --platform android

Key Features

  • ✅ User authentication and onboarding
  • ✅ AI-powered photo analysis
  • ✅ Routine templates and habit tracking
  • ✅ Stripe subscription management
  • ✅ Affiliate system with commission tracking
  • ✅ Admin dashboard for affiliate management
  • ✅ Share card generation
  • ✅ Email notifications via Resend

Medical Disclaimer

Important: SmileScore is not a replacement for professional dental care. The app does not provide medical advice, diagnosis, or treatment. Users should always consult a licensed dentist for any concerns about their oral health.

License

Proprietary - All rights reserved

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors