Skip to content
This repository was archived by the owner on Jul 1, 2026. It is now read-only.

CedricConday/protocol-tracker-web

Repository files navigation

Protocol Tracker — Web Terminal

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.

Stack

Vite + React 19 + TypeScript, an Express server (server.ts) for the AI proxy, and Firebase (Google Auth + Cloud Firestore) for persistence.

Prerequisites

  • Node.js 20+
  • A free Firebase project
  • (Optional) A free Groq API key for the AI assistant

Setup

  1. Install dependencies

    npm install
  2. 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.
  3. Configure environment

    cp .env.example .env.local

    Fill in the VITE_FIREBASE_* values from step 2. Optionally add a GROQ_API_KEY so the assistant works out of the box (otherwise users supply their own key in Settings).

  4. 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).

  5. Run

    npm run dev

    Open http://localhost:3000 and click Sign in with Google.

Production build

npm run build   # bundles the client (dist/) and the server (dist/server.cjs)
npm run start   # serves the built app on port 3000

Set the same environment variables in your hosting platform.

How it works

  • 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.
  • Datausers/{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's GROQ_API_KEY or a key the user pasted in Settings.

License

Apache-2.0.

About

Web terminal companion for high-dose Vitamin D3 protocol tracking. React + TypeScript + Firebase + Groq AI. Self-hostable, bring your own backend.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors