Follow these steps to set up and run the project on your local machine.
Make sure you have the following installed:
Install Expo CLI globally (if not installed):
npm install -g expo-cli
git clone <your-repository-url>
cd <project-folder>
API_KEY=your-api-key
AUTH_DOMAIN=your-auth-domain
PROJECT_ID=your-project-id
STORAGE_BUCKET=your-storage-bucket
MESSAGING_SENDER_ID=your-messaging-sender-id
APP_ID=your-app-id
MEASUREMENT_ID=your-measurement-id
import firebase from 'firebase/compat/app';
import 'firebase/compat/auth';
import 'firebase/compat/firestore';
const firebaseConfig = {
apiKey: process.env.API_KEY,
authDomain: process.env.AUTH_DOMAIN,
projectId: process.env.PROJECT_ID,
storageBucket: process.env.STORAGE_BUCKET,
messagingSenderId: process.env.MESSAGING_SENDER_ID,
appId: process.env.APP_ID,
measurementId: process.env.MEASUREMENT_ID
};
if (!firebase.apps.length) {
firebase.initializeApp(firebaseConfig);
}
const db = firebase.firestore();
export { firebase, db };
Go to Firestore Database > Rules in Firebase Console and set:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write;
}
}
}
Click Publish to save.
npm install
Start the development server:
npm expo start
Scan the QR code in the Expo Go app on your mobile device or run on an emulator.
- Ensure .env file is not pushed to GitHub (It's already ignored in
.gitignore
). - If any issue occurs, run
expo doctor
to check for problems. - Firestore is public, so be cautious with sensitive data.
If you face any issues, feel free to ask! 😊