detransport_lviv_telegram

Version, currently master branch1 version
  • master branchlatestJul 7, 2026

github.com/mamantoha/detransport_lviv_telegram

Public transport in Lviv πŸ‡ΊπŸ‡¦

5 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  detransport_lviv_telegram:
    github: mamantoha/detransport_lviv_telegram
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
1.20.3
License
MIT
Author
Anton Maminov <anton.maminov@gmail.com>
Targets
  • db from src/db.cr
  • detransport_telegram from src/detransport_telegram.cr

Dependencies

Runtime Dependencies

  • pg*github: will/crystal-pg
  • geo*github: geocrystal/geo
  • i18n*github: crystal-i18n/i18n
  • crest*github: mamantoha/crest
  • dotenv*github: gdotdesign/cr-dotenv
  • lustra*github: crystal-garage/lustra, branch: main
  • haversine*github: geocrystal/haversine
  • sun_times*github: geocrystal/sun_times
  • fuzzy_match*github: acoustep/fuzzy_match.cr
  • telegram_bot*github: crystal-garage/telegram_bot, branch: develop
  • humanize_time*github: mamantoha/humanize_time

README

# detransport_lviv_telegram

Source code for <https://t.me/DetransportBot>

| ![image](https://github.com/mamantoha/detransport_lviv_telegram/blob/master/screenshots/screenshot1.png?raw=true) | ![image](https://github.com/mamantoha/detransport_lviv_telegram/blob/master/screenshots/screenshot2.png?raw=true) | ![image](https://github.com/mamantoha/detransport_lviv_telegram/blob/master/screenshots/screenshot3.png?raw=true) |
| --- | --- | --- |

## Installation

### Requirements

- Crystal
- PostgreSQL

Clone repository:

```console
git clone https://github.com/mamantoha/detransport_lviv_telegram.git
```

### Setup Telegram

Copy `.env.example` to `.env` and set variables

### Run

```console
shards build --release --production
./bin/detransport_telegram
```

## Development

```
psql -c 'DROP DATABASE IF EXISTS detransport_lviv_development;' -U postgres
psql -c 'CREATE DATABASE detransport_lviv_development;' -U postgres
```

### DB Migration

```console
crystal src/db.cr generate migration add_field_to_table
```

```crystal
crystal ./src/db.cr migrate
```

### Update stops

To update `./src/detransport_telegram/data/lviv_stops.json` run:

```console
crystal ./utils/update_stops.cr
```

## Deployment

### Linux with systemd

Create `/etc/systemd/system/detransport_lviv_telegram.service`

```ini
[Unit]
Description=Detransport Lviv Telegram service
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=1
User=user
WorkingDirectory=/path/to/detransport_lviv_telegram
ExecStart=/path/to/detransport_lviv_telegram/bin/detransport_telegram &>/dev/null &
StandardOutput=null
StandardError=null

[Install]
WantedBy=multi-user.target
```

```console
sudo systemctl enable detransport_lviv_telegram
```

```console
sudo systemctl start detransport_lviv_telegram
```

## Contributing

1. Fork it (<https://github.com/mamantoha/detransport_lviv_telegram/fork>)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

## Contributors

- [Anton Maminov](https://github.com/mamantoha) - creator and maintainer