A simple React Native app for gig workers to manage tasks with Firebase Authentication (email/password) and Cloud Firestore, React Navigation stacks, React Native Paper UI, and React Context for state.
- Go to Firebase Console → Add project (or use an existing one).
- Open Build → Authentication → Get started.
- Under Sign-in method, enable Email/Password.
- Open Build → Firestore Database → Create database.
- For development you can start in test mode (time-limited open rules). For a real app, use rules like below.
- Open Project settings (gear) → Your apps → add a Web app if you don’t have one.
- Copy the
firebaseConfigobject values.
Open src/services/firebase.js and replace the placeholder firebaseConfig with your real values:
const firebaseConfig = {
apiKey: '...',
authDomain: '...',
projectId: '...',
storageBucket: '...',
messagingSenderId: '...',
appId: '...',
};In Firestore → Rules, restrict data to the signed-in user:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId}/tasks/{taskId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
}
}
Publish the rules after editing.
Tasks are queried with orderBy('dueDate', 'asc'). If the console asks for a composite index, click the link in the error message to create it, or add a single-field index on dueDate under Firestore → Indexes if needed.
From the project folder:
npm install
npm startThen:
- Press
afor Android emulator / device (with Expo Go or dev client) - Press
wfor web (if supported by your setup) - Scan the QR code with Expo Go on a phone
Common scripts:
| Command | Description |
|---|---|
npm start |
Start Metro / Expo |
npm run android |
Start on Android |
npm run ios |
Start on iOS (macOS) |
npm run web |
Start web |
src/
screens/ Login, Register, Task list, Add/Edit task
components/ TaskCard, FilterBar
navigation/ Auth + main stack
services/firebase.js
context/TaskContext.js
- Register / login with email and password (Firebase Auth)
- Tasks stored under
users/{uid}/tasksin Firestore - Fields: title, description, due date, priority (low / medium / high), completed
- Sort by due date (earliest first) via Firestore query
- Priority colors: high = red, medium = yellow, low = green
- Completed tasks shown with strike-through
- Filter by priority and completion status
- Add, edit, delete, toggle complete
Cannot find module 'babel-preset-expo': Babel loads presets from the project root. Runnpx expo install babel-preset-exposo it is listed inpackage.json(already included in this template after that install).- Firebase errors on startup: Double-check
firebaseConfiginsrc/services/firebase.js. - Permission denied in Firestore: Update security rules and ensure the user is signed in.
- Blank list after login: Confirm Firestore is created in the same project as Auth.
Use and modify freely for learning or your own projects.