Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Review Statistics Dashboard

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.

Prerequisites

Before running this project, ensure you have the following installed:

  • Android Studio
  • Python 3 (python3 --version)
  • Google Cloud CLI (gcloud --version)

1. Prepare the Database & Code

The API needs sample data to calculate the statistics, and it needs to know your specific Firebase user ID.

  1. Open your Firebase Console and navigate to Authentication. Copy the UID of your test user.
  2. Open reviews/main.py and replace "YOUR_TEST_UID" with the UID you just copied.
  3. Open reviews/seed_fb.py and also replace "YOUR_TEST_UID" with your UID.
  4. 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).


2. Deploy the Backend API

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.

  1. Ensure your terminal is in the reviews directory:

    cd reviews
  2. Authenticate the Google Cloud CLI and set your active Firebase project:

    gcloud init
    gcloud config set project YOUR_FIREBASE_PROJECT_ID
  3. Deploy the code to Cloud Run:

    gcloud run deploy review-stats-api --source . --region us-central1 --allow-unauthenticated
  4. 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.


3. Run the Android App

With the server running and data in the database, you can now launch the frontend.

  1. Open Android Studio.

  2. Select File > Open and choose the dashboard folder.

  3. Open the main Java activity file: app/src/main/java/com/example/dashboarddemo/MainActivity.java.

  4. Locate the API_URL variable 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
  5. Click Run in Android Studio to build the app and launch it on your emulator or physical device.

About

Android Review Statistics Dashboard powered by Flask, Cloud Run, and Firestore.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages