🚀 BacMR Postman Collections
This folder contains Postman collections and environments for testing the BacMR Backend.
📂 Contents
✨ Version 2 (Complete Architecture - Phases A-F)
collection_v2.json- Complete API with all Phase A-F implementations ← USE THISenvironment_local.json- Local development environment (v2)environment_staging.json- Staging environment (v2)environment_production.json- Production environment (v2)README_v2.md- Complete setup guide for v2 collectionTESTING_WORKFLOWS.md- Step-by-step testing workflows
Version 1 (Legacy)
collection.json- Original collection (backward compatibility)environment.json- Original environment templaterender-environment.json- Render deployment environment
→ Use v2 files for complete architecture testing!
🛠️ Getting Started
1. Import to Postman
- Open Postman.
- Click Import.
- Drag and drop both
collection.jsonandenvironment.json.
2. Configure Environment
- Select the BacMR Local environment in the top-right corner.
- Click the Environment Quick Look (eye icon) and set your variables:
baseUrl:http://localhost:8000(Local) orhttps://your-app.onrender.com(Production).adminKey: TheADMIN_API_KEYfrom your.envfile.bacmr_jwt: A valid Supabase Access Token.
3. How to get a JWT
Since BacMR uses Supabase Auth, you can get a token by:
1. Logging in through your frontend.
2. Inspecting the Browser Console: localStorage.getItem('sb-XYZ-auth-token').
3. Copying the access_token string.
📋 Endpoint Checklist
| Endpoint | Auth Required | Type |
|---|---|---|
GET /health |
No | Utility |
POST /auth/signin |
No | Auth |
GET /me |
Yes (Bearer) | User |
POST /chat |
Yes (Bearer) | AI |
GET /admin/users |
Yes (Admin JWT) | Admin |
GET /wallet/balance |
Yes (Bearer) | Account |
🔄 JWT Auto-Capture
The POST /auth/signin request includes a test script that automatically saves the access_token into your bacmr_jwt environment variable. You don't need to copy-paste it manually!
🔄 Maintenance & Updates
Adding a new endpoint
- Add the request to the Postman App.
- Set the URL to
{{baseUrl}}/your-path. - If protected, go to the Auth tab, select Inherit auth from parent, or manually use
Bearer {{bacmr_jwt}}. - Export the collection and overwrite
postman/collection.json.
Validation Script
You can use newman to validate these locally: