edutechional
Watch how to run the Rails scaffold generator to build out the CRUD functionality for the application. Go through the full Scaffold guide here: http://rails.devcamp.com/rails-project-photo-uploader-tutorial/ruby-on-rails-application-creation/how-to-use-the-scaffold-generator-in-rails
updated 8 years ago
Objectives:
- Install the React Sliding Pane library
- Utilize React hooks to manage the pane’s visibility
- Implement CSS overrides to customize the styles for the sliding pane
- Configure the React Sliding Pane size to dynamically change based on screen size
Code:
github.com/bottega-code-school/workshop-react-sliding-pane
- Generate text based SVGs in HTML
- Build animations for text based SVGs
- Apply custom colors to SVGs with CSS
- Work with the viewport values for SVGs in HTML
Source code:
github.com/bottega-code-school/workshop-html-animated-text
SVG Documentation:
developer.mozilla.org/en-US/docs/Web/SVG/Element/svg
digitalocean.com/community/tutorials/svg-svg-viewbox
developer.mozilla.org/en-US/docs/Web/SVG/Element/defs
- Create React Context and Provider components to share data throughout an application.
- Render the pages a user can access based on a user’s login status.
- Build a login form that communicates with an API server to create a secure authentication session.
Source code:
github.com/bottega-code-school/workshop-react-context-auth
After completing this workshop, you'll be able to:
- Implement React hooks to keep track of mouse and page element position values
- Build a React component with the ability to override the default browser cursor
- Integrate a custom cursor in an image slider
Source code:
github.com/bottega-code-school/workshop-react-mouse-screen-hooks
After completing this React tutorial, you'll be able to:
- Model a React component that can take a collection of child components.
- Build React state behavior that allows for toggling between different layout types.
- Utilize React Router to keep track of a page's state
- Implement click handlers that auto filter data
- Configure a select field in React to communicate with a component’s local state
Source code:
github.com/bottega-code-school/workshop-react-dynamic-list
After going through this videos, you will be able to:
- Work with the qrcode.react library
- Build a component that generates QR codes that point to URLs
- Customize a generated QR code's styles
- Implement the ability to embed images into a QR code
- Create a function that programmatically downloads the QR code using HTML canvas tags and JavaScript's toDataURL function
Starter code:
github.com/bottega-code-school/workshop-qr-code/tree/starter
Final version:
github.com/bottega-code-school/workshop-qr-code
After completing this workshop, you will be able to:
- Configure a React application to utilize drag and drop tooling
- Work with an array of objects in React and render them to the screen
- Build out drag and drop components that update the position of page components
- Model how a position change could communicate with a server via an API call
- Utilize React hooks to update data on the page
- Work with React refs and the context API
- Use TypeScript in a React application
Starter code:
github.com/bottega-code-school/coding-workshop-react-drag-and-drop/tree/starter
Final version code:
github.com/bottega-code-school/coding-workshop-react-drag-and-drop/tree/master
After going through this Scss coding workshop, you will be able to:
- Create CSS keyframes to define animation rules
- Build Scss mixins that allow for calling the animations throughout an application
- Implement CSS classes that call Scss animation mixins
- Integrate the animations into a React JS application
Source code:
github.com/bottega-code-school/workshop-scss-animations
CSS animation documentation:
developer.mozilla.org/en-US/docs/Web/CSS/CSS_Animations/Using_CSS_animations
Animation generator:
animista.net
- Build a function that retrieves data from an API
- Implement a JSON parsing system for extracting data from an API
- Populate API data into a component's state using React hooks
- Render API data onto the screen
You can access the source code here:
github.com/bottega-code-school/workshop-api-introduction
This coding workshop was performed for students of Bottega University:
https://bottega.edu/
- Integrate JavaScript Listeners
- Utilize the useState hook to keep track of component’s state
- Work with the useEffect hook to dynamically update a component’s state
- Build a custom hook that enables responsive behavior in React
Starter code:
github.com/bottega-code-school/workshop-react-hooks-introduction/tree/starter
Final version:
github.com/bottega-code-school/workshop-react-hooks-introduction
- Quickly navigating to specific directories
- Automatically creating or accessing files from anywhere on your system
- Startup servers
- Easily access data that you need to access on a regular basis
- A function to capitalize a single word
- A function that splits a sentence up into separate elements, capitalizes each word and then returns the formatted string
Source code:
github.com/jordanhudgens/typescript-4-course/blob/main/capitalize.ts
Source code:
github.com/jordanhudgens/ruby-3/blob/master/qr_generator.rb
- Design a pricing table
- Utilize object-fit to get images of varied sizes to fit in a layout
- Utilize advanced techniques for managing border radius styles
- Implement media queries for mobile responsive behavior
- Build a tooltip feature using HTML and CSS
Source code:
github.com/bottega-code-school/workshop-html-css-tooltip
Source code: github.com/jordanhudgens/react-client-dashboard/tree/260f740bcf5ae4dcd532dc20ce274431bea02541
- Upgrade to the latest versions of React Router and React Router Dom
- Create React functional components that can be used as pages
- Define routes
- Work with the Link tag to link between pages
- Organize components and call them from separate files
React router documentation: reactrouter.com/web/guides/quick-start
Source code: github.com/jordanhudgens/react-client-dashboard/tree/79348d358e6e4a3dd10eea43d41f3acd6fa4e956
Cursor generator: cursor.cc
HTML and CSS Cursor documentation: developer.mozilla.org/en-US/docs/Web/CSS/cursor
Video where I show how to build the Stack class:
youtube.com/watch?v=LDVg4m2PpTg&t=7s
Source code:
github.com/jordanhudgens/algorithms-in-python/blob/master/stacks/reverse_string_with_stack.py
- Ensuring that data render attempts are only attempted after an application receives data from an API
- Allows for cleaner, more maintainable code since the conditionals can be built directly into the program instead of having to build 'guard' based conditionals.
- Preventing errors from occurring when a server sends unexpected data
Source code:
gist.github.com/jordanhudgens/594f96cfd50475331eedde28e2be3edb
- Understand the difference between Classes and Modules in Ruby
- Build out Ruby modules
- Work with nested modules
- Combine Classes and Modules
- See how modules can be used in large-scale, production Rails applications
Source code:
github.com/jordanhudgens/ruby-3/blob/master/ruby_modules.rb
- How to render an array of items with React
- The importance of the key prop and React's performance based diffing engine
- How to define a set of types and interfaces with TypeScript to describe the rules that the application needs to follow
- How to implement inline styles with React
Source code:
github.com/jordanhudgens/introduction-react-typescript-applications/tree/046c12a459de5fb79e52770362bcb31d9a9ef10c
Source code:
github.com/jordanhudgens/introduction-react-typescript-applications/tree/57747ec707f03b8c0a0dd0b397b1d2da55843e68
- Automatically configured to run TypeScript 4+ code
- Example React components that utilize hooks
- Webpack setup for development and production environments
- Loader integration for TypeScript, React, assets and Scss compilation
- Pre-configured to allow for deploying to React applications to Heroku
Here is the NPM page with the installation instructions:
npmjs.com/package/devcamp-js-builder
Source code: github.com/jordanhudgens/ruby-3/blob/master/keyword_arguments.rb
- Building out the initial data structure
- Creating the push method to add an item to the stack
- Creating the pop method to pull an item from the stack
- Along with showing the difference between the push and peek processes
Source code: github.com/jordanhudgens/algorithms-in-python/blob/7f902d5dbadd3f34c8cef4c8f7b1451d232b116e/stacks/stack.py
Online python coding environment: https://repl.it/
- How to create a Kanban based project management board on GitHub
- Automation tools for marking tasks as complete
- How to utilize checklists for sub tasks
- Utilizing labels for filtering project topics
After going through this code tutorial, you'll be able to:
- Implement a website layout using both Flexbox and CSS Grid elements
- Work with CSS variables
- Build animated styles into websites
Starter code: github.com/jordanhudgens/workshop-html-css-flipping-cards/tree/starter
Finished project: github.com/jordanhudgens/workshop-html-css-flipping-cards
This is a recording from a live workshop for the Bottega Code School, go to https://bottega.edu for more information.
Gemfiles can actually be used by any type of Ruby application so, it's not specific to Rails. But what we're going to walk through in this lesson is going be specific to a Rails app, and we'll walk through exactly what a Gemfile does. And then we're gonna see how we can use it by installing an actual dependency into the project.
What we're gonna look at are the tools like React Native, the Expo.io framework, the Swift programming language, and then Java and Android Studio. We'll look at code examples, and at the very end of the guide, we're gonna through a pro and con list between those two options.
If you want to learn React Native from the ground up, you can go through it with me in the comprehensive mobile development training track from the Bottega Code School, you can learn more here: https://bottega.tech/mobile-development/
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
We'll walk through how to find the version of postgres installed on your machine along with the pg_config file. We'll also run the gem install pg command with the pg_config path flag.
You can checkout my full Vim course on Udemy:
udemy.com/user/jordanhudgens
This is tutorial 10 out of 10 in the course, please check out the React + Rails API Authentication playlist for the full course, all for free!
Source code:
github.com/jordanhudgens/react-auth-app
Source code:
github.com/jordanhudgens/react-auth-app
This will utilize tools such as Axios, HTTP requests, React JS, and Ruby on Rails.
This guide is 8 of 10 in the Ruby on Rails + React JS authentication course.
Source code:
github.com/jordanhudgens/react-auth-app
This is part 7 out of 10 in the Ruby on Rails + React JS authentication course.
Source code:
github.com/jordanhudgens/react-auth-app
This is part 5 of 10 in the Ruby on Rails + React Authentication course. Checkout the playlist for all of the course videos.
GitHub course code:
github.com/jordanhudgens/react-auth-app
Resources:
Application source code: github.com/jordanhudgens/react-auth-app
React app generator library: npmjs.com/package/devcamp-js-builder
The full source code can be found here:
github.com/dev-guides/rails-api-authentication
In this guide we are gonna build out the registrations controller so users can create accounts in our system via the Ruby on Rails API. This will enable the the React application to create user accounts in the Ruby on Rails app.
In this guide we're going to extend the Rails API application and build out the User model so that it can securely create a username and password that users will be able to work with to sign in, register, and logout.
Full guide here:
crondose.com/2019/04/building-the-user-model-and-session-controller-for-the-rails-api-authentication-app
Now we are going to be implementing HTTP only cookie authentication. There are two popular types of authentication. One is to use HTTP only cookies. The other is to use what are called JWT tokens. Now I prefer to use HTTP only cookies, mainly because it leads to a much more straight forward interface.
With JWT tokens, you generate these randomized encrypted tokens and then both sides of the application have to do quite a bit of work to one, make sure that the tokens are still accurate and that they're still matching, that they haven't been hijacked and the front end application has to store it in local storage or something like that.
And then the back end constantly has to check that, and it feels like that's not really the best fit, especially if you're a rails developer. With rails, you have the ability to utilize the session and so what the session does, if you're familiar with MVC applications, you can store anything you want in a session, such as if a user's logged in or not, and what we can do with an API can actually take advantage of this same exact set of features. So we can use the session the same way we would with a traditional MVC app, even though it's an API.
So we're gonna walk through all of the steps needed in order to do that. In this guide, we're going to generate a Rails API application from scratch, and we're going to add the dependencies needed for building our own authentication.
Full guide here:
crondose.com/2019/04/ruby-on-rails-app-creation-and-initial-configuration
Now, we're going to analyze the lifecycle diagram, and then go and implement this into a Vue application. We're also going to extend it, because this lifecycle set of hooks and what they list in the documentation is helpful for understanding, because it's a helpful visual. But I think that it's missing a couple of elements that I personally have had to implement into my own production Vue applications, and so I think it will help for you to see those as well. So we're gonna walk through quite a bit of material in this guide.
So I have a Vue application running right here in the background, and we're going to be looking primarily just at a few different components. So we're going to be looking at a dashboard component, a Vue component right here, and then that has the nested login component.
And so what we're gonna be doing isn't as much building in this guide, we're instead gonna be looking and analyzing to see how exactly the lifecycle process works.
If you are not aware of this, if you've never heard of the lifecycle, or if you're just trying to understand it for the first time, the best analogy that helped me is trying to compare a Vue component to us humans.
So as a human, we are born, we go through different stages in life, and then, even though it may seem dark, we all die at some point. Well, that's the way a Vue component works too. A Vue component is born. We say that a Vue component is created, then it has a number of things happen. It has changes go on, such as data changes, and updates, and those kinds of. And then at a certain time, it also dies, or we say that it is destroyed.
So what we can do with Vue is we can actually listen for and capture those events, each one of those, from created all the way through destroyed, and then update the application based on the state of the component.
So hopefully that starts to make sense. But what really help understand the lifecycle hooks and the entire process was really just getting in and implementing each one of the methods.
I'll provide in the show notes a link to this documentation, 'cause that can help to have a visual. But I think what helps the most is just going in and writing the code.
So I'm going to switch back to our application here, and then opening up Visual Studio code here, you can see that we have our homepage component, which is just rendering out some content, and then our login component. And that's pretty much it. That's pretty basic right now.
So we're gonna start in the dashboard, and I'm gonna go out, and I'm gonna start listing some of these hooks. Now, right now we have a pretty basic setup where we have our data function, then we have a list of the components that we are registering, and then we have one custom method. I usually by convention place these lifecycle hooks right above the methods, I like to have my methods at the very bottom, so I know exactly where they're at. But you could technically put these anywhere inside of the script tag, as long as it's right after the default curly braces.
Now, I'm going to just list off a couple basic ones here first. So I'm gonna say beforeCreate(), and it is a regular method, so you have to have the parens right after it. And then I'm going to console.log and then say beforeCreate, just so we know exactly what's happening here. And then for this one, I'm also gonna say this afterwards, 'cause this can be really helpful in understanding what we're referencing. And then make sure you put a comma there. And then after that say created.
Now, unlike some other methods or names inside of Vue, these are reserved words. So before create is something provided by Vue directly. Created is something provided by Vue. So these are reserved and they are names and functions that are built directly into the Vue source code.
I'm going to copy this console log here, and then change this to say created. And I'm not gonna pass in this or else it'll make the output a little bit messy, and you'll notice that the this that it's referencing is gonna be the same for all these elements.
So let's just start with these two, and then we'll get into some of the other ones after this. So switching back to the browser, I'm going to clear the output, hit refresh, and now you can see that we have some console log statements here. We have before create, and then created. So both of these worked. So they were triggered. Notice that we didn't do anything. All we did was we listed them out inside of the component.
#vuejs #javascript
Full guide and code:
crondose.com/2018/10/comprehensive-guide-to-the-vue-js-component-lifecycle-hooks
Follow me:
Twitter: twitter.com/jordanhudgens
Instagram: instagram.com/jordanhudgens
GitHub: http://github.com/jordanhudgens