Quick start guide to get MessageAI running on your machine.
Before you begin, ensure you have:
- Node.js 18+ installed (
node --version) - npm or yarn package manager
- Git for version control
- Expo account (free) at expo.dev
- Firebase account (free tier works for development)
- OpenAI API key with credits
# Install project dependencies
npm install
# Install Firebase CLI globally
npm install -g firebase-tools
# Install Expo CLI globally (optional but recommended)
npm install -g expo-cli
# Install dependencies for Cloud Functions
cd firebase/functions
npm install
cd ../..- Go to Firebase Console
- Click "Add project"
- Enter project name: "messageai" (or your choice)
- Disable Google Analytics (optional)
- Click "Create project"
Cloud Functions require the Blaze (pay-as-you-go) plan:
- In Firebase Console, click "Upgrade" in the bottom left
- Select "Blaze" plan
- Set up billing (has generous free tier)
- Confirm upgrade
Enable Authentication:
- Go to "Authentication" in left sidebar
- Click "Get started"
- Click "Sign-in method" tab
- Enable "Email/Password"
- Click "Save"
Enable Firestore:
- Go to "Firestore Database"
- Click "Create database"
- Select "Start in test mode" (we'll deploy secure rules later)
- Choose location closest to your users
- Click "Enable"
Enable Storage:
- Go to "Storage"
- Click "Get started"
- Start in test mode
- Use default location
- Click "Done"
- In Firebase Console, click the gear icon → "Project settings"
- Scroll to "Your apps" section
- Click the web icon (
</>) to add a web app - Register app with nickname "MessageAI Web"
- Copy the firebaseConfig object
Create a .env file in project root:
cp .env.example .envEdit .env and paste your Firebase config:
EXPO_PUBLIC_FB_API_KEY=AIza...
EXPO_PUBLIC_FB_AUTH_DOMAIN=your-project.firebaseapp.com
EXPO_PUBLIC_FB_PROJECT_ID=your-project
EXPO_PUBLIC_FB_STORAGE_BUCKET=your-project.appspot.com
EXPO_PUBLIC_FB_SENDER_ID=123456789
EXPO_PUBLIC_FB_APP_ID=1:123456789:web:abc...
firebase loginThis opens a browser to authenticate.
firebase use --add- Select your Firebase project from the list
- Choose an alias (e.g., "default")
Set your OpenAI API key for Cloud Functions:
firebase functions:config:set openai.api_key="sk-..."Replace sk-... with your actual OpenAI API key.
firebase deploy --only firestore:rulesThis deploys the security rules from firebase/firestore.rules.
# Build and deploy functions
cd firebase/functions
npm run build
cd ../..
firebase deploy --only functionsThis takes a few minutes. You should see:
- ✓ messageCreated
- ✓ summarize
- ✓ extract
- ✓ search
- ✓ generateEmbeddings
- ✓ detectScheduling
- ✓ suggestTimes
npm startThis opens Expo Developer Tools in your browser.
Option A: Use Expo Go (Easiest)
- Install "Expo Go" app on your phone (iOS/Android)
- Scan the QR code from the terminal
- App loads on your device
Option B: iOS Simulator (Mac only)
npm run iosOption C: Android Emulator
npm run android-
Run the app and sign up with two test emails:
- user1@test.com / password123
- user2@test.com / password123
-
Note the UIDs:
- Open Firebase Console → Authentication
- Copy the UID for each user
- Go to Firebase Console → Firestore Database
- Click "Start collection"
- Collection ID:
threads - Add first document:
{
"type": "direct",
"members": ["UID1", "UID2"],
"createdAt": [click "Add field" → type: timestamp → current timestamp],
"updatedAt": [timestamp, current],
"lastMessage": null
}- Copy the generated thread ID
- In the thread document, click "Start collection"
- Collection ID:
members - Document ID: UID1
- Fields:
{
"role": "member",
"joinedAt": [timestamp, current],
"readAt": null,
"typing": false
}- Add another document with ID: UID2 (same fields)
- Open app on two devices with the two test accounts
- You should see the thread in your list
- Send messages back and forth
- Test AI features:
- Tap "Summarize" button
- Send urgent message to test priority detection
- View decisions automatically extracted
# Clear cache
expo start -c
# Reinstall dependencies
rm -rf node_modules
npm install- Check
.envfile has correct values - Verify Firebase services are enabled
- Check Firestore rules were deployed
# Check deployment status
firebase functions:list
# View logs
firebase functions:log
# Verify OpenAI key is set
firebase functions:config:get- Verify you're testing on a physical device (not simulator for push)
- Check notification permissions are granted
- Test foreground notifications first
# In project root
npm install --save-dev @types/react @types/react-native
# In functions directory
cd firebase/functions
npm install --save-dev @types/nodeOnce everything is running:
-
Test Core Features:
- Send messages in real-time
- Test offline mode (airplane mode)
- Verify push notifications
- Try image uploads
-
Test AI Features:
- Generate thread summaries
- Check priority detection
- View extracted decisions
- Try semantic search (after generating embeddings)
-
Generate Embeddings:
- In Firebase Console, go to Functions
- Manually call
generateEmbeddingswith{"threadId": "your-thread-id"} - This enables semantic search
-
Customize:
- Update app.json with your app name/icons
- Modify AI prompts in Cloud Functions
- Adjust UI styling to your preferences
When ready for production:
-
Build Mobile App:
eas build --platform ios eas build --platform android
-
Configure Push Notifications:
- Set up FCM for Android
- Configure APNs for iOS
- Update Firebase console with push credentials
-
Secure Firestore Rules:
- Review and tighten security rules
- Test with Firebase emulator
-
Monitor Costs:
- Set up billing alerts in Firebase
- Monitor OpenAI API usage
- Configure rate limiting
- Expo Docs: https://docs.expo.dev/
- Firebase Docs: https://firebase.google.com/docs
- React Navigation: https://reactnavigation.org/
- OpenAI API: https://platform.openai.com/docs
Development (Free Tier):
- Firebase: Free tier sufficient for development
- OpenAI: ~$1-2 for initial testing
Production (Light Usage):
- Firebase Blaze: ~$5-10/month (with free tier included)
- OpenAI: ~$10-20/month for moderate usage
- Total: ~$15-30/month
Ready to build! If you encounter issues, check the troubleshooting section or review the detailed documentation in docs/README.md.