|
2 | 2 | <img src="https://static0.twilio.com/marketing/bundles/marketing/img/logos/wordmark-red.svg" alt="Twilio" width="250" />
|
3 | 3 | </a>
|
4 | 4 |
|
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 |
6 | 6 |
|
7 | 7 | 
|
8 | 8 |
|
9 | 9 | > 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.
|
10 | 10 |
|
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 |
12 | 41 |
|
13 | 42 | 1. Clone the project and cd into it.
|
14 | 43 | ```bash
|
15 |
| - git clone ... |
| 44 | + git clone https://github.com/TwilioDevEd/verify-v2-quickstart-rails.git |
16 | 45 | cd verify-v2-quickstart-rails/
|
17 | 46 | ```
|
18 | 47 |
|
19 |
| -1. Copy `.env.example` to `.env` to setup you environment. |
| 48 | +1. Install gem dependencies. |
20 | 49 | ```bash
|
21 |
| - cp .env.example .env |
| 50 | + make install |
22 | 51 | ```
|
23 | 52 |
|
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. |
32 | 54 | ```bash
|
33 |
| - bundle install |
| 55 | + cp .env.example .env |
34 | 56 | ```
|
35 | 57 |
|
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 | + ``` |
40 | 65 |
|
41 | 66 | 1. Run the application.
|
42 |
| - ```bach |
43 |
| - rails server |
| 67 | + ```bash |
| 68 | + make serve |
44 | 69 | ```
|
45 | 70 |
|
46 |
| -1. Check it out at [http://localhost:3000](http://localhost:3000) |
47 |
| - |
| 71 | +1. Navigate to [http://localhost:3000](http://localhost:3000) |
48 | 72 |
|
49 | 73 | That's it!
|
50 | 74 |
|
51 |
| -## Run the tests |
| 75 | +### Tests |
52 | 76 |
|
53 |
| -1. Run minitests |
| 77 | +You can run the tests locally by typing: |
54 | 78 |
|
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/) | [](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 |
58 | 106 |
|
59 |
| -## Meta |
| 107 | +No warranty expressed or implied. Software is as is. |
60 | 108 |
|
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