RoR Deployment on Google Cloud Platform

 

Overview

This application is a simple web application-based login form implemented with Ruby on Rails where Ruby is an interpreted, high level, object oriented programming language and Rails is a framework. 

The application is deployed on Google Cloud Platform.

Goals

  1. Application accepts username and password. For valid credentials, it displays a message “Login successful! You are logged in as (loggedin_username) ”

  2. Valid logged in users can log out successfully .

  3. Application accepts username and password. For invalid credentials, it displays a message “Authentication failed! Please enter correct credentials.”

Specifications

Programming language : Ruby 

Web application framework : Rails (MVC)

Deployment : Google Cloud Platform

Source code : https://github.com/amrutapednekar/authentication_app

Deployment on Google Cloud Platform

  1. New project

Created a new project on Google Cloud Platform. 



  1. Open cloud shell terminal

  2. Clone application code

Application code is cloned from git repository to the Cloud shell.

  1. Ruby installation version 2.7.3

Installed ruby version 2.7.3. Command “ruby -v” shows installed ruby version  2.7.3


  1. Installation of other dependencies and gems

Command “bundle install” helps to install all other dependencies and required gems that we already listed in GemFile.rb 

  1. Application is running on GCP

Command “rails s -p 8080” runs application on port number 8080

Use cases

  1. Login form

Once an application is deployed , it displays a login form. First textfield is to enter username and second password field is to enter password. 

Server logs





  1. First user enters username and password

User enters the username and a valid password. As it is secured, inserted  password is not displayed. 

User clicks on the Login button.

Server logs




  1. User logged in successfully 

Application verifies logged in credentials with credentials already saved in the system. 

If credentials match, , the user logs in successfully.  

It displays the message “Login successful! You are logged in as --------”.

System displays username successfully.

User logs out. Server logs

4.User enters incorrect credentials 


4. Third user enters incorrect credentials

User enters a wrong username and a  password. As it is secured, the inserted  password is not displayed. 

User clicks on the Login button.

Server logs

4. User log in unsuccessfully 

5. User log in unsuccessfully

Application verifies logged in credentials with credentials already saved in the system. As credentials don't match, the user login unsuccessfully.  

It displays the error message in red color “Authentication failed! Please enter correct credentials.

User remains on the login page.


Comments

Popular posts from this blog

PERSONAL ACCESS TOKEN ON GITHUB

PostgreSQL Commands

Rails Application with Docker