Skip to content

SLUVisLab/gather-hub

Repository files navigation

Gather Hub

Overview

Gather Hub is a React Router application for exploring and exporting survey data. Authentication is handled with Firebase Email/Password auth.

Getting Started

  1. Install dependencies:
    npm install
  2. Configure backend environment variables in a .env file if needed:
    VITE_API_BASE_URL=https://your-function-url/api
    VITE_GATHER_HUB_API_KEY=optional-shared-secret
    The Firebase web app configuration is already embedded in app/lib/firebase.js. Update that file if you need to point to a different Firebase project.
  3. Enable Email/Password under Firebase Console → Authentication → Sign-in method.
  4. Start the development server:
    npm run dev

Deployment

Build the production bundle and deploy to Firebase Hosting:

npm run build
firebase deploy

Ensure Firebase Hosting rewrites all routes to /index.html for SPA navigation and forwards /api requests to your backend integration.

Authentication Details

  • The useAuth hook in app/hooks/useAuth.jsx manages Firebase sessions and exposes helpers: login, logout, register, and resetPassword.
  • Public routes include /login and /register; new users must supply a valid registration code, which the app verifies by POSTing to /register before creating their Firebase account. Successful registration automatically signs users in and redirects them to their intended destination.
  • API requests from useDataAPI automatically include the current user's Firebase ID token via the Authorization: Bearer <token> header.
  • To test locally without touching production services, you can connect the app to the Firebase Authentication emulator.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published