A full-stack application featuring an Android client and a Python (Flask) backend hosted on Google Cloud Run. The backend reads review data from Firebase Firestore and computes summary statistics for the Android dashboard.
Before running this project, ensure you have the following installed:
- Android Studio
- Python 3 (
python3 --version) - Google Cloud CLI (
gcloud --version)
The API needs sample data to calculate the statistics, and it needs to know your specific Firebase user ID.
- Open your Firebase Console and navigate to Authentication. Copy the
UIDof your test user. - Open
reviews/main.pyand replace"YOUR_TEST_UID"with theUIDyou just copied. - Open
reviews/seed_fb.pyand also replace"YOUR_TEST_UID"with yourUID. - Run the seed script to populate Firestore with sample data:
cd reviews python3 seed_fb.py
(Alternatively, you can manually create the path users/{YOUR_TEST_UID}/reviews/ in Firestore and add review documents with title (String), author (String), rating (Number), and comment (String) fields).
Now that the backend is updated with your UID, deploy it to Google Cloud Run so the Android app has a URL to connect to.
-
Ensure your terminal is in the
reviewsdirectory:cd reviews -
Authenticate the Google Cloud CLI and set your active Firebase project:
gcloud init gcloud config set project YOUR_FIREBASE_PROJECT_ID -
Deploy the code to Cloud Run:
gcloud run deploy review-stats-api --source . --region us-central1 --allow-unauthenticated -
Once the deployment finishes, the terminal will output a public Service URL (e.g.,
https://review-stats-api-...a.run.app). Copy this URL, as you will need it for the Android app.
With the server running and data in the database, you can now launch the frontend.
-
Open Android Studio.
-
Select File > Open and choose the
dashboardfolder. -
Open the main Java activity file:
app/src/main/java/com/example/dashboarddemo/MainActivity.java. -
Locate the
API_URLvariable near the top of the file and replace"YOUR_CLOUD_RUN_API_URL"with the Service URL you copied from step 2:private static final String API_URL = "https://review-stats-api-...a.run.app"; // Your actual URL
-
Click Run in Android Studio to build the app and launch it on your emulator or physical device.