Contributing
This is a short guide on the things you should know if you'd like to contribute to Superchat.
Install backend development requirements
- Git
- Docker.
- Docker Compose.
- Pyenv
- Poetry for Python package and environment management.
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 shellto activate this new environment. - Go back to repository root
cd ../.., create configuration filecp env-example .envand start docker stack usigndocker-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 -aand 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!