CLICK TO EXPAND
This week converted our static website into a Ruby on Rails application.
The first step was to use the Assett Pipeline to provide the JS, CSS and HTML files needed to run the website.
We implemented Embeded Ruby Syntax to the HTML code.
We created a database which contained multiple tables :
The employee table is used to assign permissions to access the Backoffice. It is also used to store e-mails and passwords of said employees.
If you want to access the Backoffice use these credentials:
- username: [email protected]
- password: newdog1
The users table is used to store login information for employees. It also assigns an ID to each one in order to link the tables together.
In order to create a Backoffice, we first had to implement an authentication process. To achieve this, we used Gem Devise which took care of all the controllers necessary for user creation and user sessions. We then used RailsAdmin that provided us with a Backoffice interface for managing our data, such as the Employee table, the Users table and a Quote table which is used to store all the quote requests made on the website.
Here is a screenshot of what the list of quotes looks like :
We then deployed the website to AWS Ubuntu Server using Cloudflare to secure it.
The Backoffice was updated to include more data from Mysql as well as adding a Data Warehouse.
It is now possible to Query the database and show the results in a graph :
We can also group multiple Graphs at the same time using a Dashboard :
In order to link the two databases together and to keep them up to date, we had to create tasks :
CLICK TO EXPAND
Use these credentials to access the back office:
- Username: [email protected]
- Password: newdog1
This week we had to implement APIs to our Rocket Elevators Rails Applications:
First we added the Twilio and Slack APIs which were pretty similar. We added this code to the Elevator Model:
Next we linked the Quotes and Leads controller to Zendesk:
Here is what the Sendgrid code looks like in the Leads Controller:
This is the email that the customer receives when he/she completes the Contact Form:
In order to have Contact Form Attachment Files sent to Dropbox,(Le login est [email protected] password: rocketelevators2021) here is what we added:
Next comes IBM Watson Text-to-Speech. We started by adding an audio player to Rails Admin in a new tab called Watson:
Then, we created a method that updates the audio file with Watson reading the text provided, here is the code:
See what the audio player looks like:
Finally, we implemented Google Maps in the Back Office. This is the code:
Here is what it looks like on the website:
We added a Spotify Player to the Admin Page:
Next, we added a new Watson to provide interesting facts about Star Wars:
CLICK TO EXPAND
This week we had to extend our data warehouse with a table named Fact Intervention:Then we developed a rake task to generate random data into that table.
CLICK TO EXPAND
This week, we gathered all of the knowledge we aquired in the past weeks, and applied in our tasks.
- Build a new table in the MySQL database called Intervention
- Build a new form to create interventions
- Creating a ZenDesk ticket to go along with the intervention
- Build new endpoints on the Rest API
Link to the rest API: https://github.com/DaveVaval/Rocket-Elevators-Rest-API.git Link to the GraphQL API: https://github.com/DaveVaval/Rocket-Elevators-GraphQL-API.git
Use these credentials to access the back office:
- Username: [email protected]
- Password: newdog1
The controller logic to go with the form:
All of the fields in the Intervention form are updated through and ajax call:
This week, we learned about TDD (test-driven development) and BDD (behavior-driven development). Our tasks were to:
- Create a module (ElevatorMedia) and class (Streamer)
- Create a method (getContent) that returns html in the form of "<'div'>Content<'div'>"
- Build a test that will validate the data received from the getContent method
- Apply the BDD to 3 existing parts of our code