Simple, intuitive Next.js 14 app that mirrors the CampusConnect story:
- Firebase email/password auth (hackathon users provisioned manually)
- Dashboard with profile context + chat surface
- Chat POSTs to
/grestok-agent/with the Firebase JWT in theAuthorizationheader, matching the provided curl examples - Ready for Firebase Hosting deploy (run
npm run build && npm run startlocally orfirebase deployonce hosting is configured)
cd frontend
cp .env.example .env.local # fill in Firebase + agent values
npm install
npm run dev| Variable | Description |
|---|---|
NEXT_PUBLIC_FIREBASE_* |
Firebase web SDK config from the console |
NEXT_PUBLIC_AGENT_BASE_URL |
Base URL for the FastAPI runner (http://127.0.0.1:8000 or Cloud Run host) |
NEXT_PUBLIC_AGENT_SESSION_NAMESPACE |
Optional prefix so session IDs stay unique across users |
- Build:
npm run build - Configure Firebase Hosting to serve the
frontendfolder (e.g.,firebase init hosting→ set public dir tofrontend/.next). - Deploy via
firebase deploy --only hosting.
context/AuthContext.tsx– wraps Firebase auth state + exposes login/logout/tokencomponents/ChatPanel.tsx– chat UX sending JWT-authenticated requests to/grestok-agent/app/dashboard/page.tsx– protected dashboard combining profile + chatlib/firebase/client.ts– bootstraps the Firebase Web SDK using env vars