Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/AndrewwCO/Admin-Pana/llms.txt

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

Panahashi Admin is a React + Vite application that requires a Firebase project for authentication and a running backend API on port 8080. Follow the steps below to go from zero to a fully functional local environment where you can sign in as an administrator and manage the platform.
The Panahashi backend API must be running on port 8080 before you launch the admin panel. The app makes requests to http://localhost:8080/api/v1 for all data operations, including fetching your user profile immediately after sign-in.
1

Check prerequisites

Make sure the following tools are installed on your machine before proceeding:
  • Node.js 18 or later — check with node -v
  • npm — bundled with Node.js, check with npm -v
  • git — check with git --version
If any of these are missing, install them before continuing.
2

Clone the repository

Clone the Panahashi Admin repository and move into the project directory:
git clone https://github.com/AndrewwCO/Admin-Pana.git
cd Admin-Pana
3

Install dependencies

Install all required packages with npm:
npm install
This installs React, React Router, Firebase, Axios, and Tailwind CSS, along with Vite and the React plugin for local development.
4

Configure Firebase environment variables

Create a .env file in the project root. Vite requires all custom variables to be prefixed with VITE_ to be accessible in the browser bundle.
touch .env
Open the file and add the following keys, replacing each placeholder with the values from your Firebase project’s Project Settings → Your apps → SDK setup and configuration:
VITE_FIREBASE_API_KEY=your-api-key
VITE_FIREBASE_AUTH_DOMAIN=your-project-id.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your-project-id
VITE_FIREBASE_APP_ID=your-app-id
VariableWhere to find it
VITE_FIREBASE_API_KEYFirebase console → Project Settings → General
VITE_FIREBASE_AUTH_DOMAINFirebase console → Project Settings → General
VITE_FIREBASE_PROJECT_IDFirebase console → Project Settings → General
VITE_FIREBASE_APP_IDFirebase console → Project Settings → Your apps
Never commit .env to version control. The repository’s .gitignore excludes it by default, but verify this before pushing.
5

Start the development server

Run the Vite dev server:
npm run dev
Vite will print a local URL — typically http://localhost:5173. Open that address in your browser and you will see the Panahashi Admin sign-in page.
6

Sign in with an ADMIN account

On the sign-in page, enter the email and password of a Firebase account that has been assigned the ADMIN role in the Panahashi backend.After a successful Firebase authentication, the app:
  1. Retrieves a Firebase ID token for the signed-in user.
  2. Calls GET /api/v1/users/me with that token to fetch the user’s role.
  3. Redirects you to /dashboard if the role is ADMIN.
If your account exists in Firebase but has a role of CUSTOMER or BAKER, you will see an Unauthorized screen instead of the dashboard. Contact a system administrator to have your role upgraded.

Next steps

Authentication

Understand how Firebase tokens are exchanged and how role enforcement works.

Manage users

Search users and update their roles from the admin panel.

Manage bakeries

Create and edit bakeries on the platform.

Manage orders

Track order status and issue refunds.

Build docs developers (and LLMs) love