Code Monkey home page Code Monkey logo

aiogram-mongo-template's Introduction

Aiogram Mongo Template

Telegram Bot template with aiogram, mongodb and docker

Technologies used:

  • Aiogram
  • Redis
  • Motor
  • MongoDB
  • i18n
  • Docker and docker compose

Navigate

Getting started

Init project

$ git clone -b aiogram3 https://github.com/webshining/aiogram-mongo-template project_name
$ cd project_name
$ pip install -r requirements.txt

Configure environment variables

Copy variables from .env.ren file to .env

$ cp .env.ren .env

Bot config

TELEGRAM_BOT_TOKEN - your bot token (required)

I18N_DOMAIN - locales file name

Redis config

If you are not using redis, by default used MemoryStorage

RD_DB - your redis database (number)

RD_HOST - your redis host

RD_PORT - your redis port

You can specify RD_URI instead of RD_DB, RD_HOST and RD_PORT

RD_URI - connection url to your redis server

Database config

MongoDB URL format
> mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]

MONGODB_URL - connection url to your mongodb server

Application start (local)

$ python main.py
# If you have make you can enter
$ make run

Docker

Application start (docker)

Run only one service:
> $ docker-compose up -d service-name

$ docker-compose up -d
# If you have make you can enter
$ make rebuild

View app logs

$ docker-compose logs -f app
# If you have make you can enter
$ make logs

Rebuild app

$ docker-compose up -d --build --no-deps --force-recreate
# If you have make you can enter
$ make rebuild

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.