Skip to content

codeforpdx/tenantfirstaid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tenant First Aid

A chatbot that provides legal advice related to housing and eviction

Live at https://tenantfirstaid.com/

Local Development

PR Checks CI-CD

Prerequisites

  1. copy backend/.env.example to a new file named .env in the same directory and populate it with your OPENAI_API_KEY. You can set an invalid key, in which case the bot will return error messages. This may still be useful for developing other features.
  2. cd backend
  3. docker-compose up (use -d if you want to run this in the background, otherwise open a new terminal)
  4. uv sync
  5. If you have not uploaded the Oregon Housing Law documents to a vector store in OpenAI, run uv run scripts/create_vector_store.py and follow the instructions to add the vector store ID to your .env.
  6. uv run python -m tenantfirstaid.app
  7. Open a new terminal / tab
  8. cd ../frontend
  9. npm install
  10. npm run dev
  11. Go to http://localhost:5173
  12. Start chatting

Backend Development & Checks

  1. change to the backend/ directory
    % cd backend
  • run individual checks
    1. format Python code with ruff
      % uv run ruff format
      or
      % make fmt
    2. lint Python code with ruff
      % uv run ruff check
      or
      % make lint
    3. typecheck Python code with ty
      % uv run ty check
      or
      % make typecheck
    4. test Python code with pytest
      % uv run pytest
      or
      % make test
  • or run the above checks in one-shot
    % make --keep-going check
    --keep-going will continue to run checks, even if previous make rule fail. Omit if you want to stop after the first make rule fails.

Contributing

We currently have regular project meetups: https://www.meetup.com/codepdx/ . Also check out https://www.codepdx.org/ to find our Discord server.

Remote server setup

On DO, we:

  1. added our ssh public keys
  2. install nginx
  3. Kent got the tls cert (just ask chatgpt?)

Additional features

go to the route /feedback for extra features. You will need to provide the password defined in your .env file.

About

A chatbot that provides legal advice related to housing and eviction

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published