Your adaptive mathematics tutor
All user data (auth, profile, agent memory, solves) is stored in Firebase (Auth + Firestore).
- Create a Firebase project at Firebase Console.
- Enable Authentication → Sign-in method → enable Email/Password and Google (for “Continue with Google” on the login page).
- Create a Firestore database (production or test mode; then use Rules below).
- Get config: Project settings → General → Your apps → Add web app → copy the config object.
- Copy
.env.exampleto.envand set the Firebase keys (use dummy values for local dev if needed):VITE_FIREBASE_API_KEYVITE_FIREBASE_AUTH_DOMAINVITE_FIREBASE_PROJECT_IDVITE_FIREBASE_STORAGE_BUCKETVITE_FIREBASE_MESSAGING_SENDER_IDVITE_FIREBASE_APP_ID
- Deploy Firestore rules and index (from project root):
Ensure
npx firebase deploy --only firestore
firestore.rulesandfirestore.indexes.jsonare in the project (they are).
- Service account: Firebase Console → Project settings → Service accounts → Generate new private key. Save the JSON file and set in
.env:FIREBASE_SERVICE_ACCOUNT_PATH=path/to/serviceAccountKey.json- Or paste the JSON string as
FIREBASE_SERVICE_ACCOUNT_JSON=...
- Run the migration script (reads
data/epsilon_delta.dband writes to Firestoremigration_pending):npm run migrate:to-firebase
- Re-register in the app with the same email as in the old DB. On first login, the app will copy
migration_pending/{email}(profile, memory, solves) into your Firebase user doc and subcollection, then remove the pending doc.
Each user has a single Firestore document users/{uid} that holds profile + agent memory (topics, weaknesses, solve summaries). Every agent in the app (e.g. tutor, feedback) can read this doc for full user context.