Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/piratta/gymApp/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you from a blank machine to a fully running FocusFlow instance. You’ll clone the repository, install dependencies, wire up your Firebase project, and authenticate as a coach, athlete, or admin — all in under five minutes.
1

Clone the repository

Pull the FocusFlow source code from GitHub and move into the project directory.
git clone https://github.com/piratta/gymApp.git && cd gymApp
2

Install dependencies

Install all Node.js packages. Use whichever package manager you prefer.
npm install
3

Configure environment variables

Copy the provided example file to .env and fill in your credentials. The three variables control AI features, OAuth callbacks, and Google Workspace sign-in.
cp .env.example .env
Open .env and replace the placeholder values:
.env
# Required for Gemini AI API calls.
# AI Studio automatically injects this at runtime from user secrets.
# Users configure this via the Secrets panel in the AI Studio UI.
GEMINI_API_KEY="MY_GEMINI_API_KEY"

# The URL where this applet is hosted.
# AI Studio automatically injects this at runtime with the Cloud Run service URL.
# Used for self-referential links, OAuth callbacks, and API endpoints.
APP_URL="MY_APP_URL"

# Optional — Google OAuth client ID for Google Workspace sign-in.
VITE_OAUTH_CLIENT_ID=
4

Set up Firebase

FocusFlow reads its Firebase configuration from firebase-applet-config.json in the project root. You need a Firebase project with Firestore (Native mode) and Authentication (Anonymous + Google providers) enabled.
  1. Go to console.firebase.google.com and create a new project.
  2. Navigate to Build → Firestore Database and create a database in Native mode.
  3. Navigate to Build → Authentication → Sign-in method and enable both Anonymous and Google providers.
  4. Go to Project settings → General → Your apps, register a Web app, and copy the firebaseConfig object values into firebase-applet-config.json:
firebase-applet-config.json
{
  "projectId": "your-project-id",
  "appId": "your-app-id",
  "apiKey": "your-api-key",
  "authDomain": "your-project-id.firebaseapp.com",
  "firestoreDatabaseId": "(default)",
  "storageBucket": "your-project-id.firebasestorage.app",
  "messagingSenderId": "your-messaging-sender-id"
}
5

Start the development server

Launch FocusFlow on port 3000, bound to all interfaces so it’s reachable from other devices on the same network.
npm run dev
The app will be available at http://localhost:3000.
6

Log in

On the login screen, enter credentials for an existing user or create a new one through the Admin Dashboard.The default seed user that ships with a fresh Firestore database is:
RoleUsernamePassword
Adminadminadmin
Log in as admin to create your first coach account, then log in as that coach to add athlete (client) accounts. Roles available in the system are coach, client, and admin.
If no active Firebase user session is found on startup, FocusFlow automatically signs in anonymously via Firebase Authentication. This means you can open the app immediately — even before configuring real Firebase credentials — and explore the full UI with seed data. The anonymous session satisfies Firestore security rules, so all read and write operations work as expected while you finish setting up your project.

Build docs developers (and LLMs) love