The Uhura Example App allows you to test the Uhura Client Ruby gem using a Rails web app, i.e., this example application.
These instructions will get you up and running with Uhura on your local machine for development and testing purposes.
- Git
- Ruby 2.6.3
- bundler 2.0.2
- PostgreSQL
- Yarn
Follow the Connecting to GitHub with SSH instructions.
If you might need to install more than one version of Ruby on your server, consider using rbenv or rvm to help you manage your Ruby version.
Install the bundler gem, s.t., you can later run the bundle
command and install Uhura's Ruby dependencies:
gem install bundler:2.0.2
If you want to install the PostgreSQL database sever locally for development purposes you can follow these steps on Ubuntu.
NOTE: Replace lex
with your operating system's username below:
$ sudo apt update
$ sudo apt install postgresql postgresql-contrib
$ sudo -i -u postgres psql
postgres=# CREATE ROLE lex LOGIN SUPERUSER;
Giving your user role the SUPERUSER attribute allows you to run Rails database manipulation commands and migrations, e.g., bundle exec rake db:create
. The LOGIN attribute is also required.
NOTE: See Troubleshooting Guide to see how to install PostgrSQL client library if you chose not to install the PostgreSQL database server in the server instance where you install Uhura.
Install the Yarn package on your workstation. For an Ubuntu server:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
yarn install --check-files
You must have ADMIN_NAME
and ADMIN_PASSWORD
as environment variables to login to this example application.
Change the UHURA_BASE_API_URL
to the Uhura Messaging Server endpoint and verify that the other UHURA variables are correct:
export UHURA_BASE_API_URL="http://localhost:3000/api/v1"
export UHURA_API_KEY="deadbeef00deadbeef01"
export UHURA_TEAM_ID="1"
export UHURA_PUBLIC_TOKEN="deadbeef02deadbeef03"
See the Create Your .env File section below.
Let's assume our Uhura project root directory is ~/Projects/uhura-example-app
$ mkdir ~/Projects
$ cd ~/Projects
$ git clone https://github.com/dailydrip/uhura-example-app.git
$ cd uhura-example-app
$ bundle
$ bundle exec rails webpacker:install
Run the following command and edit your .env file to match your environment.
mv sample.env .env
You can load those environment variables into your terminal's session by sourcing your project's .env file:
source .env
$ PORT=4000 bundle exec rails server
Go to http://localhost:4000
and you'll see the application:
For more discussion of how to use the Uhura Example Application and how to configure Sendgrid templates, please see the Uhura Example Application's Usage Guide.
$ bundle exec rspec
The application uses BASIC AUTH when in staging
. We use the same password and username for the admin.
This project is licensed under the MIT License - see the LICENSE file for details