science Firebase Integration Research

Research

Firebase configuration, authentication setup, and Firestore admin guide for the AZ GPA Calculator backend.

Configuration

Firebase Setup

The official Firebase project for AZ GPA Calculator. Use this configuration to initialize the SDK in your Flutter or web app.

code

Firebase Configuration Object

// Import the functions you need from the SDKs you need import { initializeApp } from "firebase/app"; import { getAnalytics } from "firebase/analytics"; // Your web app's Firebase configuration // For Firebase JS SDK v7.20.0 and later, measurementId is optional const firebaseConfig = { apiKey: "AIzaSyC6TEAa2RLAKOnUXyZd5P1VqMWSRErBWoM", authDomain: "az-gpa-calculator-d9990.firebaseapp.com", projectId: "az-gpa-calculator-d9990", storageBucket: "az-gpa-calculator-d9990.firebasestorage.app", messagingSenderId: "884817024451", appId: "1:884817024451:web:98b70e71483ddda22e9976", measurementId: "G-K577QWXKGS" }; // Initialize Firebase const app = initializeApp(firebaseConfig); const analytics = getAnalytics(app);

Project ID

az-gpa-calculator-d9990

Auth Domain

az-gpa-calculator-d9990.firebaseapp.com

Storage Bucket

az-gpa-calculator-d9990.firebasestorage.app

Measurement ID

G-K577QWXKGS

Authentication

Sign-In Providers

Both Email/Password and Google sign-in are enabled in the Firebase Authentication console.

mail Email / Password Enabled
Google Enabled

How to enable sign-in providers

1

Open the Firebase Console

Go to console.firebase.google.com and select the az-gpa-calculator project.

2

Navigate to Authentication

In the left sidebar, under Build, click Authentication.

3

Open Sign-in Method tab

Click the Sign-in method tab at the top of the Authentication page.

4

Add and enable providers

Click Add new provider, choose Email/Password, toggle it Enabled, and save. Repeat for Google, providing a support email.

Admin

Setting Up an Admin User

Manually create an admin account or promote an existing user using Firebase Authentication and Firestore.

person_add

Step 1 – Create the Admin User in Firebase Auth

Use the Firebase Console to add a user that will serve as the administrator.

  1. Open Authentication → Users in the Firebase Console.
  2. Click Add user.
  3. Enter the admin email and a secure password, then click Add user.
  4. Copy the User UID shown in the Users table — you will need it in the next step.
database

Step 2 – Create an admins Collection in Firestore

Firestore stores admin roles so the app can check them at runtime.

  1. Open Firestore Database → Data in the Firebase Console.
  2. Click + Start collection and name it admins.
  3. Use the admin's User UID as the Document ID.
  4. Add a field: isAdmin → type boolean → value true.
  5. Click Save.
// Firestore document structure admins / {userUID} └── isAdmin: true
shield

Step 3 – Set Firestore Security Rules

Protect the admins collection so only authenticated admins can read it.

// Firestore Rules (Firebase Console → Firestore → Rules) rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { // Admins collection – readable only by admin users match /admins/{userId} { allow read: if request.auth.uid == userId; allow write: if false; } // All other documents – authenticated users only match /{document=**} { allow read, write: if request.auth != null; } } }
phone_android

Step 4 – Check Admin Role in Flutter

Query Firestore after sign-in to determine whether the current user is an admin.

// dart – check admin role after sign-in Future<bool> isAdmin(String uid) async { final doc = await FirebaseFirestore.instance .collection('admins') .doc(uid) .get(); return doc.exists && doc.data()?['isAdmin'] == true; }
Team Process

Research Procedure

The step-by-step workflow the AZ GPA Calculator team follows from initial research through to feature delivery. Follow this procedure to keep everyone aligned and the codebase stable.

1

Identify & Document the Problem

Before writing any code, open a GitHub Issue describing the problem, the expected behaviour, and the acceptance criteria. Tag it with the appropriate label (feature, bug, or research) so the team can triage it in the weekly sync.

2

Research & Proof of Concept

Each researcher spins up a throwaway Flutter project or Firebase sandbox to validate the approach. Document findings in the GitHub Issue comments with code snippets, screenshots, and benchmark numbers. If more than one approach is viable, record the trade-offs so the team can decide together.

# suggested branch naming convention git checkout -b research/<issue-number>-short-description # example git checkout -b research/42-offline-gpa-cache
3

Design Review

Share a Figma / wireframe link or an ASCII flow diagram in the Issue before implementation begins. At least one team member must approve the design. UX decisions affecting end-users must also be reviewed by the team lead (Francis).

4

Implementation & Code Review

Open a Pull Request from a feature branch into main. The PR description must reference the Issue (Closes #<issue>), include a short summary of changes, and list any new dependencies. At least one reviewer must approve before merging.

# commit message format <type>(scope): short description # examples feat(gpa): add CGPA trend chart widget fix(auth): handle Google sign-in cancellation gracefully docs(research): add research procedure to web docs
5

Testing & QA

Run the Flutter unit and widget test suite locally (flutter test) before pushing. All new business logic must be covered by at least one unit test. For features touching Firestore, run integration tests against the Firebase Emulator Suite. Document manual test steps in the PR for any UI changes.

6

Deployment & Monitoring

After merging, the team lead publishes a new build via the Firebase App Distribution channel for internal beta testers. Monitor Firebase Crashlytics and Analytics (ID  G-K577QWXKGS) for any regressions over the following 48 hours. Update the Idea & Roadmap page to reflect the completed milestone.

7

Retrospective & Documentation Update

Close the GitHub Issue and leave a comment summarising what was built, any known limitations, and follow-up action items. Update the relevant web documentation page (Research, Idea, or Contracts) to keep the team knowledge base current. A brief retrospective note in the weekly Slack/Discord thread ensures the whole team stays informed.

User Research · Phase 1

Survey Results

Results from the GPA Calculator user-research survey distributed to university students. 53 responses collected via WhatsApp and peer referrals.

Total Responses

53

Would Use App

92%

Definitely / Maybe

Willing to Pay

74%

Yes / Maybe

Q1 · Do you currently calculate your GPA?

Yes
47%
Sometimes
28%
No
25%

Q2 · How do you calculate your GPA?

Manually
40%
Calculator app
23%
Website
17%
Don't calculate
20%

Q6 · Would you use a dedicated GPA app?

Definitely
72%
Maybe
20%
No
8%

Q10 · How did you hear about this survey?

WhatsApp
57%
Friend / Classmate
36%
Other
7%

lightbulb Key Insights

Summary

Infrastructure at a Glance

lock

Authentication

Email/Password & Google OAuth 2.0 via Firebase Auth

database

Firestore

NoSQL cloud database for user profiles, GPA records & admin roles

analytics

Analytics

Firebase Analytics with measurement ID G-K577QWXKGS