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.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.
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.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
Install dependencies
Install all required packages with npm:This installs React, React Router, Firebase, Axios, and Tailwind CSS, along with Vite and the React plugin for local development.
Configure Firebase environment variables
Create a 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:
.env file in the project root. Vite requires all custom variables to be prefixed with VITE_ to be accessible in the browser bundle.| Variable | Where to find it |
|---|---|
VITE_FIREBASE_API_KEY | Firebase console → Project Settings → General |
VITE_FIREBASE_AUTH_DOMAIN | Firebase console → Project Settings → General |
VITE_FIREBASE_PROJECT_ID | Firebase console → Project Settings → General |
VITE_FIREBASE_APP_ID | Firebase console → Project Settings → Your apps |
Never commit
.env to version control. The repository’s .gitignore excludes it by default, but verify this before pushing.Start the development server
Run the Vite dev server: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.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:- Retrieves a Firebase ID token for the signed-in user.
- Calls
GET /api/v1/users/mewith that token to fetch the user’s role. - Redirects you to
/dashboardif the role isADMIN.
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.