Skip to content

Music room booking service at Innopolis Sports center. API and Telegram bot for users to manage their bookings and view schedule.

License

Notifications You must be signed in to change notification settings

one-zero-eight/music-room

Repository files navigation

InNoHassle Music room

GitHub Actions pre-commit

Lines of Code Bugs Vulnerabilities

Table of contents

Did you know that GitHub supports table of contents by default 🤔

About

This is the API for music room service in InNoHassle ecosystem.

Features

  • 🎵 Booking Music room
  • 📅 Schedule of Music room
  • 🔒 Roles and permissions

Technologies

Development

Set up for development

  1. Install Python 3.12+ & Poetry
  2. Install project dependencies with Poetry.
    poetry install
  3. Start the API:
    poetry run python -m src.api

    Follow provided instructions if needed

  4. Start the Bot:
    poetry run python -m src.bot

    Follow provided instructions if needed

Important

For endpoints requiring authorization click "Authorize" button in Swagger UI

Tip

Edit settings.yaml according to your needs, you can view schema in config_schema.py and in settings.schema.yaml

Set up PyCharm integrations

  1. Run configurations (docs). Right-click the __main__.py file in the project explorer, select Run '__main__' from the context menu.
  2. Ruff (plugin). It will lint and format your code. Make sure to enable Use ruff format option in plugin settings.
  3. Pydantic (plugin). It will fix PyCharm issues with type-hinting.
  4. Conventional commits (plugin). It will help you to write conventional commits.

Localization

Aiogram:

All localized bot messages should be wrapped: __("Hello world"")

  1. Extract messages:
    poetry run pybabel extract -k __ --input-dirs=. -o locales/messages.pot
  2. Update translations:
    poetry run pybabel update -i locales/messages.pot -d locales -D messages --ignore-pot-creation-date
  3. Translate messages in created .po files
  4. Compile translations:
    poetry run pybabel compile -d locales -D messages

Aiogram dialog:

Add translations identifiers (strings inside I18Format) and their translations to .ftl files

Deployment

We use Docker with Docker Compose plugin to run the website on servers.

  1. Copy the file with environment variables: cp .env.example .env
  2. Change environment variables in the .env file
  3. Copy the file with settings: cp settings.example.yaml settings.yaml
  4. Change settings in the settings.yaml file according to your needs (check settings.schema.yaml for more info)
  5. Install Docker with Docker Compose
  6. Build a Docker image: docker compose build --pull
  7. Run the container: docker compose up --detach
  8. Check the logs: docker compose logs -f

How to update dependencies

Project dependencies

  1. Run poetry update to update all dependencies (it may update nothing, so double-check)
  2. Run poetry show --outdated --all to check for outdated dependencies
  3. Run poetry add <package>@latest to add a new dependency if needed

Pre-commit hooks

  1. Run poetry run pre-commit autoupdate

Also, Dependabot will help you to keep your dependencies up-to-date, see dependabot.yml.

Contributing

We are open to contributions of any kind. You can help us with code, bugs, design, documentation, media, new ideas, etc. If you are interested in contributing, please read our contribution guide.

About

Music room booking service at Innopolis Sports center. API and Telegram bot for users to manage their bookings and view schedule.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages