Skip to content

Contributing

This is a short guide on the things you should know if you'd like to contribute to Superchat.

Install backend development requirements

Setting up a dev environment

  • Install Python 3.7.5 using pyenv install 3.7.5.
  • Check if you have the correct Python version pyenv versions.
  • Fork the Superchat repo and then clone the fork on your local machine.
  • Go to the backend directory cd backend/app.
  • Create a virtual environment by running poetry install. This will install all Superchat Python dependencies.
  • Run poetry shell to activate this new environment.
  • Go back to repository root cd ../.., create configuration file cp env-example .env and start docker stack usign docker-compose -f docker-compose.dev.yml up -d

Test your dev environment

  • Wait a few minutes while the infrastructure is being created and the database is initialized. Then run docker ps -a and make sure that all docker containers are running smoothly.

If you'd like to work on an existing issue, please comment on the github thread for the issue to notify that you're working on it, and then create a new branch with a suitable name.

For example, if you'd like to work on something about "Improving the Telegram channel plugin", you'd call it improve_telegram_channel. Once you're done with your changes, you can open a pull request and we'll review them.

Do not begin working on a new feature without first discussing it and opening an issue, as we might not agree with your vision.

Tools

Pydantic models generator

  • datamodel-codegen --class-name DaschatDispatchResults --input msg.json --input-file-type json --output model.py --reuse-model --target-python-version 3.8 --use-annotated --field-constraints --allow-population-by-field-name --use-title-as-name --snake-case-field --enable-faux-immutability --use-schema-description --field-include-all-keys

Usando --snake-case-field gera o modelo algusn campos neste estilo: created_at: Annotated[CreatedAt, Field(alias='createdAt')] Usando --enable-faux-immutability torna o objeto criado se torna imutável.

Thanks for contributing!