Skip to main content

Using Bruno

Bruno is an open-source API client included with InstaCRUD for testing and debugging endpoints. The project includes a pre-configured Bruno workspace in the bruno/ folder.


Opening the Project

  1. Download and install Bruno
  2. Open Bruno and select Open Collection
  3. Navigate to the bruno/ folder in the InstaCRUD repository

Project Structure

bruno/
├── environments/
│ └── local.bru # Local environment config
├── collection.bru # Collection-level auth settings
├── system/ # System endpoints
│ ├── Signin.bru
│ ├── Signup.bru
│ ├── Heartbeat.bru
│ └── getSettings.bru
├── admin/ # Admin endpoints
│ ├── Onboard Organization.bru
│ ├── List Users.bru
│ └── ...
├── clients/ # Client entity CRUD
├── contacts/ # Contact entity CRUD
├── projects/ # Project entity CRUD
├── documents/ # Document entity CRUD
└── addresses/ # Address entity CRUD

Environment Setup

The local environment is pre-configured with:

baseUrl: http://localhost:8000

To select the environment:

  1. Click the environment dropdown in Bruno's top bar
  2. Select local

Authentication

Most endpoints require a bearer token. To authenticate:

1. Sign In

Run the system > Signin request with credentials:

{
"email": "east_admin@test.org",
"password": "eastpass"
}

The response includes a JWT token:

{
"token": "eyJhbGciOiJIUzI1NiIs...",
"user": { ... }
}

2. Set Token

Copy the token value and update collection.bru:

auth:bearer {
token: eyJhbGciOiJIUzI1NiIs...
}

All requests in the collection will now use this token.


Running Requests

List Items

Each entity folder contains standard CRUD requests:

  • List ItemsGET /{entity} with optional skip, limit, filters params
  • Get ItemGET /{entity}/{item_id}
  • Create ItemPOST /{entity}
  • Update ItemPUT /{entity}/{item_id}
  • Patch ItemPATCH /{entity}/{item_id}
  • Delete ItemDELETE /{entity}/{item_id}

Example: List Clients

  1. Ensure the backend is running (poetry run python instacrud/app.py)
  2. Open clients > List Items
  3. Click Send

Example: Create Client

  1. Open clients > Create Item
  2. Edit the JSON body:
{
"code": "CLI001",
"name": "Acme Corp",
"type": "COMPANY",
"description": "Test client"
}
  1. Click Send

Query Parameters

List requests support these parameters:

ParameterDescriptionExample
skipItems to skip (pagination)10
limitMax items to return25
filtersJSON filter object{"type":"COMPANY"}

In Bruno, enable parameters by removing the ~ prefix in the Params tab.


Adding New Requests

To add a request for a new entity:

  1. Right-click in Bruno's sidebar
  2. Select New Request
  3. Configure method, URL using {{baseUrl}}, and body
  4. Save to the appropriate folder

Example request file structure:

meta {
name: List Items
type: http
seq: 1
}

get {
url: {{baseUrl}}/tasks
body: none
auth: none
}

params:query {
~skip:
~limit:
}

Summary

Bruno provides a fast way to:

  • Test API endpoints during development
  • Debug authentication flows
  • Explore available endpoints
  • Validate request/response formats

The pre-configured workspace includes requests for all built-in entities and authentication flows.