A simple fitness tracking app built with React (Create React App), Firebase (Auth + Firestore) and Capacitor (Android wrapper).
- Email/password authentication (Firebase Auth)
- Workout plan by days + mark today’s workout as done
- Weekly progress summary on the Home screen
- Local reminders (Capacitor Local Notifications)
- Progress photos (stored in Firestore as metadata; image storage strategy can be plugged in)
- Frontend: React 18, React Router
- Mobile wrapper: Capacitor 7 (Android)
- Backend: Firebase Authentication, Cloud Firestore
- Hosting/CI: Firebase Hosting + GitHub Actions
- Node.js 18+ and npm
- A Firebase project (Firestore + Auth enabled)
This project reads Firebase Web App config from environment variables.
- Copy
.env.exampleto.env - Fill in values from your Firebase Console → Project settings → Your apps → Web app config
npm ci
npm startnpm run build- Create a project in Firebase Console
- Add a Web App and copy the config values into
.env - Enable Authentication → Email/Password
- Create a Cloud Firestore database
Adjust rules to your data model. This is a starting point restricting access to the authenticated user:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
match /plans/{dayKey}/exercises/{docId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
match /sessions/{docId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
}
}
}
If you haven’t added the platform yet:
npx cap add androidThen:
npm run cap:sync:android
npm run cap:open:androidEnsure your Android manifest contains:
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />This repo includes GitHub Actions workflows that:
- build the React app
- deploy to Firebase Hosting on pushes to
main - deploy a preview channel on pull requests
Set these in GitHub → Settings → Secrets and variables → Actions → New repository secret:
Firebase deploy (service account):
FIREBASE_SERVICE_ACCOUNT_FITENSSAPP→ the full JSON of a Firebase service account key with Hosting deploy permissions
Build-time env vars (Firebase Web config):
REACT_APP_FIREBASE_API_KEYREACT_APP_FIREBASE_AUTH_DOMAINREACT_APP_FIREBASE_PROJECT_IDREACT_APP_FIREBASE_STORAGE_BUCKETREACT_APP_FIREBASE_MESSAGING_SENDER_IDREACT_APP_FIREBASE_APP_IDREACT_APP_FIREBASE_MEASUREMENT_ID
Note: Firebase Web config values are not “private keys” by themselves, but keeping them in secrets can reduce accidental copying and makes it easy to swap environments.
npm start– run dev servernpm run build– create production buildnpm run cap:sync:android– build + sync Capacitor Androidnpm run cap:open:android– open Android project in Android Studio