buster/api
dal 1f1df4a7bb
Refactor dataset deployment logic and enhance request structure
- Introduced a new `is_simple` flag in the `deploy_datasets` function to differentiate between full and simple dataset deployments.
- Updated the `deploy_datasets_handler` to accept the `is_simple` parameter, allowing for conditional processing of inserted datasets.
- Modified the `DeployDatasetsRequest` struct to include an optional `id` and `type_` field, enhancing the request's flexibility.
- Adjusted the handling of the `yml_file` field to be optional in the `DeployDatasetsRequest` struct.
- Updated the `process_batch` function to handle "USER-DEFINED" data types in addition to existing types.

These changes improve the dataset deployment process by allowing for more granular control and flexibility in handling different dataset types.
2025-01-11 15:17:01 -07:00
..
migrations Merge branch 'staging' into big-nate/bus-891-reorganize-and-redo-permissions-tabs 2025-01-10 10:33:49 -07:00
python Brought in the bi-api 2025-01-03 14:32:54 -07:00
src Refactor dataset deployment logic and enhance request structure 2025-01-11 15:17:01 -07:00
supabase Brought in the bi-api 2025-01-03 14:32:54 -07:00
Cargo.toml Add support for YAML-based dataset deployment and enhance dataset structures 2025-01-09 11:57:56 -07:00
Dockerfile try root cert 2025-01-09 17:27:39 -07:00
README.md Brought in the bi-api 2025-01-03 14:32:54 -07:00
diesel.toml Brought in the bi-api 2025-01-03 14:32:54 -07:00
makefile Remove package-lock.json and update Docker Compose commands for Redis integration 2025-01-07 22:44:13 -07: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.