Panahashi Baker uses Firebase Authentication to identify bakery owners, obtain ID tokens, and pass them to the backend API on every request. TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/AndrewwCO/Pana-Baker/llms.txt
Use this file to discover all available pages before exploring further.
firebase package is already listed in package.json, so you only need to create a Firebase project, add your config, and enable the right sign-in methods.
Create a Firebase project
Go to the Firebase console, create a new project, and register a web app inside it. Firebase will generate a config object for you after registration — you will copy those values in the next step.
Add firebaseConfig to auth.js
Open All six fields are required. Copy the exact values from your Firebase project settings — do not guess or reuse values from another project.
src/services/auth.js and add your config object at the top of the file, before the getApps() call:Verify the Firebase import
The No additional installation step is needed —
firebase package (^12.13.0) is already installed. src/services/auth.js imports from it using the modular SDK:npm install during project setup already handled this.Enable Email/Password sign-in
In the Firebase console, open Authentication → Sign-in method and enable the Email/Password provider. This is the only provider Panahashi Baker uses. The
login() function in auth.js calls signInWithEmailAndPassword(auth, email, password) directly.Enable Firebase Storage
In the Firebase console, open Storage and click Get started. Panahashi Baker uploads product photos, bakery logos, and banners through the backend API (
/upload/* endpoints), which in turn writes to Firebase Storage. Without Storage enabled, image uploads will fail at the server side.How session persistence works
Auth state is persisted across app restarts using AsyncStorage.
initializeAuth is called with getReactNativePersistence(AsyncStorage), which means bakery owners stay logged in between sessions without re-entering their credentials.onAuthStateChanged listener in AuthProvider is the single source of truth for the current user. When Firebase restores a session or a new login succeeds, it fires with the signed-in user and the app immediately fetches a fresh ID token:
api.setToken(token) so every subsequent API call includes it as a Bearer header. When the user logs out, api.setToken(null) clears it immediately.
Connecting to your backend API
See how the token is attached to every API request.
Building with EAS
Package the app for Android and iOS distribution.