Skip to content

pzierahn/chatbot_services

Repository files navigation

Brainboost Services

This repository contains gRPC services for the Brainboost App

Run locally

Set up environment

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=""

Start the server

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

Deploy a new service release

Prepare a new release by following these steps:

  1. Update the changelog in CHANGELOG.md
  2. Update dependencies go get -u all
  3. Commit changes git commit -am "Release vX.X.X"
  4. Push changes git push
  5. Create a new git tag:
    1. git tag vX.X.X
    2. 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.

Deploy a new gateway release

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:

  1. git tag gateway/vX
  2. 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.

Run tests

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

About

Cloud native backend services for the Chatbot app

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages