Skip to main content

Firebase Setup for the Social Network React Native App

The Social Network app depends on Firebase for identity, social data, feeds, media uploads, and optional notifications or backend automation.

Quick Answer

Create a Firebase project, add both iOS and Android apps, replace Firebase config files, enable Authentication, Firestore, and Storage, deploy rules and indexes, deploy Functions if included, then test user creation, follow/friend actions, post creation, media upload, comments, reactions, and chat.

Required Firebase Services

ServiceUse
Authenticationusers and identity.
Firestoreusers, posts, comments, reactions, feeds, social graph, chats.
Storagephotos, videos, and attachments.
Functionsnotifications, feed fan-out, moderation, media processing if included.
Cloud Messagingpush notifications.
App Checkproduction backend protection.

Step-by-step

  1. Follow Configure a Firebase Project.
  2. Replace iOS and Android Firebase config files.
  3. Enable Email/password Auth and any social providers used by your package.
  4. Enable Firestore.
  5. Enable Storage.
  6. Deploy Firestore rules and indexes if included.
  7. Deploy Storage rules if included.
  8. Deploy Functions if included.
  9. Configure push notifications if the app sends notifications.
  10. Test the app with at least two users.

Firestore Collections To Verify

Names can vary by package version, but social apps commonly use:

CollectionPurpose
usersuser profiles and account metadata.
SocialNetwork_Postspost records.
socialnetwork_commentspost comments.
socialnetwork_reactionslikes and reactions.
social_feedsfeed distribution or user feed records.
entitieshashtags, search data, or denormalized references.
channels / messageschat data if chat is included.

Do not hard-code production rules from this table. Use the package rules and adapt them to your own data model.

Rules And Indexes

Deploy included rules and indexes from the Firebase folder:

firebase deploy --only firestore:rules
firebase deploy --only firestore:indexes
firebase deploy --only storage

If Firestore reports a missing index, open the link from the app or terminal logs and create the index in Firebase Console.

Media Uploads

Verify:

  • Storage is enabled;
  • the user is authenticated;
  • Storage rules allow the intended write path;
  • the selected local URI is valid;
  • large images are compressed when possible;
  • failed post creation cleans up partial media when the app supports cleanup.

Production Checks

Before release:

  • configure App Check;
  • configure budget alerts;
  • review fan-out writes;
  • review Firestore read limits;
  • verify Functions logs;
  • test push notifications on a physical device.

Troubleshooting

permission-denied when reading posts

Check Auth state, Firestore rules, user document creation, and required indexes.

Post with image fails

Check Storage rules and Functions logs. If your package processes uploads through Functions, billing and secrets may also be required.

Feed is empty after posting

Check the post document, feed collection, author ID, missing index errors, and whether the feed query filters out the current user.

Next Steps