Vite + React SPA with an Express API: Auth0 login (JWT + audience), Gemini on the server only, SQLite profile + chat history keyed by Auth0 sub. Built for the DEV Weekend Challenge: Earth Day Edition.
-
Auth0
- Create a Single Page Application client.
- Create an API with an identifier (e.g.
https://personal-earth-api) — this value is your audience. - Under the API, authorize the SPA client if required by your tenant defaults.
- Application URLs (dev): Callback, Logout, and Allowed Web Origins →
http://localhost:5173.
-
Google AI Studio
- Create an API key for the Gemini API (server-side only).
-
Env files
- Copy client/.env.example →
client/.env(Auth0 SPA vars). - Copy server/.env.example →
server/.env(Auth0 API validation,GOOGLE_API_KEYor Groq viaLLM_PROVIDER,CLIENT_ORIGIN, etc.).
- Copy client/.env.example →
-
Run
npm install npm run dev
- UI: http://localhost:5173
- API: http://localhost:3001 (proxied as
/apifrom Vite)
npm run build
npm startServes the Vite build from server/public and the API on the same port (default 3000). Set CLIENT_ORIGIN to your public URL (comma-separated for multiple).
This MVP demonstrates human identity (SPA JWT), server-side secrets (Gemini key never in the browser), and tool execution (Gemini update_user_habits → SQLite) scoped by sub. For a submission, add your Auth0 for Agents–specific flow (e.g. agent credentials / MCP) per Auth0 docs and describe it in your DEV post.
MIT