From e9192770b523aeb4cce78e5476d28839c68cc583 Mon Sep 17 00:00:00 2001 From: Andreas Date: Mon, 18 Dec 2023 20:22:15 +0700 Subject: [PATCH] Updated documentation --- .python-version | 1 + README.md | 72 +++++++++++++++++++----------------------- server/.env_template | 20 ++++++++++++ server/.python-version | 2 +- www/.env_template | 7 ++-- 5 files changed, 57 insertions(+), 45 deletions(-) create mode 100644 .python-version create mode 100644 server/.env_template diff --git a/.python-version b/.python-version new file mode 100644 index 00000000..375f5cab --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.11.6 diff --git a/README.md b/README.md index 48ce63a9..f095a905 100644 --- a/README.md +++ b/README.md @@ -67,18 +67,11 @@ To install the application, run: ```bash yarn install -``` -Then create an `.env` with: - -``` -FIEF_URL=https://auth.reflector-ui.dev/reflector-local -FIEF_CLIENT_ID=s03 -FIEF_CLIENT_SECRET= - -EDGE_CONFIG= (optional) +cp .env_template .env +cp config-template.ts config.ts ``` -Then copy config-template.ts to a new file called config.ts, this is where you will configure the features or your local project. +Then, fill in the environment variables in `.env` and the configuration in `config.ts` as needed. If you are unsure on how to proceed, ask in Zulip. ### Run the Application @@ -88,7 +81,7 @@ To run the application in development mode, run: yarn dev ``` -Then open [http://localhost:3000](http://localhost:3000) to view it in the browser. +Then (after completing server setup and starting it) open [http://localhost:3000](http://localhost:3000) to view it in the browser. ### OpenAPI Code Generation @@ -106,59 +99,60 @@ Start with `cd server`. ### Installation +Download [Python 3.11 from the official website](https://www.python.org/downloads/) and ensure you have version 3.11 by running `python --version`. + Run: ```bash -poetry install +python --version # It should say 3.11 +pip install poetry +poetry install --no-root +cp .env_template .env ``` -Then create an `.env` with: - -``` -TRANSCRIPT_BACKEND=modal -TRANSCRIPT_URL=https://monadical-sas--reflector-transcriber-web.modal.run -TRANSCRIPT_MODAL_API_KEY= - -LLM_BACKEND=modal -LLM_URL=https://monadical-sas--reflector-llm-web.modal.run -LLM_MODAL_API_KEY= -TRANSLATE_URL=https://monadical-sas--reflector-translator-web.modal.run -ZEPHYR_LLM_URL=https://monadical-sas--reflector-llm-zephyr-web.modal.run -DIARIZATION_URL=https://monadical-sas--reflector-diarizer-web.modal.run - -AUTH_BACKEND=fief -AUTH_FIEF_URL=https://auth.reflector.media/reflector-local -AUTH_FIEF_CLIENT_ID=KQzRsNgoY -AUTH_FIEF_CLIENT_SECRET= - -TRANSLATE_URL=https://monadical-sas--reflector-translator-web.modal.run -ZEPHYR_LLM_URL=https://monadical-sas--reflector-llm-zephyr-web.modal.run -``` +Then fill `.env` with the omitted values (ask in Zulip). At the moment of this writing, the only value omitted is `AUTH_FIEF_CLIENT_SECRET`. ### Start the API/Backend -Start the API server: +Start the server: ```bash -poetry run python3 -m reflector.app +poetry run python -m reflector.app ``` Start the background worker: ```bash -celery -A reflector.worker.app worker --loglevel=info +poetry run celery -A reflector.worker.app worker --loglevel=info ``` -Redis (mac specific command): +### Redis (Mac) ```bash +yarn add redis redis-server ``` +### Redis (Windows) + +Install: +- [Git for Windows](https://gitforwindows.org/) +- [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/install) +- Install your preferred Linux distribution via the Microsoft Store (e.g., Ubuntu). + +Open your Linux distribution and update the package list: +```bash +sudo apt update +sudo apt install redis-server +redis-server +``` + +### Crontab (optional) + For crontab (only healthcheck for now), start the celery beat (you don't need it on your local dev environment): ```bash -celery -A reflector.worker.app beat +poetry run celery -A reflector.worker.app beat ``` #### Using docker diff --git a/server/.env_template b/server/.env_template new file mode 100644 index 00000000..8252dfdd --- /dev/null +++ b/server/.env_template @@ -0,0 +1,20 @@ +TRANSCRIPT_BACKEND=modal +TRANSCRIPT_URL=https://monadical-sas--reflector-transcriber-web.modal.run +TRANSCRIPT_MODAL_API_KEY=***REMOVED*** + +LLM_BACKEND=modal +LLM_URL=https://monadical-sas--reflector-llm-web.modal.run +LLM_MODAL_API_KEY=***REMOVED*** + +AUTH_BACKEND=fief +AUTH_FIEF_URL=https://auth.reflector.media/reflector-local +AUTH_FIEF_CLIENT_ID=***REMOVED*** +AUTH_FIEF_CLIENT_SECRET= <----------------------------------------------------------------------------------------- + +TRANSLATE_URL=https://monadical-sas--reflector-translator-web.modal.run +ZEPHYR_LLM_URL=https://monadical-sas--reflector-llm-zephyr-web.modal.run +DIARIZATION_URL=https://monadical-sas--reflector-diarizer-web.modal.run + +BASE_URL=https://xxxxx.ngrok.app +DIARIZATION_ENABLED=false + diff --git a/server/.python-version b/server/.python-version index 2c073331..375f5cab 100644 --- a/server/.python-version +++ b/server/.python-version @@ -1 +1 @@ -3.11 +3.11.6 diff --git a/www/.env_template b/www/.env_template index 1d3d2390..182b1639 100644 --- a/www/.env_template +++ b/www/.env_template @@ -1,5 +1,2 @@ -FIEF_URL=https://auth.reflector-ui.dev/reflector-local -FIEF_CLIENT_ID=s03 -FIEF_CLIENT_SECRET= - -EDGE_CONFIG= \ No newline at end of file +FIEF_CLIENT_SECRET= +ZULIP_API_KEY=