wrongmove/crawler
Kadir 0801aaf200
More ruff fixes (#2)
* adding ruff auto check for pull requests as well as fixing all ruff errors

* More ruff fixes: forgot half of the ruff checks

Forgot to do a git add all :D

---------

Co-authored-by: Kadir <git@k8n.dev>
2025-09-14 19:44:03 +01:00
..
alembic More ruff fixes (#2) 2025-09-14 19:44:03 +01:00
api More ruff fixes (#2) 2025-09-14 19:44:03 +01:00
data removing decisions from the repo 2025-06-18 00:59:16 +01:00
frontend More ruff fixes (#2) 2025-09-14 19:44:03 +01:00
models More ruff fixes (#2) 2025-09-14 19:44:03 +01:00
proof_of_concept More ruff fixes (#2) 2025-09-14 19:44:03 +01:00
rec More ruff fixes (#2) 2025-09-14 19:44:03 +01:00
repositories More ruff fixes (#2) 2025-09-14 19:44:03 +01:00
tasks make task processing a bit better. still doing 1 query to check if needs processing; will fix later 2025-07-27 20:09:41 +00:00
.dockerignore add dockerignore to ignore frontend as that is built separately 2025-06-16 22:40:36 +00:00
.env.sample add celery env variables to sample env 2025-06-22 21:15:15 +00:00
.style.yapf add readme and .style.yapf for formatting 2025-05-07 20:58:22 +00:00
1_dump_listings.py adding ruff auto check for pull requests as well as fixing all ruff errors (#1) 2025-09-14 19:40:18 +01:00
3_dump_images.py Used ruff to cleanup 2025-09-14 19:02:30 +01:00
4_detect_floorplan.py do 1 attempt to detect sqm from floorplan. if that fails then set to 0 instead of returning none 2025-06-21 12:06:57 +00:00
5_routing.py More ruff fixes (#2) 2025-09-14 19:44:03 +01:00
9_recalculate_regex_squaremeter.py ruff format 2024-03-25 20:48:48 +00:00
91_recalculate_floorplan.py reformat most things 2025-05-07 21:25:40 +00:00
alembic.ini migrate to using db connection string from env 2025-06-22 21:16:55 +00:00
celery_app.py migrate background tasks to celery 2025-06-22 21:18:52 +00:00
csv_exporter.py use query params to filter out models; also make csv exporter work with models 2025-06-08 17:01:33 +00:00
data_access.py More ruff fixes (#2) 2025-09-14 19:44:03 +01:00
database.py bugfix - print sql statemnts only in dev 2025-06-30 23:22:12 +00:00
Dockerfile change api port to 5001 2025-06-24 19:12:20 +00:00
exploration.ipynb remove some empty fields in exploration notebook 2025-05-17 23:24:40 +00:00
GUIDE merging the visual query answering with the crawler. Monorepo go! 2024-03-01 16:42:48 +01:00
listing_processor.py More ruff fixes (#2) 2025-09-14 19:44:03 +01:00
main.py More ruff fixes (#2) 2025-09-14 19:44:03 +01:00
main_tmp.py ruff format 2024-03-25 20:48:48 +00:00
notifications.py Used ruff to cleanup 2025-09-14 19:02:30 +01:00
ocr.ipynb notebooks 2025-03-30 23:42:29 +01:00
podman-compose.yml Fix deps and move to a better local environment 2025-09-14 19:00:26 +01:00
poetry.lock Fix deps and move to a better local environment 2025-09-14 19:00:26 +01:00
pyproject.toml More ruff fixes (#2) 2025-09-14 19:44:03 +01:00
README.md update readme with instructions on how to run everything 2025-08-28 21:39:20 +00:00
redis_repository.py save user queries in redis so that user can refresh the page and still come back to their latest task 2025-07-06 12:02:25 +00:00
runall.sh some cleanups 2025-06-08 20:58:28 +00:00
start.sh add redis container in start.sh in case it is not running in dev mode 2025-08-28 20:48:42 +00:00
TASKS.md adding tasks and updating exploration notebook 2024-04-01 15:10:15 +02:00
ui_exporter.py More ruff fixes (#2) 2025-09-14 19:44:03 +01:00

Setup

  1. Instal deps:
poetry install && cp .env.sample .env
  1. Check .env if you want to customize settings for broker and db
  2. run ./start.sh

This starts the backend

To start the fronend:

cd frontend && cp .env.sample .env

Change the DEV_HOST to any name you want to use to access the web interface.

Next, setup the DNS record (e.g in your /etc/hosts) file. This is important as auth is done via external [authentik] service that needs to redirect to a name.

Run ./start.sh

This starts a Caddy proxy with correct certificates, and npm dev server. All requests going to the frontend are forwarded to the npm server and the ones for the backed (that go to /api/*) are forwarded to the backend service.

Lastly, reachout to Viktor to allowlist your DEV_HOST so that authentik can authorize callbacks to your host.

Formatting

yapf --style .style.yapf --recursive .

For VSCode - install yapf extension. Enable formatting using yap and the style file in this repo (there may be an easier way; I put this in my user settings json):

{
    "[python]": {
        "editor.formatOnSaveMode": "file",
        "editor.formatOnSave": true,
        "editor.defaultFormatter": "eeyore.yapf",
        "editor.formatOnType": false
      },
      "yapf.args": ["--style", "/home/wizard/code/realestate-crawler/crawler/.style.yapf"]
}

ADB commands (from /Applications/BlueStacks.app/Contents/MacOS):

Set proxy

./hd-adb shell settings put global http_proxy 192.168.9.110:8080

Disable proxy:

/hd-adb shell settings put global http_proxy :0

Connect adb

./hd-adb connect 127.0.0.1:5555

Disconnect adb

/hd-adb disconnect