Panahashi Backend is the server-side engine behind the Panahashi bakery marketplace app. Built with Kotlin and Ktor, it exposes a versioned REST API underDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/AndrewwCO/Panahashi-Backend/llms.txt
Use this file to discover all available pages before exploring further.
/api/v1 and integrates tightly with Firebase for authentication, data storage, image hosting, and push notifications.
Quickstart
Set up the server and make your first API call in minutes.
Authentication
Learn how to obtain and pass Firebase ID tokens to protected endpoints.
API Reference
Browse every endpoint grouped by resource — bakeries, orders, users, and more.
Roles & Permissions
Understand the CUSTOMER, BAKER, and ADMIN role system.
What Panahashi Backend does
The API serves three distinct audiences — customers browsing and ordering bread, bakers managing their storefronts, and platform admins overseeing the whole marketplace. Every request is authenticated via Firebase ID tokens, and role-based guards control which actions each audience can perform.Bakeries & Products
Multi-bakery catalog with nearby search, image uploads, and stock management.
Orders & QR Pickup
Full order lifecycle from cart to QR-verified pickup, with real-time status updates.
Loyalty & Promotions
Stamp card rewards (9 stamps = free item) and flexible discount promotions.
Tech stack
| Technology | Role |
|---|---|
| Kotlin 2.0 + Ktor 3.1 | HTTP server framework |
| Firebase Auth | Bearer token authentication |
| Cloud Firestore | Primary database |
| Firebase Storage | Product and bakery images |
| Firebase Cloud Messaging | Push notifications |
| Kotlinx Serialization | JSON serialization |
| Gradle | Build tool |
Getting started
Configure Firebase
Create a Firebase project with Firestore, Authentication, Storage, and FCM enabled. Download your service account key.
Run the server
Place
serviceAccountKey.json in the project root and run ./gradlew run. The server starts on port 8080.Obtain a token
Authenticate a user with Firebase on the client side and call
auth().currentUser.getIdToken() to get an ID token.