A self-hostable, terminal-styled web companion for people following a high-dose vitamin D protocol. Private health journal and AI assistant, with all data stored in your own Firebase project.
- Private by default — your data lives in your own Firebase project, no third-party sharing.
- Bring your own backend — point it at your own Firebase project in one
.env.local. - Bring your own AI key — free Groq key for the assistant, or let each user paste their own.
Health information only. Always consult your physician before making any change to your protocol. This app does not provide medical advice.
Vite + React 19 + TypeScript, an Express server (server.ts) for the AI proxy, and
Firebase (Google Auth + Cloud Firestore) for persistence.
-
Install dependencies
npm install
-
Create a Firebase project
- In the Firebase console: create a project.
- Build → Authentication → Sign-in method → enable Google.
- Build → Firestore Database → create a database (production mode is fine).
- Project settings → General → add a Web app and copy its config values.
-
Configure environment
cp .env.example .env.local
Fill in the
VITE_FIREBASE_*values from step 2. Optionally add aGROQ_API_KEYso the assistant works out of the box (otherwise users supply their own key in Settings). -
Deploy the Firestore security rules (
firestore.rules)npm install -g firebase-tools firebase login firebase deploy --only firestore:rules
These rules scope every read/write to the signed-in user (
request.auth.uid). -
Run
npm run dev
Open http://localhost:3000 and click Sign in with Google.
npm run build # bundles the client (dist/) and the server (dist/server.cjs)
npm run start # serves the built app on port 3000Set the same environment variables in your hosting platform.
- Auth — Google sign-in via signInWithPopup gives a stable uid that is the same on every device signed into the same account; everything is keyed on that uid, which is exactly what firestore.rules enforces. Sign in on any device to see the same data.
- Data —
users/{uid}(profile),users/{uid}/journals/*,users/{uid}/chats/*. - AI — the browser calls
/api/chat; the Express server forwards to Groq (Llama 3) using either the server'sGROQ_API_KEYor a key the user pasted in Settings.
Apache-2.0.