A mobile application for iOS and Android that turns vocabulary learning into an engaging daily quiz game with competitive and reward-based elements.
- User Accounts: Parent and Son accounts with account linking
- Vocabulary Database: Cloud-synced vocabulary cards with CRUD operations
- Daily Quiz: 3 random vocabulary cards per day
- Scoring System: Points for correct answers with speed bonuses
- Competitive Leaderboard: Daily, weekly, and all-time scores
- Daily Streaks: Track consecutive days of quiz completion
- Daily Reminders: Push notifications to maintain streaks
- Monetary Reward System: Parent-controlled reward tracking
- Admin Panel: Parent dashboard for managing vocabulary and rewards
- Vocabulary Manager: Add, edit, and delete vocabulary cards
- Frontend: React Native with Expo
- Language: TypeScript
- Backend: Firebase (Firestore, Authentication, Cloud Messaging)
- Navigation: React Navigation
- State Management: React Context API
- Node.js (v16 or higher)
- npm or yarn
- Expo CLI (
npm install -g expo-cli) - Firebase account (free tier is sufficient)
git clone <your-repo-url> cd AF_Scriptsnpm install- Go to Firebase Console
- Click "Add project"
- Follow the setup wizard to create your project
-
Authentication:
- Go to Authentication > Sign-in method
- Enable "Email/Password" authentication
-
Firestore Database:
- Go to Firestore Database
- Click "Create database"
- Start in "production mode" (we'll add security rules later)
- Choose a location closest to your users
-
Cloud Messaging (for push notifications):
- Go to Project Settings > Cloud Messaging
- Note your Server Key (you'll need this later)
- Go to Project Settings > General
- Scroll down to "Your apps"
- Click the Web icon (</>)
- Register your app with a nickname
- Copy the configuration object
-
Copy
.env.exampleto.env:cp .env.example .env
-
Open
.envand fill in your Firebase credentials:EXPO_PUBLIC_FIREBASE_API_KEY=your_api_key_here EXPO_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project_id.firebaseapp.com EXPO_PUBLIC_FIREBASE_PROJECT_ID=your_project_id EXPO_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project_id.appspot.com EXPO_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id EXPO_PUBLIC_FIREBASE_APP_ID=your_app_id
Set up security rules in Firestore to protect your data:
rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { // Users collection match /users/{userId} { allow read: if request.auth != null; allow write: if request.auth.uid == userId; } // Vocabulary cards - anyone can read, only parents can write match /vocabularyCards/{cardId} { allow read: if request.auth != null; allow write: if request.auth != null && get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == 'parent'; } // User vocabulary progress match /userVocabularyProgress/{progressId} { allow read, write: if request.auth != null && resource.data.userId == request.auth.uid; } // Quiz attempts match /quizAttempts/{attemptId} { allow read, write: if request.auth != null && resource.data.userId == request.auth.uid; } // Streaks match /streaks/{streakId} { allow read, write: if request.auth != null && resource.data.userId == request.auth.uid; } // Reward rules - only parents can manage match /rewardRules/{ruleId} { allow read: if request.auth != null; allow write: if request.auth != null && get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == 'parent'; } // Rewards earned match /rewardsEarned/{rewardId} { allow read: if request.auth != null; allow create: if request.auth != null; allow update: if request.auth != null && get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == 'parent'; } } }npm start- iOS Simulator: Press
iin the terminal - Android Emulator: Press
ain the terminal - Web Browser: Press
win the terminal - Physical Device: Scan the QR code with Expo Go app
AF_Scripts/ ├── src/ │ ├── components/ # Reusable UI components │ ├── contexts/ # React Context providers │ │ └── AuthContext.tsx │ ├── navigation/ # Navigation configuration │ │ └── AppNavigator.tsx │ ├── screens/ # App screens │ │ ├── LoginScreen.tsx │ │ ├── RegisterScreen.tsx │ │ ├── HomeScreen.tsx │ │ ├── QuizScreen.tsx │ │ ├── LeaderboardScreen.tsx │ │ ├── ProfileScreen.tsx │ │ ├── AdminPanelScreen.tsx │ │ └── VocabularyManagerScreen.tsx │ ├── services/ # Firebase and API services │ │ ├── firebase.ts │ │ ├── authService.ts │ │ ├── vocabularyService.ts │ │ ├── quizService.ts │ │ ├── streakService.ts │ │ ├── leaderboardService.ts │ │ └── rewardService.ts │ ├── types/ # TypeScript type definitions │ │ └── index.ts │ └── utils/ # Helper functions ├── assets/ # Images, fonts, etc. ├── App.tsx # Main app entry point ├── package.json └── tsconfig.json - Register: Create an account with role "Parent"
- Add Vocabulary: Navigate to Admin Panel > Manage Vocabulary
- Create Rewards: Set up reward rules in the Admin Panel
- Link Accounts: Share your user ID with your son to link accounts
- Monitor Progress: View leaderboard and son's quiz history
- Mark Rewards: Mark earned rewards as paid in Admin Panel
- Register: Create an account with role "Learner"
- Daily Quiz: Complete 3 vocabulary cards every day
- Build Streaks: Don't miss a day to maintain your streak
- Earn Points: Answer correctly and quickly for bonus points
- Compete: Check the leaderboard to compete with your parent
- Track Rewards: View your pending and paid rewards in your profile
- Correct Answer: 10 points
- Speed Bonus:
- Under 5 seconds: +5 points
- Under 10 seconds: +3 points
- Maximum per question: 15 points
- Maximum per day: 45 points (3 questions)
- Display name, email, role (parent/son)
- Linked user ID for parent-son connection
- Front (word), Back (definition)
- Example sentence (optional)
- Difficulty level (1-5)
- User, date, cards
- Answers with time spent
- Score and total points
- Current streak, longest streak
- Last completed date
- Title, description, amount
- Condition type (streak/mastery/score)
- Target value
To enable push notifications:
-
Install Expo Notifications:
npx expo install expo-notifications
-
Configure notification permissions in your app
-
Set up Firebase Cloud Messaging in your Firebase project
-
Implement notification scheduling for daily reminders
npx expo build:iosnpx expo build:androidFor more details, see Expo Build Documentation
- Verify your
.envfile has correct credentials - Check Firebase project settings
- Ensure Authentication and Firestore are enabled
- Clear cache:
npx expo start -c - Reinstall dependencies:
rm -rf node_modules && npm install - Update Expo:
npm install -g expo-cli
- Ensure vocabulary cards exist in Firestore
- Check parent has added words in Vocabulary Manager
- Verify Firestore security rules allow read access
This is a private family project, but suggestions are welcome!
MIT License - Feel free to use this for your own family learning projects!
For issues or questions:
- Check the Troubleshooting section
- Review Firebase Console for errors
- Check Expo logs for detailed error messages
- Spaced repetition algorithm
- Image support for vocabulary cards
- Audio pronunciation
- Multiple choice variations
- Progress charts and analytics
- Social features (share achievements)
- Dark mode
- Offline mode with sync
Built with ❤️ for family vocabulary learning