An open API service indexing awesome lists of open source software.

https://github.com/zeroniki/fasttask


https://github.com/zeroniki/fasttask

aiogram alembic async fastapi httpx python3 telegram-api

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# FastTask

- Navigation:
- [About](https://github.com/ZeroNiki/FastTask/blob/main/README.md#about)
- [Features](https://github.com/ZeroNiki/FastTask/blob/main/README.md#features)
- [Components](https://github.com/ZeroNiki/FastTask/blob/main/README.md#components)
- [Install and usage](https://github.com/ZeroNiki/FastTask/blob/main/README.md#install-and-usage)

[RU README](https://github.com/ZeroNiki/FastTask/blob/main/README_RUS.md)

## About
This project is a Task Management Bot using the Aiogram framework for Telegram bot interaction and FastAPI for backend operations. It integrates a SQLite database via SQLAlchemy ORM to manage users and tasks. The bot allows users to create, view, update, and delete tasks with seamless interaction and error handling.

### Features
- User Management: Automatic registration of users on their first interaction with the bot.
- Task Management: Create, view, update, and delete tasks. Tasks are stored in the database and associated with specific users.
- Error Handling: Logs and replies to users in case of errors during API calls.
- Interactive Telegram Interface: Rich text formatting and custom keyboards for easy user interaction.

#### Components
##### Telegram Bot
- Aiogram framework handles bot commands and messages.
- Command Handlers for starting the bot, registering users, and viewing tasks.
- Interactive Keyboard options for task management.

##### FastAPI Backend
- Exposes API endpoints for managing users and tasks:
- POST `/operations/users:` Create a new user.
- POST `/operations/tasks:` Create a task.
- GET `/operations/tasks/{user_id}:` Retrieve tasks for a user.
- PATCH `/operations/tasks/{task_id}:` Mark task as done.
- DELETE `/operations/tasks/{task_id}:` Delete a task.

## Install and usage

Clone repo:
```sh
git clone https://github.com/ZeroNiki/FastTask.git

cd FastTask
```

Install requirements:
```
pip install -r requirements.txt
```

in `.env` file paste you telegram bot `TOKEN`:
```
TOKEN=you bot token
```

Update database:
```sh
mkdir migrations/versions

alembic revision --autogenerate -m "Init"
alembic upgrade head
```

Start `api` and `bot`:
```sh
python3 start_api.py

python3 start_bot.py
```

Done!