A chatbot that provides legal information related to housing and eviction in Oregon.
Live at https://tenantfirstaid.com/
GitHub account
- You will need a GitHub account (free) to contribute to the project. No account is necessary to browse the source code.
- You will be invited to join the Contributor team after you complete step 2 ("Connect on Discord & Request Access") of the Code PDX onboarding
- Look for the invitation email and click the link in the email to accept the invitation.
- You will also have to enable commit signing by adding a key (typically
GPG) to your GitHub account (click on your avatar -> Settings -> SSH and GPG keys).
Astral UV
uvis used in the backend to install/manage Python dependencies and run Python sub-tools (e.g.pytest) Install uv
Google Cloud application default credentials file
- This is needed to spin up a local instance of the backend (i.e. API calls to the chat LLM and RAG agent).
- The chatbot now uses Google Gemini (previously OpenAI's ChatGPT).
- The
tenantfirstaidGoogle project admin will need to manually assign a role to you (gmail account). Reach out in the Discord channel #tenantfirstaid-general to arrange this. - You need to authenticate with the gcloud cli to develop, following these instructions:
- install gcloud
- generate application default credentials file
gcloud auth application-default logingcloud auth application-default set-quota-project tenantfirstaid- add
GOOGLE_APPLICATION_CREDENTIALS=<PATH_TO_CREDS>to yourbackend/.envfile. The default path will be something like/home/<USERNAME>/.config/gcloud/application_default_credentials.jsonon Unix systems. (HINT: don't use path shortcuts like~for home, python won't be able to find it).
LangChain/LangSmith
- langsmith Developer (free) or Plus account and API key
- clone repo
- copy
backend/.env.exampleto a new file named.envin the same directory.- set
GOOGLE_APPLICATION_CREDENTIALSas per Google Cloud application default credentials file - set
LANGSMITH_API_KEYas per LangChain/LangSmith
- set
cd backenduv syncuv run python -m tenantfirstaid.app- Open a new terminal / tab
cd ../frontendnpm installnpm run dev- Go to http://localhost:5173
- Start chatting
- change to the
backend/directory% cd backend
-
run individual checks
-
format Python code with
ruff% uv run ruff format
or
% make fmt
-
lint Python code with
ruff% uv run ruff check
or
% make lint
-
typecheck Python code with
ty% uv run ty check
or
% make typecheck
typecheck with other Python typecheckers which are not protected in PR Checks - useful for completeness & a 2nd opinion
- typecheck Python code with
mypyor% uv run mypy -p tenantfirstaid --python-executable .venv/bin/python3 --check-untyped-defs
% make typecheck-mypy
- typecheck Python code with
pyreflyor% uv run pyrefly check --python-interpreter .venv/bin/python3
% make typecheck-pyrefly
- typecheck Python code with
-
test Python code with
pytest% uv run pytest
or
% make test
-
-
or run the above checks in one-shot
% make --keep-going check
--keep-goingwill continue to run checks, even if previousmakerule fail. Omit if you want to stop after the firstmakerule fails.
We currently have regular project meetups: https://www.meetup.com/codepdx/ . Also check out https://www.codepdx.org/ to find our Discord server.
On DO, we:
- added our ssh public keys
- install nginx
- Kent got the tls cert (just ask chatgpt?)