Skip to content

fincubator/cradlex

Repository files navigation

Cradlex

License pre-commit Code style: black


Cradlex is an asynchronous ERP Telegram bot for small builder groups.

Requirements

  • Python >= 3.9
  • PostgreSQL >= 13 - relational database management system
  • AIOGram - asynchronous Python framework for Telegram Bot API
  • asyncpg - asynchronous PostgreSQL database client library for Python
  • SQLAlchemy - SQL toolkit and Object Relational Mapper for Python
  • Alembic - database migration tool for usage with the SQLAlchemy

Installation and launch

Using Docker

  1. Clone the repository:
git clone https://github.com/fincubator/cradlex
cd cradlex
  1. Create environment file from example:
cp .env.example .env
  1. Personalize configuration by modifying .env.
  2. Create a new Telegram bot by talking to @BotFather and get its API token.
  3. Create a file containing Telegram bot's API token with filename specified in TOKEN_FILENAME from .env.
  4. Create a file containing database password with filename specified in DATABASE_PASSWORD_FILENAME from .env.
  5. Install Docker Compose >= 1.26.0.
  6. Start container:
docker-compose up --build

Manual

  1. Clone the repository:
git clone https://github.com/fincubator/cradlex
cd cradlex
  1. Install Python with pip.
  2. Install requirements:
pip install -r requirements.txt
  1. Compile translations:
pybabel compile -d locale/ -D bot
  1. Create environment file from example:
cp .env.example .env
  1. Personalize configuration by modifying .env.
  2. Create a new Telegram bot by talking to @BotFather and get its API token.
  3. Create a file containing Telegram bot's API token with filename specified in TOKEN_FILENAME from .env.
  4. Create a file containing database password with filename specified in DATABASE_PASSWORD_FILENAME from .env.
  5. Install and start PostgreSQL server.
  6. Create a role with name specified in DATABASE_USERNAME from .env and password specified in DATABASE_PASSWORD from .env.
  7. Set environment variables:
export $(sed 's/#.*//' .env | xargs)
  1. Launch Cradlex:
python -m cradlex

Contributing

You can help by working on opened issues, fixing bugs, creating new features or improving documentation.

Before contributing, please read CONTRIBUTING.md first.

License

Cradlex is released under the GNU Affero General Public License v3.0. See LICENSE for the full licensing condition.