Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.

Commit f439ebf

Browse files
committed
Add makefile and update readme file
1 parent 8cf93d4 commit f439ebf

File tree

4 files changed

+89
-34
lines changed

4 files changed

+89
-34
lines changed

.github/workflows/ruby.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Ruby
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [ master, next ]
66
pull_request:
7-
branches: [ master ]
7+
branches: [ master, next ]
88

99
jobs:
1010
build:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,5 @@ build-iPhoneSimulator/
8383

8484
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
8585
.rvmrc
86+
87+
.tool-versions

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
install:
2+
bundle install
3+
4+
database:
5+
bundle exec rails db:migrate
6+
7+
serve:
8+
bundle exec rails server

README.md

Lines changed: 77 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,63 +2,108 @@
22
<img src="https://static0.twilio.com/marketing/bundles/marketing/img/logos/wordmark-red.svg" alt="Twilio" width="250" />
33
</a>
44

5-
This application example demonstrates how to do simple phone verification with Ruby on Rails Framework, and Twilio Verify.
5+
# Twilio Verify Quickstart with Twilio and Rails
66

77
![](https://github.com/TwilioDevEd/verify-v2-quickstart-rails/workflows/Ruby/badge.svg)
88

99
> We are currently in the process of updating this sample template. If you are encountering any issues with the sample, please open an issue at [github.com/twilio-labs/code-exchange/issues](https://github.com/twilio-labs/code-exchange/issues) and we'll try to help you.
1010
11-
## Local Development
11+
## About
12+
13+
This application example demonstrates how to do simple phone verification with Ruby on Rails Framework, and Twilio Verify.
14+
15+
Learn more about Account Security and when to use the Authy API vs the Verify API in the [Account Security documentation](https://www.twilio.com/docs/verify/authy-vs-verify).
16+
17+
Implementations in other languages:
18+
19+
| .NET | Java | Python | PHP | Node |
20+
| :--- | :--- | :----- | :-- | :--- |
21+
| [Done](https://github.com/TwilioDevEd/verify-v2-quickstart-csharp) | [Done](https://github.com/TwilioDevEd/verify-v2-quickstart-java) | [Done](https://github.com/TwilioDevEd/verify-v2-quickstart-python) | [Done](https://github.com/TwilioDevEd/verify-v2-quickstart-php) | [Done](https://github.com/TwilioDevEd/verify-v2-quickstart-node) |
22+
23+
## Set up
24+
25+
### Requirements
26+
27+
- [Ruby](https://www.ruby-lang.org/) **2.6.x** version.
28+
- [Sqlite3](https://www.sqlite.org/)
29+
30+
### Twilio Account Settings
31+
32+
This application should give you a ready-made starting point for writing your own application.
33+
Before we begin, we need to collect all the config values we need to run the application:
34+
35+
| Config Value | Description |
36+
| :---------- | :---------- |
37+
| TWILIO_ACCOUNT_SID / TWILIO_AUTH_TOKEN | For Twilio API credentials find [here](https://www.twilio.com/console)|
38+
| TWILIO_VERIFICATION_SID | For Verification Service SID [here](https://www.twilio.com/console/verify/services) |
39+
40+
### Local Development
1241

1342
1. Clone the project and cd into it.
1443
```bash
15-
git clone ...
44+
git clone https://github.com/TwilioDevEd/verify-v2-quickstart-rails.git
1645
cd verify-v2-quickstart-rails/
1746
```
1847

19-
1. Copy `.env.example` to `.env` to setup you environment.
48+
1. Install gem dependencies.
2049
```bash
21-
cp .env.example .env
50+
make install
2251
```
2352

24-
1. Edit `.env` to add your Twilio access keys. For Twilio API credentials find [here](https://www.twilio.com/console) and for Verification Service SID [here](https://www.twilio.com/console/verify/services).
25-
```
26-
TWILIO_ACCOUNT_SID=ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
27-
TWILIO_AUTH_TOKEN=7axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
28-
TWILIO_VERIFICATION_SID=VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
29-
```
30-
31-
1. Install gem dependencies
53+
1. Copy `.env` file.
3254
```bash
33-
bundle install
55+
cp .env.example .env
3456
```
3557

36-
1. Run migrations to create the database.
37-
```bash
38-
rails db:migrate
39-
```
58+
See [Twilio Account Settings](#twilio-account-settings) to locate the necessary environment variables.
59+
60+
1. Create the database and run migrations.
61+
62+
```bash
63+
make database
64+
```
4065

4166
1. Run the application.
42-
```bach
43-
rails server
67+
```bash
68+
make serve
4469
```
4570

46-
1. Check it out at [http://localhost:3000](http://localhost:3000)
47-
71+
1. Navigate to [http://localhost:3000](http://localhost:3000)
4872

4973
That's it!
5074
51-
## Run the tests
75+
### Tests
5276
53-
1. Run minitests
77+
You can run the tests locally by typing:
5478
55-
```bash
56-
rails test
57-
```
79+
```bash
80+
bundle exec rails test
81+
```
82+
83+
### Cloud deployment
84+
85+
Additionally to trying out this application locally, you can deploy it to a variety of host services. Here is a small selection of them.
86+
87+
Please be aware that some of these might charge you for the usage or might make the source code for this application visible to the public. When in doubt research the respective hosting service first.
88+
89+
| Service | |
90+
| :-------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
91+
| [Heroku](https://www.heroku.com/) | [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) |
92+
93+
## Resources
94+
95+
- The CodeExchange repository can be found [here](https://github.com/twilio-labs/code-exchange/).
96+
97+
## Contributing
98+
99+
This template is open source and welcomes contributions. All contributions are subject to our [Code of Conduct](https://github.com/twilio-labs/.github/blob/master/CODE_OF_CONDUCT.md).
100+
101+
## License
102+
103+
[MIT](http://www.opensource.org/licenses/mit-license.html)
104+
105+
## Disclaimer
58106
59-
## Meta
107+
No warranty expressed or implied. Software is as is.
60108
61-
* No warranty expressed or implied. Software is as is. Diggity.
62-
* The CodeExchange repository can be found [here](https://github.com/twilio-labs/code-exchange/).
63-
* [MIT License](http://www.opensource.org/licenses/mit-license.html)
64-
* Lovingly crafted by Twilio Developer Education.
109+
[twilio]: https://www.twilio.com

0 commit comments

Comments
 (0)