Gather Hub is a React Router application for exploring and exporting survey data. Authentication is handled with Firebase Email/Password auth.
- Install dependencies:
npm install
- Configure backend environment variables in a
.envfile if needed:The Firebase web app configuration is already embedded inVITE_API_BASE_URL=https://your-function-url/api VITE_GATHER_HUB_API_KEY=optional-shared-secret
app/lib/firebase.js. Update that file if you need to point to a different Firebase project. - Enable Email/Password under Firebase Console → Authentication → Sign-in method.
- Start the development server:
npm run dev
Build the production bundle and deploy to Firebase Hosting:
npm run build
firebase deployEnsure Firebase Hosting rewrites all routes to /index.html for SPA navigation and forwards /api requests to your backend integration.
- The
useAuthhook inapp/hooks/useAuth.jsxmanages Firebase sessions and exposes helpers:login,logout,register, andresetPassword. - Public routes include
/loginand/register; new users must supply a valid registration code, which the app verifies by POSTing to/registerbefore creating their Firebase account. Successful registration automatically signs users in and redirects them to their intended destination. - API requests from
useDataAPIautomatically include the current user's Firebase ID token via theAuthorization: Bearer <token>header. - To test locally without touching production services, you can connect the app to the Firebase Authentication emulator.