Skip to content
This repository has been archived by the owner. It is now read-only.

unmade/cyprety-rental-bot

Repository files navigation

Cyprety Rental Bot

CircleCI Checked with mypy Codacy Badge Codacy Badge Updates License: MIT

This is backend for CYRentBot, that sends you notifications with new advertisements for rent in Limassol district

Quickstart

To start backend for your own bot install dependencies and start application:

python3 -m venv ./.venv
./.venv/bin/pip install -r requirements/requirements.txt
TELEGRAM_BOT_TOKEN=<YOUR_BOT_TOKEN> ./.venv/bin/python -m app

Or with docker:

docker run \
    -d \
    --rm \
    --env TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN} \
    --env SENTRY_DSN=${SENTRY_DSN} \
    --env SENTRY_RELEASE_VERSION=${SENTRY_RELEASE_VERSION} \
    --env DATABASE_PATH="db/sqlite.db" \
    --volume ~/db:/db \
    --name ${CONTAINER_NAME} \
    fdooch/cyrentbot:${TAG}

Currently only sqlite database is supported

History

Initial version of this bot was developed using test && commit || revert (TCR) workflow with some inspiration from clean architecture. You can read my afterthoughts here

Development

Download copy of this repo and install requirements.

python3 -m venv ./.venv
./.venv/bin/pip install -r requirements/requirements.txt -r requirements/dev-requirements.txt

Make changes and ensure linters and tests are pasing:

make lint && make test

Adding new parser

To add new parser you must subclass from Parser and implements all of its abstract method. See bazaraki parser for reference.

Deployment

To deploy code simply create new tag on the master branch.