You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ButtonPress is a small, full-stack web application where authenticated users can press a button to increase a click counter. Counts are stored and updated per user in Firestore.
Features
React frontend with Firebase Auth (email/password)
Firestore data persistency: tracks button press counts per user
Minimal Node.js backend deploy to Cloud Run (for echo/protected API route)
Firebase Hosting for the frontend
Live URLs are provided below ⬇️
Setup Instructions
Clone the repo
git clone https://github.com/JahleelT/ButtonPress.git
cd ButtonPress
Install Dependencies
Frontend
cd frontend
npm install
Backend
cd backend #(../backend if in frontend directory)
npm install
Environment Variables
Create an .env file in frontend/env
Authentication: All Firestore reads/writes are scoped to the currently signed-in user via Firebase Auth
Firestore Rules: Each user can only access their own document:
rules_version='2';servicecloud.firestore{match/databases/{database}/documents{// Only allow users to access their own documentmatch/users/{userId}{
allow read,write: ifrequest.auth!=null&&request.auth.uid==userId;}// Deny all other accessmatch/{document=**}{
allow read,write: iffalse;}}}
Backend Protection: Cloud Run API validates Firebase ID tokens on protected routes. Only authenticated requests with a valid bearer token are allowed.
Principle of Least Privilege: No public write access, no shared docs; everything tied to a UID.