-
Notifications
You must be signed in to change notification settings - Fork 65
Setting up development environment
This application is made up of 4 parts. In most cases you probably don't need to start all the parts, so follow the instructions where necessary.
- Rails app
- Scheduler
- Job worker
- Telegram bot integration
This is the core of the entire web application. This app serves the website and also the API. A Postgres database is also required to start the Rails app so get it running before you get started. If you are using Mac, you can use PostgresApp to get started easily.
How to start:
- Open a new terminal
- run
bin/rails s
The scheduler is currently shipped together with Web application. Therefore only 1 instance of the web application should be run (or deployed) to prevent multiple scheduler instance running.
How to start:
- No command needed to start scheduler as it is started with the Rails app
All jobs are enqueued with the DelayedJob ActiveJob queue adapter. In order for your enqueued jobs to be processed, you will need to start a job worker.
How to start:
- Open a new terminal
- run
bin/rails jobs:work
The application integrates with the Telegram API to power the RubySGBot. We have a test RubySGTestBot that is used for development environment. You can follow the steps below to set up the integration for your development environment.
How to start:
- Download the API collection (ruby-sg-reboot-insomnia-2023-07-22.yaml.zip) and import the API collection into Insomnia or Postman
- Get the access token for RubySGTestBot from @taykangsheng and update
access-token
in environment variables - Start a tunnelling session to your Rails application by using a service like Ngrok and update
app_url
in environment variables with the url of the tunnelling session. - Configure RubySGTestBot's update webhook to point to the tunnelling session by running the
Set webhook URL
API request - Add RubySGTestBot to any telegram group and you should should see telegram pushing webhook events to your tunnelled session