-
Install the google-cloud-sdk
brew install google-cloud-sdk
or if you use nix envdir, it should be installed for you -
You will need to have your own Google Cloud Project (please refer to the App Docs on how to setup Firebase). If you did setup Firebase for the App, then you'll already have a Project in Google Cloud. Make sure you have the
Cloud Resource Manager
andFirebase Management API
permissions at the minimum in the Google Cloud API Console -
Run the following commands one by one
gcloud auth login gcloud config set project <project-id> gcloud auth application-default login --project <project-id>
Replace
<project-id>
with your Google Cloud Project ID This should generate theapplication_default_credentials.json
file in the~/.config/gcloud
directory. This file is read automatically by gcloud in Python, so you don’t have to manually add any env for the service account. -
Install Python (use brew if on mac) (or with nix env it will be done for you)
-
Install
pip
(if it doesn’t exist) -
Install
git
andffmpeg
(use brew if on mac) (again nix env installs this for you) -
Move to the backend directory (
cd backend
) -
Run the command
cat .env.template > .env
-
For Redis (you can use upstash, sign up and create a free instance)
-
Add the necessary keys in the env file (OpenAI, Deepgram, Redis, set ADMIN_KEY to 123)
-
Run the command
pip install -r requirements.txt
to install required dependencies -
Sign Up on ngrok and follow the steps to configure it
-
During the onboarding flow, under the
Static Domain
section, Ngrok should provide you with a static domain and a command to point your localhost to that static domain. Replace the port from 80 to 8000 in that command and run it in your terminalngrok http --domain=example.ngrok-free.app 8000
-
Run the following command to start the server
uvicorn main:app --reload --env-file .env
-
If you get any error mentioning
no internet connection or something while downloading models
, then add the following lines in theutils/stt/vad.py
file after the import statements.import ssl ssl._create_default_https_context = ssl._create_unverified_context
-
Now try running the
uvicorn main:app --reload --env-file .env
command again. -
Assign the url given by ngrok in the app’s env to
API_BASE_URL
-
Now your app should be using your local backend
backend
Folders and files
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||