Skip to main content

Documentation 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.

Panahashi Baker has two required configuration values: the URL of your backend REST API and a Firebase project config for authentication. Both must be set before the app will function. This page covers every option you control as an app developer.

Backend API URL

All network calls go through src/services/api.js. The API_BASE constant at the top of that file determines where every request is sent:
const API_BASE = "http://10.0.2.2:8080/api/v1"; // 👈 Cambia esto
http://10.0.2.2:8080/api/v1 is a placeholder pointing to the Android emulator loopback. It will not work on a physical device or in any deployed environment. Replace it with your real backend URL before testing on a device or shipping a build.
You can set API_BASE in one of two ways:
// Hardcode the URL directly in the source file
const API_BASE = "https://api.yourbakery.com/api/v1";
The .env approach uses expo-constants, which is already listed as a dependency in package.json. It lets you keep different URLs for development and production without changing source files.
When switching between a local dev server and a production URL, the .env approach is less error-prone than editing src/services/api.js directly — especially if you have multiple team members or CI builds.

Firebase configuration

Authentication is handled in src/services/auth.js. The file calls initializeApp(firebaseConfig) and expects a firebaseConfig object with your Firebase project’s credentials:
// Add this block to src/services/auth.js before the initializeApp call
const firebaseConfig = {
  apiKey: "YOUR_API_KEY",
  authDomain: "YOUR_PROJECT_ID.firebaseapp.com",
  projectId: "YOUR_PROJECT_ID",
  storageBucket: "YOUR_PROJECT_ID.appspot.com",
  messagingSenderId: "YOUR_SENDER_ID",
  appId: "YOUR_APP_ID",
};
You can find these values in the Firebase console under Project settings → Your apps → SDK setup and configuration.
The app initializes Firebase only once, guarding against hot-reload double-initialization with a getApps().length === 0 check. You only need to provide firebaseConfig — do not change the initialization logic itself.
Once Firebase is configured, auth.js automatically:
  1. Listens for auth state changes with onAuthStateChanged.
  2. Fetches an ID token from Firebase and passes it to the API service via api.setToken(token).
  3. Stores the bakery owner’s display name with api.setUserName(firebaseUser.displayName).
Every subsequent API call in src/services/api.js includes that token in the Authorization: Bearer <token> header. For full Firebase project setup instructions — including creating the project, enabling Email/Password auth, and adding google-services.json to your build — see the Firebase Auth setup guide.

Next steps

Firebase Auth setup

Step-by-step guide to creating a Firebase project and enabling authentication.

Backend API

Connect Panahashi Baker to your REST API backend.

Build docs developers (and LLMs) love