This repository has been archived by the owner on Sep 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b3fc2f
commit e8743c3
Showing
3 changed files
with
221 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,71 @@ | ||
# InNoHassle Music room bot | ||
|
||
[![GitHub Actions pre-commit](https://img.shields.io/github/actions/workflow/status/one-zero-eight/InNoHassle-MusicRoomBot/pre-commit.yaml?label=pre-commit)](https://github.com/one-zero-eight/InNoHassle-MusicRoomBot/actions) | ||
|
||
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=one-zero-eight_InNoHassle-MusicRoomBot&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=one-zero-eight_InNoHassle-MusicRoomBot) | ||
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=one-zero-eight_InNoHassle-MusicRoomBot&metric=bugs)](https://sonarcloud.io/summary/new_code?id=one-zero-eight_InNoHassle-MusicRoomBot) | ||
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=one-zero-eight_InNoHassle-MusicRoomBot&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=one-zero-eight_InNoHassle-MusicRoomBot) | ||
|
||
## Project Installation | ||
## Table of contents | ||
|
||
Did you know that GitHub supports table of | ||
contents [by default](https://github.blog/changelog/2021-04-13-table-of-contents-support-in-markdown-files/) 🤔 | ||
|
||
## About | ||
|
||
This is the Telegram bot for music room service in InNoHassle ecosystem. | ||
|
||
### Features | ||
|
||
- 🎵 Booking Music room | ||
- 📅 Schedule of Music room | ||
- 🔒 Roles and permissions | ||
|
||
**Note that for successful use of this bot, you have to run | ||
the [InNoHassle-MusicRoom](https://github.com/one-zero-eight/InNoHassle-MusicRoom) API.** | ||
### Technologies | ||
|
||
1. Install dependencies with [poetry](https://python-poetry.org/docs/). | ||
```bash | ||
poetry install --no-root | ||
``` | ||
- [Python 3.11](https://www.python.org/downloads/release/python-3117/) & [Poetry](https://python-poetry.org/docs/) | ||
- [Aiogram 3](https://docs.aiogram.dev/en/latest/) & [aiogram-dialog](https://aiogram-dialog.readthedocs.io/) | ||
- Formatting and linting: [Ruff](https://docs.astral.sh/ruff/), [pre-commit](https://pre-commit.com/) | ||
- Deployment: [Docker](https://www.docker.com/), [Docker Compose](https://docs.docker.com/compose/), | ||
[GitHub Actions](https://github.com/features/actions) | ||
|
||
2. Setup environment variables in `.env` file. | ||
## Development | ||
|
||
Run | ||
```bash | ||
cp .env.example .env | ||
``` | ||
And edit .env | ||
### Getting started | ||
|
||
1. Install [Python 3.11+](https://www.python.org/downloads/release/python-3117/) | ||
2. Install [Poetry](https://python-poetry.org/docs/) | ||
3. Install project dependencies with [Poetry](https://python-poetry.org/docs/cli/#options-2). | ||
```bash | ||
poetry install --no-root --with code-style | ||
``` | ||
4. Set up [pre-commit](https://pre-commit.com/) hooks: | ||
|
||
3. Run the bot | ||
```bash | ||
python -m src.main | ||
``` | ||
OR using Docker | ||
1. Create a network called <i>music-room</i> | ||
``` | ||
docker network create music-room | ||
``` | ||
2. Run bot | ||
```bash | ||
poetry run pre-commit install --install-hooks -t pre-commit -t commit-msg | ||
``` | ||
5. Set up project settings file (check [settings.schema.yaml](settings.schema.yaml) for more info). | ||
```bash | ||
cp settings.example.yaml settings.yaml | ||
``` | ||
docker-compose up --build | ||
Edit `settings.yaml` according to your needs. | ||
|
||
**Set up PyCharm integrations** | ||
|
||
1. Ruff ([plugin](https://plugins.jetbrains.com/plugin/20574-ruff)). | ||
It will lint and format your code. | ||
Make sure to enable `Use ruff format` option in plugin settings. | ||
2. Pydantic ([plugin](https://plugins.jetbrains.com/plugin/12861-pydantic)). | ||
It will fix PyCharm issues with | ||
type-hinting. | ||
3. Conventional commits ([plugin](https://plugins.jetbrains.com/plugin/13389-conventional-commit)). | ||
It will help you | ||
to write [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/). | ||
|
||
### Run for development | ||
|
||
1. Run the [api service](https://github.com/one-zero-eight/InNoHassle-MusicRoom). | ||
2. Run the bot: | ||
```bash | ||
python3 -m src.main | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters