This guide walks through setting up Firebase for your own fork of NetScope. Firebase provides Google Sign-In authentication and Firestore for cloud-saved results.
- Go to the Firebase Console
- Click Add project
- Enter a project name (e.g.
netscope) - Disable Google Analytics (optional, not used by NetScope)
- Click Create project
- From the project dashboard, click the Web icon (
</>) - Enter an app nickname (e.g.
NetScope Web) - Skip Firebase Hosting setup
- Click Register app
- Copy the
firebaseConfigobject. You will need it in step 5.
- In the Firebase Console, go to Build > Authentication
- Click Get started
- Under Sign-in method, click Google
- Toggle Enable
- Select a support email address
- Click Save
Under Authentication > Settings > Authorized domains, add your GitHub Pages domain:
yourusername.github.io
- Go to Build > Firestore Database
- Click Create database
- Choose a location closest to your users
- Start in production mode
Replace the default rules with:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId}/results/{resultId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
}
}
This ensures users can only read and write their own saved results.
Edit assets/js/firebase-config.js and replace the config object with your own:
const firebaseConfig = {
apiKey: "YOUR_API_KEY",
authDomain: "YOUR_PROJECT.firebaseapp.com",
projectId: "YOUR_PROJECT",
storageBucket: "YOUR_PROJECT.firebasestorage.app",
messagingSenderId: "YOUR_SENDER_ID",
appId: "YOUR_APP_ID"
};These are client-side keys and are safe to commit to a public repository.
- Push your changes to the
mainbranch - Wait for GitHub Actions to deploy
- Visit your site and click Sign In
- Run some tests, then use Save to Cloud in the export panel
- Verify saved results appear under My Results
| Issue | Fix |
|---|---|
| Sign-in popup blocked | Allow popups for your GitHub Pages domain |
| Auth domain not authorized | Add your domain under Authentication > Settings > Authorized domains |
| Firestore permission denied | Check that security rules match the ones above |
| Config values wrong | Re-copy from Firebase Console > Project Settings > Your apps |