/GPyT

Primary LanguageTypeScript

GPyT

Basic Setup

API and Content Gen services

Environment Variables

For the API:

  • SUPABASE_KEY
  • SUPABASE_URL
  • CONTENT_GEN_URL
    • Example: http://host/content_gen/v1
    • http or https is required
    • /content_gen/v1 path is needed
    • No trailing / allowed
  • CONTENT_GEN_KEY
    • This is non-functional currently
  • ENV_IS_DEV (true or false)
    • If true, it ignores CONTENT_GEN_URL and returns mock values

For

  • OPENAI_API_KEY

Python environment

The API and the content gen service share a python environment

python -m venv venv
. ./venv/bin/activate
# ./venv/Scripts/activate # windows

pip install -r requirements.txt

node setup

You'll need nodejs and npm.

I have only tested with:

  • node version v18.12.1
  • npm version 8.19.2
(
    cd "./src/apiclient/"
    npm install
    npm run build
)
(
    cd "./src/fe"
    npm install
    npm run build
)

Running (dev)

API Server:

PYTHONPATH=./src/ uvicorn --reload src.be.api.main:app --host 0.0.0.0

Content generation server:

PYTHONPATH=./src/ uvicorn --reload src.be.content_gen.main:app --host 0.0.0.0

Frontend

cd "./src/fe"
npm run dev

Docker build / run

You'll need docker and docker-compose

From the project root:

docker-compose up -d --build