A collaborative study app built with React Native and Expo that helps students stay focused and motivated through timed study sprints, AI-powered quizzes, and social accountability.
- Timed Focus Sessions: Create 1-180 minute study sprints with specific topics and goals
- Sprint Photos: Capture start/end photos to document your progress
- Join Others: See and join active sprints from your study circles
- Threading: Sprint messages create discussion threads for collaboration
- Private Groups: Create circles for your study groups or classes
- Public Discovery: Find and join public study circles
- Sprint Tracking: See active sprints and member participation
- Circle Streaks: Track consecutive days of 60%+ member participation
- Auto-Generated Quizzes: Get AI-generated quizzes based on your sprint topic and goals
- Concept Maps: Visual concept maps generated from your study session
- Performance Tracking: Track quiz scores and identify knowledge gaps
- Smart Suggestions: Get personalized topic suggestions based on your history
- Personal Streaks: Track consecutive study days with freeze tokens
- Circle Streaks: Group accountability through collective streaks
- Achievements: Earn freeze tokens every 7-day streak
- Reminders: Daily push notifications to maintain streaks
- Circle Messaging: Chat with study group members
- Photo Sharing: Share study materials and progress photos
- Auto-Expiring Messages: Messages expire after 24 hours to keep focus on current work
- Message Reactions: React with ππ₯π emojis
- Dark Theme: Eye-friendly dark mode for late-night study sessions
- Smooth Animations: Gesture-based interactions and transitions
- Camera Integration: Built-in camera for sprint photos
- Responsive Design: Works seamlessly on iOS and Android
- Frontend: React Native with Expo SDK 51
- Routing: Expo Router v3 (file-based routing)
- Styling: NativeWind (Tailwind CSS for React Native)
- Backend: Supabase (PostgreSQL, Auth, Realtime, Storage)
- AI Services: OpenAI GPT-4 for quiz and concept map generation
- State Management: React Context API
- Animations: React Native Reanimated & Gesture Handler
- Camera: Expo Camera
- Push Notifications: Expo Notifications
- Node.js (v18 or later)
- npm or yarn
- (Recommended) Expo Go app on your phone (iOS | Android)
- Supabase account
- OpenAI API key (for AI features)
git clone https://github.com/NoaheCampbell/SnapClone.git
cd SnapClone
npm install
- Go to supabase.com and create a new project
- Save your project URL and anon key from Settings β API
- In Supabase dashboard, go to SQL Editor
- Run the complete schema migration:
This creates all tables, functions, indexes, and cron jobs
-- Copy and paste contents of: -- supabase/migrations/20250125000000_complete_consolidated_schema.sql
- Go to Authentication β Providers
- Enable Email provider
- Important: Turn OFF "Confirm email" for development
- Configure any additional providers (Google, etc.) if needed
- Go to Storage and create these buckets:
chat-media
(for sprint photos and chat images)sprints
(for sprint photos)
- Set bucket to public or configure RLS policies as needed
- Install Supabase CLI:
npm install -g supabase
- Link your project:
supabase link --project-ref YOUR_PROJECT_REF
- Set Edge Function secrets:
supabase secrets set OPENAI_API_KEY=your_openai_api_key
- Deploy all Edge Functions:
supabase functions deploy
Create or update lib/supabase.ts
:
import AsyncStorage from '@react-native-async-storage/async-storage'
import { createClient } from '@supabase/supabase-js'
const supabaseUrl = 'YOUR_SUPABASE_PROJECT_URL'
const supabaseAnonKey = 'YOUR_SUPABASE_ANON_KEY'
export const supabase = createClient(supabaseUrl, supabaseAnonKey, {
auth: {
storage: AsyncStorage,
autoRefreshToken: true,
persistSession: true,
detectSessionInUrl: false,
},
})
# Start Expo development server
npx expo start
# For iOS Simulator (Mac only)
npx expo run:ios
# For Android Emulator
npx expo run:android
SnapClone/
βββ src/
β βββ app/ # Expo Router pages
β β βββ (auth)/ # Auth screens (login, signup, profile)
β β βββ (modals)/ # Modal screens (chat, settings, etc.)
β β βββ (tabs)/ # Main tabs (sprints, circles, inbox)
β β βββ index.tsx # Root redirect
β βββ components/ # Reusable components
β β βββ SprintCamera.tsx # Sprint photo capture
β β βββ QuizModal.tsx # AI quiz interface
β β βββ ConceptMapModal.tsx # Concept map viewer
β βββ contexts/ # React contexts
β βββ lib/ # Utilities and helpers
βββ supabase/
β βββ migrations/ # Database schema
β βββ functions/ # Edge Functions
β βββ generateGapAwareQuiz/
β βββ generateConceptMap/
β βββ updateStreaksDaily/
β βββ sendStreakReminders/
βββ assets/ # Images and fonts
βββ docs/ # Documentation
The following cron jobs are automatically set up:
- Message Cleanup: Runs every minute to delete expired messages
- Sprint Completion: Runs every 5 minutes to mark completed sprints
- Daily Streaks: Runs at 02:05 UTC to update user and circle streaks
- Streak Reminders: Runs at 18:00 UTC to send push notifications
- Configure Expo push notifications in
app.json
- Users need to allow notifications when prompted
- Push tokens are automatically saved to user profiles
The app uses OpenAI for:
- Generating quiz questions based on study topics
- Creating concept maps from study sessions
- Suggesting next study topics
-
Install EAS CLI:
npm install -g eas-cli
-
Configure EAS:
eas build:configure
-
Update
app.json
with your bundle identifier -
Build:
# iOS eas build --platform ios # Android eas build --platform android
For production builds, set these in EAS secrets:
SUPABASE_URL
SUPABASE_ANON_KEY
"Streaks not updating"
- Check that the
last_completed_local_date
field exists in the streaks table - Verify cron jobs are running in Supabase dashboard
- Ensure Edge Functions are deployed
"Threading not working"
- Verify
thread_root_id
is properly set on messages - Check that sprint messages are creating root threads
- Look for errors in Supabase logs
"Quiz generation failing"
- Verify OpenAI API key is set in Edge Function secrets
- Check Edge Function logs for errors
- Ensure sprint has topic and goals defined
"Camera not working"
- Grant camera permissions when prompted
- For iOS: Check Settings β Privacy β Camera
- For Android: Check App Info β Permissions
- Use Expo Go for rapid development
- Check Supabase Logs for database and Edge Function errors
- Enable Realtime for tables in Supabase dashboard
- Test on real devices for camera and push notifications
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit changes (
git commit -m 'Add amazing feature'
) - Push to branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License.
- Expo team for the excellent development platform
- Supabase for the real-time backend infrastructure
- OpenAI for powering the AI features
- React Native community for amazing libraries
Note: This is an educational project demonstrating modern mobile app development with AI integration.