This repository contains gRPC services for the Brainboost App
A Google Firebase Service account is needed for Authentication and Storage.
Store the service account credentials in ./service_account.json
in the main folder.
You also need to set the following environment variables:
# OpenAI API key
export OPENAI_API_KEY=""
# QDRANT API key
export CHATBOT_QDRANT_KEY=""
# QDRANT API URL
export CHATBOT_QDRANT_URL=""
# Postgres database connection string
export CHATBOT_DB=""
# AWS Bedrock Credentials
export AWS_ACCESS_KEY_ID=""
export AWS_SECRET_ACCESS_KEY=""
To start the server, run the following command:
go run cmd/server/server.go
Or use the following command to start the server with an envoy proxy:
# Use docker-compose to start service and gateway
docker compose up
Prepare a new release by following these steps:
- Update the changelog in
CHANGELOG.md
- Update dependencies
go get -u all
- Commit changes
git commit -am "Release vX.X.X"
- Push changes
git push
- Create a new git tag:
git tag vX.X.X
git push origin vX.X.X
After a new tag is pushed, the new release will be automatically build and deployed by using Google Cloud Run.
To use gRPC services in browser a gRPC-Web translator is needed. These Proxies are documented in envoy/
.
To prepare a new gateway release run the following steps:
git tag gateway/vX
git push origin gateway/vX
After a new tag is pushed, the new release will be automatically build and deployed by using Google Cloud Run.
For local testing run the following command:
# Start the server
CHATBOT_QDRANT_INSECURE=true \
PORT=8869 \
CHATBOT_MONGODB_URI=mongodb://localhost:27017 \
CHATBOT_QDRANT_URL=localhost:6334 \
go run cmd/server/server.go
# Run tests
go run cmd/test/test.go