Giter Site home page Giter Site logo

seng-live-042522-phase-3's Introduction

SENG-LIVE-042522 Phase 3

Phase Objectives

  • Understand the principles of Ruby as a language including principles of object oriented programming
  • Understand the characteristics of a relational database
  • Perform CRUD actions with a database using Active Record
  • Design an API to handle CRUD actions
  • Communicate with an API using different HTTP verbs
  • Create and present a project with a React frontend and a database-backed API backend

Lectures

  1. Ruby Fundamentals (slides)
  2. Object Oriented Ruby pt1 (slides)
  3. Object Oriented Ruby pt2 (slides)
  4. Intro to Databases (slides)
  5. Intro to ActiveRecord (slides)
  6. ActiveRecord Associations: Many to Many (slides)
  7. Debugging in Ruby (code challenge prep)
  8. Intro to Sinatra (after code challenge) (slides)
  9. Sinatra API CRUD with relationships

How to use this repository

Git Flow Diagram

Day 1 Instructions

Fork this repository

  • Click on the Fork Icon at the top of the UI and wait for the forking operation to complete
  • I needed to select my username here to indicate I want to fork to my account because I'm part of multiple organizations

Forking a Repo animation

Clone your fork of the repository to your local machine

To do this there are a two main tasks we'll want to complete.

  1. Get the SSH link for your fork of the repository
  2. Clone the repository to a folder on your local machine

1. Getting the SSH link to clone the repository

  • Once the fork is complete, click on the green code button
  • in the sub menu that appears, make sure that SSH is underlined
  • click the clipboard button to copy the ssh link to your clipboard

Getting the SSH clone link

2. Cloning the forked repository to a folder on your local machine

  • open up a terminal and navigate to the directory where you want to store your lecture code
    • In my case I'm creating the folder through the terminal using the mkdir lecture-code command
    • next, cd lecture-code to move my terminal's working directory into the lecture-code folder
  • run git clone <pasteyoursshgitrepolinkhere> in the terminal
  • run code SENG-LIVE-042522-phase-3 to open the repository within VSCode

PRO TIP If you type the tab key on your keyboard while interacting with the terminal, you can autocomplete long file or folder names. In this case, I typed code SENG and then hit the tab key and it expanded the path to the only folder name matching SENG which was SENG-LIVE-042522-phase-3. So, you only need to type as many characters as can uniquely identify the file or folder name that you want to open and then you can use tab to complete the rest of the required typing without typos!

Cloning to your machine

Now that you have the repository cloned to your local machine, you'll be able to following along with lecture inside of your own code editor if you wish.

Before Every Subsequent Lecture

  1. Click on the Fetch & Merge button on your fork of the repository on GitHub.
  2. Run git pull from within the attached terminal of your local copy of the repository in VS Code.

Fetch and Merge Into Git Pull

Recommended VS Code Extension for Git

GitLens! See the GIF below for an example of how to install a VSCode extension.

Installing GitLens

The GitLens extension allows you an integrated Visual interface for viewing past commits, stashes and even file history over time. It adds options directly into the built in Version Control pane of the VSCode editor.

Merge Conflicts

If all goes well, you should not encounter merge conflicts when you follow this workflow as part of participation in lecture. There is one scenario where they might come up, so I want to describe it here and how to address it.

Scenario

Say these events happen in this order:

  1. Your lecturer sends out a message in Slack notifying the class that starter code is ready to fetch and merge before lecture.
  2. You go through the steps above and pull down the updated code to your machine.
  3. You start taking some notes there and attempting to solve problems in the starter code.
  4. The lecturer notices something in the lecture code that they want to change and pushes another commit to the lecture repo.

In this case, going through the fetch & merge and git pull workflow may result in what's called a merge conflict. The safest thing to do in this situation is to run git stash locally to hide your changes in your local repository so that the pull from GitHub goes off without a hitch. You can still view the code within your stash within VSCode and you can even return it to your machine with git stash pop if you like.

Using Git Stash

If this scenario arises, your lecturer will generally communicate the change in advance, so this scenario should be rare. But, should it happen, this is one approach you can take to get around any potential problems.

If you have code stashed in your local repository, it won't be visible within the regular file structure (AKA your working directory). If you want to return the code to your machine, you can still do so by applying the stash.

Applying a Stash

If you prefer, you can simply keep your code in the stash and it'll allow you to more clearly see the difference between your code and the starter code when you click on a stashed change within the Version Control Tab's Stashes dropdown. It will show you a visual diff with your additions highlighted in green and your removals highlighted in red.

Git Resources

seng-live-042522-phase-3's People

Contributors

dakotalmartinez avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.