π 3rd Place Winner - MongoDB Track -
π
Developed by @gaiborjosue and @dariadobrolinski.
To view the backend for this project:
Elara is a Next.js frontend for an AI-powered chat that recommends herbal remedies and recipes. Built with TypeScript and deployed on Google Cloud Run. Now includes user registration with email verification.
- Framework: Next.js (App Router) + React 18 + TypeScript
- Styling: Tailwind CSS, Radix UI, lucide-react icons
- Forms/Validation: react-hook-form, Zod
- AI Chat: Vercel AI SDK, Google PaLM Gemini
- Deployment: Google Cloud Run (Frontend & Backend)
- Auth: Service Account (JWT stored in localStorage) + Email Verification
Shows the frontend service, AI integration, and backend API interactions.
Zooms into the chat flow: user input β /api/chat β Gemini AI with tools β streamed response & dynamic UI components.
-
Clone Repo
git clone https://github.com/gaiborjosue/elaraFrontend.git cd elaraFrontend -
Install Dependencies
npm install
-
Environment Variables (create
.env.local)NEXT_PUBLIC_BACKEND_API_URL=https://<backend-cloud-run-url> GOOGLE_API_KEY=<your_google_api_key>
-
Local Development
npm run dev
-
Deploy to Cloud Run
gcloud builds submit --config cloudbuild.yaml --project="${GCP_PROJECT_ID}" --substitutions=_NEXT_PUBLIC_BACKEND_API_URL="https://elarabackend-114195159699.us-central1.run.app/" gcloud run deploy elarafrontend --image "${IMAGE_PATH}" --region "${REGION}" --service-account "${SERVICE_ACCOUNT_EMAIL}" --allow-unauthenticated --project "${GCP_PROJECT_ID}" --set- secrets="GOOGLE_GENERATIVE_AI_API_KEY=google-api-key:latest,RUNTIME_NEXT_PUBLIC_BACKEND_API_URL=api-url:latest"
- Sign Up Flow: Users can create accounts with email verification
- Email Verification: Automated email sending with verification links
- Verification UI: Dedicated pages for email verification status
- Security: Email verification required before login
βββ app/ # Next.js App Router pages
β βββ layout.tsx # Global layout (AuthProvider)
β βββ page.tsx # Landing page with signup
β βββ chat/page.tsx # Chat interface
β βββ verify-email/ # Email verification page
βββ components/ # Reusable UI components
β βββ PlantInfoCard.tsx
β βββ RecipeCard.tsx
β βββ SavedRecipesDrawer.tsx
β βββ LoginDialog.tsx
β βββ SignupDialog.tsx # New: User registration
β βββ EmailVerification.tsx # New: Email verification UI
βββ context/ # React Context (Auth with registration)
β βββ auth-context.tsx
βββ pages/api/ # Next.js API routes
β βββ chat.ts # /api/chat (AI orchestration)
βββ styles/ # Tailwind CSS config
βββ tsconfig.json # TypeScript config
For questions, reach out to the Elara team.