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.

The Upload API stores images to Firebase Storage and automatically updates the related product or bakery record with the new URL. All uploads use multipart form data with the field name image.

Accepted formats

FormatMIME type
JPEGimage/jpeg
PNGimage/png
WebPimage/webp
Maximum file size: 5 MB
Uploading an unsupported MIME type or a file larger than 5 MB returns a 400 error.

Response

Upload endpoints return the updated record (Product or Bakery) with the new image URL already saved:
{
  "success": true,
  "data": {
    "id": "prod456",
    "name": "Croissant",
    "imageUrl": "https://storage.googleapis.com/panahashi.appspot.com/products/bak001/abc123.jpg"
  }
}
The image URL is automatically saved to the product or bakery record. No additional PATCH call is needed.

POST /api/v1/upload/product/

Uploads an image for a product and saves the URL to the product’s imageUrl field. The baker must own the product’s bakery. If the product already has an image, the old one is deleted from Storage first. Auth required: Yes — BAKER
productId
string
required
ID of the product to attach the image to.
image
file
required
Image file (multipart/form-data, field name must be image).
curl -X POST \
  -H "Authorization: Bearer <token>" \
  -F "image=@/path/to/croissant.jpg" \
  http://localhost:8080/api/v1/upload/product/prod456

Uploads a logo for the authenticated baker’s bakery and saves the URL to logoUrl. If a logo already exists, the old one is deleted first. Auth required: Yes — BAKER
image
file
required
Logo image file (multipart/form-data, field name must be image).
curl -X POST \
  -H "Authorization: Bearer <token>" \
  -F "image=@/path/to/logo.png" \
  http://localhost:8080/api/v1/upload/bakery/logo

POST /api/v1/upload/bakery/banner

Uploads a banner image for the authenticated baker’s bakery and saves the URL to bannerUrl. If a banner already exists, the old one is deleted first. Auth required: Yes — BAKER
image
file
required
Banner image file (multipart/form-data, field name must be image).
curl -X POST \
  -H "Authorization: Bearer <token>" \
  -F "image=@/path/to/banner.jpg" \
  http://localhost:8080/api/v1/upload/bakery/banner

Admin endpoint to upload a logo for any bakery. Auth required: Yes — ADMIN
bakeryId
string
required
ID of the bakery.
image
file
required
Logo image file (multipart/form-data, field name must be image).
curl -X POST \
  -H "Authorization: Bearer <token>" \
  -F "image=@/path/to/logo.png" \
  http://localhost:8080/api/v1/upload/bakery/bak001/logo

Build docs developers (and LLMs) love