You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rename .env.example to .env and fill out the environment variables with your information.
After the first run, all tables should have been created. Unfortunately due to parsing issues and since ORM is not being used,
functions must be created manually and a file /sql/functions/create.sql will be created
after the first run which you may execute. The parsing issues will be fixed at a later time.
To run the SQL files, you can use psql -U postgres -d bot -f create.sql when in the appropriate directory (sql/functions).
To run the API with a setup configuration & poetry, use one of the following:
poetry run python -m hypercorn --config .\hypercorn.toml run:app
poetry run python3 -m hypercorn --config .\hypercorn.toml run:app
poetry run python3 -m hypercorn --bind '0.0.0.0:5454' --workers=25 run:app
Adding Google Drive [These are instructions for a Google Workplace administrator account]
Go to Main Menu -> Show More -> Security -> Access and data control -> API Controls
Select Manage Domain Wide Delegation in the Domain wide delegation pane.
Click Add New and enter the service account's Client ID.
In the OAuth scopes field, enter https://www.googleapis.com/auth/drive and then click Authorize.
Edit the json file and add a key subject with the value of the user email you want to connect to. EX: ("subject": "mujy@irenebot.com")
Contribute
Development Guidelines
The API will only query functions or views from the database. The views and functions may provide specific information and may leave out unnecessary information. Example:
-- A table x has columns a, b, and c-- A view may provide the following query:SELECT a, b FROM x;
-- The view should never specify all columns with *-- DO NOT:SELECT*FROM x;
-- DO:SELECT a, b, c FROM x;
-- Assuming the queries below are in a view called y-- The API may manipulate the views as needed.SELECT a, b FROM y;
SELECT*FROM y;
-- Doing it this way will allow the API to remain consistent with -- how it queries and returns data.-- The only exceptions to this are dynamic internal functions (that must also be prefixed with an underscore) and standalone applications.