<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aiden Marques</title>
    <description>The latest articles on DEV Community by Aiden Marques (@ruaiden).</description>
    <link>https://dev.to/ruaiden</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F511948%2F3321279d-3a54-43fb-9faa-3a981a22938f.png</url>
      <title>DEV Community: Aiden Marques</title>
      <link>https://dev.to/ruaiden</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ruaiden"/>
    <language>en</language>
    <item>
      <title>Sinatra Project - I did it!!</title>
      <dc:creator>Aiden Marques</dc:creator>
      <pubDate>Thu, 11 Mar 2021 07:44:13 +0000</pubDate>
      <link>https://dev.to/ruaiden/sinatra-project-i-did-it-4eig</link>
      <guid>https://dev.to/ruaiden/sinatra-project-i-did-it-4eig</guid>
      <description>&lt;p&gt;How it all started. The idea this time around came easy. A recipe database, users needed to have accounts but by doing so they could create, edit and delete their own recipes. While also being able to see other users recipes. So the concept was easy. Functionality is always the hardest part.&lt;/p&gt;

&lt;p&gt;I started off with corneal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gem install corneal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This was truly helpful, it gave me everything I needed and way more. As I continued to add gems to my gemfile to add the functionalities I wanted, I realized that I needed to clean up the unnecessary gems I had installed as they were not working with the new ones I was adding. &lt;/p&gt;

&lt;p&gt;For a while everything was great, I was getting the idea of models and views, I could create a form easily, work with my database. Then I hit a few roadblocks, I am a true believer that you learn more from what goes wrong than what goes right. &lt;/p&gt;

&lt;p&gt;My biggest learning curve in this project was using REST architecture.&lt;/p&gt;

&lt;p&gt;REST is an HTTP method. Basically it is a way to send and receive requests from the Client to the Server. You can have 4 requests:&lt;/p&gt;

&lt;p&gt;GET - This is the read access. Where you can access the actual resource.&lt;br&gt;
POST - This is where you can create a resource. Any new creation would be done through POST.&lt;br&gt;
DELETE - This is the easiest concept. This is how resources are removed.&lt;br&gt;
PUT - This is used for updates of an existing resource.&lt;/p&gt;

&lt;p&gt;When you are designing RESTful Web Services there are some common practices that make this all possible.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Validation - This validation was crucial when creating a login and sign up experience for users. The User had to create a password so creating a secure way of keeping these passwords and then validating that the login was correct prevents any attacks on the data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Session Based Authentication - This connects to the Validation step. When the user was first validated, in my project I made sure to save a Session[:user_id]. This was a short piece of code that became part of my authentication as the user tried to edit and delete their recipes down the line. This feature was the hardest to actually work, due to having to connect multiple recipes to one user and giving that user full autonomy to change them. Yet have an inability to change other user's recipes. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The Work is Never Done&lt;/p&gt;

&lt;p&gt;Finally as I had finished my project and was going one last walk through the functionality of it, I realize that my edit button stopped working. &lt;/p&gt;

&lt;p&gt;I tried rerouting it, updating my edit form, using pry, and reconnecting my edit button, but nothing worked.&lt;/p&gt;

&lt;p&gt;I could not figure out how the functionality that had once worked no longer was working. I took a similar approach to my 2nd road block and decided to recode that portion on step at a time to find the missing piece. Once again I realized that my params were not saving the id =&amp;gt; 1 but instead were saving id =&amp;gt; :id this was causing major errors in my program.&lt;/p&gt;

&lt;p&gt;The problem was just knowing the problem did not help fix it, I had to work through different refactoring, adding, deleting and breaking different portions of my code until figuring out that my connections were not correct and I had not added the dynamic factors so that my code took id as a number. &lt;/p&gt;

&lt;p&gt;I am very happy to say that finally my program works end to end. It has been an awesome accomplishment. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>My first CLI project</title>
      <dc:creator>Aiden Marques</dc:creator>
      <pubDate>Sun, 10 Jan 2021 16:57:23 +0000</pubDate>
      <link>https://dev.to/ruaiden/my-first-cli-project-34a3</link>
      <guid>https://dev.to/ruaiden/my-first-cli-project-34a3</guid>
      <description>&lt;p&gt;When the time came for me to finally start my CLI project, it was a bit daunting. Working on the labs for the Flatiron was difficult but having to create your own project from scratch, that's when your skills are finally put to the test. &lt;/p&gt;

&lt;h2&gt;
  
  
  My First Task
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What API do I use?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I started with a grand idea. I wanted to create a CLI that provided medical information for transgender individuals. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;I was very excited for the idea until I could not find any API that would give me the information I was looking for&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;After failing at my first idea, I decided to do some research first on the APIs I had available to me. So I decided to look through stockmarket API's. I liked the subject and a good number of API's appeared when I did my research. The issue I kept running into is all the API's I wanted to use had some sort of key. I played with the idea of using one of them even if the API key was necessary.&lt;/p&gt;

&lt;p&gt;As I continued searching for API's I could not find a free Stock API that gave me the exact information I needed. There are a lot of API's out there but most of the information I wanted to take use would have forced me to pay monthly for the API use. So that's when I decided it was time for plan C.&lt;/p&gt;

&lt;p&gt;I stumbled upon a github that listed many public Api's &lt;a href="https://github.com/public-apis/public-apis#food--drink"&gt;https://github.com/public-apis/public-apis#food--drink&lt;/a&gt;. That is where I found the API I use in my CLI program, &lt;strong&gt;openbrewerydb&lt;/strong&gt;. This API returns a list of breweries.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[
  ...
  {
    id: 299,
    name: "Almanac Beer Company",
    brewery_type: "micro",
    street: "651B W Tower Ave",
    address_2: null,
    address_3: null,
    city: "Alameda",
    state: "California",
    county_province: null,
    postal_code: "94501-5047",
    country: "United States",
    longitude: "-122.306283180899",
    latitude: "37.7834497667258",
    phone: "4159326531",
    website_url: "http://almanacbeer.com",
    updated_at: "2018-08-23T23:24:11.758Z",
    created_at: "2018-08-23T23:24:11.758Z"
  },
]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This was the perfect API, it had a lot of good information that when my CLI called it I could pull for the user. I was able to show different breweries, and different facts about it. Making this CLI interesting and informative for users.&lt;/p&gt;

&lt;h2&gt;
  
  
  Top Features
&lt;/h2&gt;

&lt;p&gt;I love the functionality of my CLI and will definitely use it myself to find some great breweries. While building out this CLI two features became my favorite part of this program. Below, I talk a little bit to the features and how they elevate my CLI from just a basic Command-line Interface program.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TTY-Prompt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;TTY-Prompt is an awesome feature that allows users to select an option using their arrow keys to move up and down the choices and are able to select a choice by pressing Enter.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Welcome User.

Do you want to see all Breweries? (Press ↑/↓ arrow to move and Enter to select)
‣ Yes
  BrewPub
  No

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I was able to create this feature using the tty-prompt gem and then updating my menu method so that it reflected that gem.&lt;/p&gt;

&lt;p&gt;My menu method is broken down into two parts.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Part 1:&lt;/em&gt; Creates the functionality of being able to use your keys and enter to select your choice. This works by creating a new prompt, and then iterating through the different choices I created.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def menu

            prompt = TTY::Prompt.new
            choices = prompt.select("Do you want to see all Breweries?") do |menu|
                menu.choice 'Yes'
                menu.choice 'BrewPub'
                menu.choice 'No'
            end 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Part 2:&lt;/em&gt; Gives a path for the choices created. The user is able to choose between 3 choices. Yes, No and BrewPub.&lt;/p&gt;

&lt;p&gt;When the user chooses &lt;em&gt;yes&lt;/em&gt;, the program prints "Good choice" and it displays the name of all the breweries available and gives the user the opportunity to choose the brewery they want to see more information on.&lt;/p&gt;

&lt;p&gt;When the user chooses &lt;em&gt;brewpubs&lt;/em&gt;, the program displays breweries that are restaurants. It does not display any other kind of brewery. &lt;/p&gt;

&lt;p&gt;When the user chooses &lt;em&gt;no&lt;/em&gt;, the program prints "Thank You. Hope to see you soon!" and exits the program.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;            if choices == "Yes" 
                puts "Good Choice!"
                display_breweries
                user_choice
                menu

            elsif choices == "BrewPub" 
                display_brewpub_breweries
                user_input_type
                menu

            elsif choices == "No" 
                puts "Thank You. Hope to see you soon!"  
            end            
        end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The TTY-Prompt gem fixed the problem if a user incorrectly typed a choice. I did not want to force the user to have to keep typing until they fully copied what was on the screen, so this gem really helped mitigate that issue by no longer requiring users to input their choice and instead just moving through the choices with their keys. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;system "clear"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The other feature that I believe makes my program easier to use is the system clear feature. This feature clears my terminal as soon as I run the CLI program.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/usr/bin/env ruby

require_relative '../config/environment'

system "clear"
CLI.new.start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I added the system "clear" line of code to my run file so that as soon as my file was run it clears the terminal for the user. Only displaying my CLI program.&lt;/p&gt;

&lt;p&gt;It was an awesome experience putting this project together. I really enjoyed having to tinker with the code so that I could add more functionality and flair to my program. I hope this post helps you add some cool features to your programs as well. &lt;/p&gt;

&lt;p&gt;If you would like to check out the &lt;a href="https://github.com/ruaiden/breweries"&gt;code&lt;/a&gt; for my project you are welcome to do so. I hope you will try it out and enjoy it.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Why did you decide to study Software Engineering?</title>
      <dc:creator>Aiden Marques</dc:creator>
      <pubDate>Tue, 10 Nov 2020 23:58:52 +0000</pubDate>
      <link>https://dev.to/ruaiden/why-did-you-decide-to-study-software-engineering-5afo</link>
      <guid>https://dev.to/ruaiden/why-did-you-decide-to-study-software-engineering-5afo</guid>
      <description>&lt;p&gt;Two years ago I decided I wanted to pick up a new skill, HTML and CSS seemed like the perfect skill. Web pages had always interested me so it seemed like the perfect thing to try and pick up.&lt;/p&gt;

&lt;p&gt;I started working on my HTML and CSS skills and was able to get a project to work on from a coworker at the time. My job was to work on the design of a baby clothing website. Working on this website in my free time made me start to question the marketing path I was considering going down. I was trying to teach myself coding, however I was having a hard time moving on from HTML, CSS and JavaScript. I continued to maintain that front end for about a year. I got a different job and put coding on the back burner.&lt;/p&gt;

&lt;p&gt;Earlier 2020, I tried to go the route of self-teaching again. This once again was difficult because I could not figure out a curriculum that worked for me. I would start different routes but something else always seemed like the better path.&lt;/p&gt;

&lt;p&gt;So finally after 2 years I decided to finally give Flatiron Bootcamp a go. After spending 2 years working on my career, doing marketing operations, I started learning about different roles at my current company that I was more interested in. I spoke to many Software Engineers at my company to understand what they worked on, and what path they took to learn software engineering and this really solidified that was what I wanted to spend my time working on. &lt;/p&gt;

&lt;p&gt;I am really looking forward to be taking this next step in my coding journey!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
