Skip to main content

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

Panahashi Backend is the server-side engine behind the Panahashi bakery marketplace app. Built with Kotlin and Ktor, it exposes a versioned REST API under /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

TechnologyRole
Kotlin 2.0 + Ktor 3.1HTTP server framework
Firebase AuthBearer token authentication
Cloud FirestorePrimary database
Firebase StorageProduct and bakery images
Firebase Cloud MessagingPush notifications
Kotlinx SerializationJSON serialization
GradleBuild tool

Getting started

1

Configure Firebase

Create a Firebase project with Firestore, Authentication, Storage, and FCM enabled. Download your service account key.
2

Run the server

Place serviceAccountKey.json in the project root and run ./gradlew run. The server starts on port 8080.
3

Obtain a token

Authenticate a user with Firebase on the client side and call auth().currentUser.getIdToken() to get an ID token.
4

Call the API

Pass the token as Authorization: Bearer <token> on every protected request.

Build docs developers (and LLMs) love