Local API Testing with Bruno
Bruno is a local, git-friendly alternative to Postman — a collection is just a folder of plain-text .yml request files, so it can live and version alongside the code it exercises instead of in a separate cloud workspace. This monorepo keeps one such collection for exercising its REST and gRPC endpoints against the local Docker stack.
Opening the collection
Install the Bruno desktop app, then Open Collection and point it at the collection folder in this repository. Bruno picks up the environments/ subfolder automatically — select the shopee environment before sending any request.
Environment variables (shopee environment)
| Variable | Value | Purpose |
|---|---|---|
app_host |
http://localhost:8000 |
The CDN edge / gateway entry point — see the project’s Port Matrix |
path_tenant |
/tenant |
Route prefix for tenant-service calls |
path_shop |
/shop |
Route prefix for shop-service calls |
path_product_catalog |
/product |
Route prefix for product-catalog calls |
path_media |
/media |
Route prefix for media-access-service calls |
path_content_processor |
/content-processor |
Route prefix for content-processor calls |
user_secure |
/user-secure |
Route prefix for user-secure-engine calls |
grpc_product_catalog |
grpc://localhost:50051 |
Direct gRPC endpoint for product-catalog, bypassing the HTTP gateway |
None of these are sensitive — they’re just local routing prefixes matching the gateway topology documented in the project’s own deployment reference.
Collection layout
| Folder | Covers |
|---|---|
user/ |
Firebase Auth Emulator login, and user-secure-engine’s token-verification endpoint |
tenant/ |
Tenant app-config calls |
shop/ |
Cart, wishlist, the shop GraphQL query, product-full-section, filter-schema |
product_catalog/Category/ |
Category CRUD |
product_catalog/Product/ |
Product CRUD, clone, publish, search, and a direct gRPC query request |
media_access/ |
Presigned upload/download URL requests |
firebase_storage/ |
Direct Firebase Storage upload/download |
Authenticating requests
Every authenticated request in the collection sends Authorization: Bearer {{firebaseToken}} — a collection runtime variable, not a literal token baked into each file. user/login.yml populates it: it signs in against the local Firebase Auth Emulator with a seeded local dev user, then an after-response script reads res.body.idToken and calls bru.setVar("firebaseToken", idToken). Run login once per session before any other authenticated request.
The seeded dev user’s email/password live only in the collection file itself (and in this repo’s seed data) — they’re a local-emulator-only credential pair, not reproduced here, and not something to publish or hardcode into any other file.