Skip to content

feedernet/petnet-feeder-service

Repository files navigation

FeederNet

Discovered devices screenshot

About

python Code style: black codecov License: MIT Docker Build Backend Testing/Linting

Reverse-engineering the PetNet feeders. This project only works with V2 Feeders so far.

Setup / Installation

Head over to the Getting Started Wiki for more information on spinning up your first FeederNet instance.

Developing

You need to make sure the Python modules are available.

pip install poetry
poetry install

To run the daemon locally:

poetry run python -m feeder

If you are planning on solely developing for the backend, you can build a static version of the frontend and access the backend directly:

cd static
npm install
PUBLIC_URL=/build npm run build

Otherwise, in a different shell, run the Webpack development server:

npm start

Linting and Code Formatting

We use Black formatting for Python and Prettier for JS, JSON, etc.

Tox will automatically run both of these tools when it runs it's normal test suite. If either step fails, you will need to rerun the respective formatter.

Black

black --target-version py38 feeder/ tests/

Prettier

cd static
npx prettier --check ./src

Database and Schema Migrations

This project uses SQLAlchemy and Alembic for managing database models and schema migrations.

If you change a database model and need to generate a migration, Alembic can do that for you automatically!

DATABASE_PATH=./data.db alembic revision --autogenerate -m "Changing something about the models."

This will create a migration script in feeder/database/alembic/versions.

To apply these changes to your database, run:

DATABASE_PATH=./data.db alembic upgrade head

How can I help?

If you have tech and coding experience, you can help! Drop Ted an email ([email protected]); introduce yourself, and he'll send you a Slack invite.

The Slack channel is NOT for support requests.

We are looking for active contributors. If you are having an issue setting up your instance or are running into what you think is a bug, please file an issue.