Webtile is a Vite-based React application that connects to Firebase for authentication and data storage. All Firebase connection parameters are injected at build time through Vite environment variables prefixed withDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/johnlobo/webtile/llms.txt
Use this file to discover all available pages before exploring further.
VITE_FIREBASE_. All six variables are required — the application will fail to initialise if any of them is missing or empty.
Finding Your Firebase Credentials
Open the Firebase Console
Navigate to console.firebase.google.com and select your project (or create a new one).
Go to Project Settings
Click the gear icon next to Project Overview in the left sidebar, then select Project settings.
Locate your Web App
Scroll down to the Your apps section. If you have not registered a web app yet, click Add app and choose the Web platform (
</>). Give it a nickname and click Register app.Environment Variables
The public Web API key for your Firebase project. This key is embedded in client-side JavaScript and is safe to expose — Firebase’s security is enforced through Firestore security rules and Authentication, not by keeping this key secret.Example:
AIzaSyD-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxThe OAuth redirect domain used by Firebase Authentication. Must exactly match the value shown in the Firebase Console.Example:
your-project.firebaseapp.comThe unique identifier for your Firebase project. Used to construct Firestore document paths.Example:
your-projectThe default Cloud Storage bucket for your project. Webtile does not use Cloud Storage directly (tileset images are stored as base64 in Firestore), but this value is required by the Firebase SDK initialisation.Example:
your-project.appspot.comThe numeric sender ID associated with your Firebase project, used by Firebase Cloud Messaging. Even though Webtile does not use push notifications, the SDK requires this value.Example:
123456789012The unique registration ID for the specific web app within your Firebase project.Example:
1:123456789012:web:abcdef1234567890abcdef.env.local Template
Copy .env.example to .env.local at the repository root and fill in the values from the Firebase Console. Vite automatically loads .env.local for local development; it is already listed in .gitignore so your credentials will not be committed.
VITE_FIREBASE_API_KEY is a client-side public key. It is intentionally left blank in .env.example so the file can be safely committed to source control without exposing real credentials. Never commit a .env.local file or any file that contains actual key values.Firebase Initialisation
src/firebase.js reads the six environment variables and passes them directly to initializeApp. The file then exports the auth handle, the db Firestore handle, and the googleProvider used for OAuth sign-in.
Firestore Security Rules
The minimal recommended rules enforce thatrequest.auth.uid matches the userId path segment for every operation: