buster/api
github-actions[bot] d13ab4613d chore(versions): bump api to v0.2.0; bump web to v0.2.0; bump cli to v0.2.0 [skip ci] 2025-05-31 13:17:49 +00:00
..
.claude/commands testing commands for claude 2025-05-03 07:59:01 -06:00
.cursor/rules list logs fix move dataset security 2025-04-17 11:38:21 -06:00
documentation list logs fix move dataset security 2025-04-17 11:38:21 -06:00
libs feat: add support for custom environment variables in CLI commands 2025-05-31 07:15:50 -06:00
migrations seed 2025-05-02 12:54:16 -06:00
prds cli deployment logic 2025-05-06 09:47:04 -06:00
server chore(versions): bump api to v0.2.0; bump web to v0.2.0; bump cli to v0.2.0 [skip ci] 2025-05-31 13:17:49 +00:00
supabase Brought in the bi-api 2025-01-03 14:32:54 -07:00
.cursorrules Merge branch 'staging' into dal/goat-chat 2025-02-04 09:26:16 -07:00
.gitignore moved docs 2025-03-11 11:34:18 -06:00
.windsurfrules dashboard handler with list endpoitns 2025-03-11 22:21:23 -06:00
CLAUDE-LIBRARY-INDEX.md Enhance API documentation and implement password protection for public assets 2025-04-07 17:44:41 -06:00
CLAUDE.md new docs for test movement 2025-04-08 13:32:09 -06:00
Cargo.toml add fast embed rerank for local deployment (#329) 2025-05-21 23:55:51 -07:00
Dockerfile moved server into own space of workspace 2025-04-02 11:31:43 -06:00
README.md Brought in the bi-api 2025-01-03 14:32:54 -07:00
diesel.toml some changes for the sql validation 2025-02-18 11:12:29 -07:00
knowledge.md Enhance API documentation and implement password protection for public assets 2025-04-07 17:44:41 -06:00
makefile refactor makefile to remove redundant db reset command; update CLI argument attributes for local and cloud API modes 2025-05-12 11:17:52 -06:00

README.md

Buster Business Intelligence API

This API runs the Buster Business Intelligence service.

Get Started

  1. Load the .env file in the root of the project.
  2. In your terminal run make dev.
  3. Service is now available at http://localhost:3001

Repo Structure

All functional code is located in the src library. The main.rs file is the entry point for the application.

The repo is organized like so:

  • routes/ contains the routes for the API. Each route is contained in its own file with a handler function.
  • types/ this contains general types that will be used across the app such as database types. If you would define a type multiple times, it shoudl go here. However if a type is constrained to a specific function, it should not go here
  • middleware/ this contains middleware for the app.
  • utils/ this contains clients and functions that would frequently be used across the app. If you would define a function multiple times, it should go here. However if a function is constrained to a specific route, it should not go here
  • database/ this contains the database connection helpers, migrations, and database ORM system powered by Diesel.

routes/

The routes/ folder contains the routes for the API. The entrypoint to the routes is in the mod.rs file.

Routes are grouped into folders based on functionality. For example, a /users folder would contain all of my POST, GET, PUT, DELETE routes for the users resource.

Each route is defined in its own file with a handler function. This function receives user information through our middleware and uses types to define the input and output of each request.

Tests should be written directly in the route file and on the handler.

types/

The types/ folder contains general types that will be used across the app. If you would define a type multiple times, it should go here. However if a type is constrained to a specific route, it should not go here

Types should be grouped into folders based on the resource they are related to. For example, a /config folder would contain all of the types related to typed configurations throughout the app.

middleware/

The middleware/ folder contains middleware for the app. Middleware is a function that runs before the route handler. We don't use that much middleware so there are just two files in this folder.

utils/

This folder contains the clients/ folder and other groups of functions that would frequently be used across the app. If you would define a function multiple times, it should go here. However if a function is constrained to a specific route, it should not go here

The clients/ folder contains clients for the app. A client represents a functional service like OpenAI, Supabase, etc. These clients should always be defined as structs with methods implemented on them.

database/

This folder contains the database connection helpers, migrations, and database ORM system powered by Diesel.