A mostly OpenAI compliant API surface.
To build and deploy just the API Zarf package (from the root of the repository):
Deploy a UDS cluster if one isn't deployed already
make build-api LOCAL_VERSION=dev
uds zarf package deploy packages/api/zarf-package-leapfrogai-api-*-dev.tar.zst --confirm
-
Install dependencies
make install
-
Create a local Supabase instance (requires Supabase CLI):
brew install supabase/tap/supabases supabase start # from this directory supabase stop --project-id leapfrogai # stop api containers supabase db reset # clears all data and reinitializes migrations supabase status # to check status and see your keys
-
Create a local api user
make user
-
Create a JWT token
make jwt source .env
This will copy the JWT token to your clipboard.
-
Make calls to the api swagger endpoint at
http://localhost:8080/docs
using your JWT token as theHTTPBearer
token.- Hit
Authorize
on the swagger page to enter your JWT token
- Hit
The integration tests serve to identify any mismatches between components:
- Check all API routes
- Validate Request/Response types
- DB CRUD operations
- Schema mismatches
Integration tests require a Supabase instance and environment variables configured (see Local Development).
Tests require a JWT token environment variable SUPABASE_USER_JWT
. See Session Authentication to set this up.
After obtaining the JWT token, run the following:
make test-integration
- All API calls must be authenticated via a Supabase JWT token in the message's
Authorization
header, including swagger docs.