<?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: deveshprojectwork</title>
    <description>The latest articles on DEV Community by deveshprojectwork (@deveshprojectwork).</description>
    <link>https://dev.to/deveshprojectwork</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%2F369946%2Fcd728e8b-bc80-47c7-a09e-f76d03229675.png</url>
      <title>DEV Community: deveshprojectwork</title>
      <link>https://dev.to/deveshprojectwork</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/deveshprojectwork"/>
    <language>en</language>
    <item>
      <title>Difference Between Angular and React</title>
      <dc:creator>deveshprojectwork</dc:creator>
      <pubDate>Mon, 31 Aug 2020 12:07:24 +0000</pubDate>
      <link>https://dev.to/deveshprojectwork/difference-between-angular-and-react-2cgo</link>
      <guid>https://dev.to/deveshprojectwork/difference-between-angular-and-react-2cgo</guid>
      <description>&lt;p&gt;Angular vs React – Difference Between Angular and React&lt;br&gt;
If you are a web developer and stumbling around which platform should you choose for your next project, Angular or React? Then, you are at the correct place. Also, if you are a beginner in web development, you will surely come across with Angular and React soon.&lt;/p&gt;

&lt;p&gt;In this article, we are going to discuss what Angular and React is? What are their key differences, similarities, and various other factors to get a better understanding.&lt;/p&gt;

&lt;p&gt;So, let’s get started.&lt;/p&gt;

&lt;p&gt;What is Angular and React?&lt;br&gt;
Angular is a complete structural framework for development of dynamic web pages and web applications. It is a JavaScript framework developed and maintained by Google that is written in Typescript. Angular is a complete rewrite of Angular JS which was introduced in 2010. Also, Angular has a different syntax format and instead of controllers it uses a hierarchy of components for its architecture.&lt;/p&gt;

&lt;p&gt;React popularly known as React.js or React JS is an open source JavaScript library developed and maintained by Facebook. It is basically used for developing single page or application as it can fetch rapidly changing data and record them. It was introduced in 2013 and was described as a JavaScript library for building user interfaces.&lt;/p&gt;

&lt;p&gt;Both Angular and React frameworks are developed and available under MIT license.&lt;/p&gt;

&lt;p&gt;Angular vs React&lt;br&gt;
Angular vs React - Difference Between Angular and React&lt;/p&gt;

&lt;p&gt;Architecture&lt;br&gt;
Angular and React both have many similarities and differences. If we compare Angular with React, then we see that Angular is completely a MVC (Model View Controller) framework as it helps in building the structure of application but React is just a JavaScript library – only the view.&lt;/p&gt;

&lt;p&gt;On the other hand, React gives you complete flexibility for choosing any of your own library as you wish to. In addition, it also provides JSX and XML templates instead of just classic templates as in Angular.&lt;/p&gt;

&lt;p&gt;Angular does not gives you much flexibility as React. You have to only use what angular provides.&lt;/p&gt;

&lt;p&gt;Data Binding&lt;br&gt;
This is one the major differences between Angular and React. Angular uses two-way data binding while React uses one-way data binding.&lt;/p&gt;

&lt;p&gt;Let me explain you by a simple example – In two-way data binding, if a user input changes than the state of the model changes as well. And if you change the state of model then the corresponding input changes. This is how two-way data binding works.&lt;/p&gt;

&lt;p&gt;React uses one-way binding. In this first we have to update the model state and then only we can change the user input. However, if we change the user element it will not affect the model state.&lt;/p&gt;

&lt;p&gt;Parent Technology&lt;br&gt;
Angular uses Typescript language while React uses JavaScript language. Both languages are different in a way that JavaScript is a dynamic language rather than Typescript which is static language.&lt;/p&gt;

&lt;p&gt;In JavaScript we don’t have to define the variable type like string, char, int etc. It dynamically allocates memory to the variable. While in Typescript, we have to statically define the variable type.&lt;/p&gt;

&lt;p&gt;The Angular uses Typescript as it provides smooth transition for programmers.&lt;/p&gt;

&lt;p&gt;DOM (Document Object Model)&lt;br&gt;
Angular uses regular DOM in comparison to React which uses Virtual DOM. Virtual DOM helps in increasing the speed of changing and updating the data without changing the structure.&lt;/p&gt;

&lt;p&gt;While on the other hand in regular DOM, the whole structure needs to be updated until we reach the data that needs to be updated. This leads to slow performance of Angular than React.&lt;/p&gt;

&lt;p&gt;Difference Between Angular and React&lt;br&gt;
Basis   Angular React&lt;br&gt;
Developed By    Google  Facebook&lt;br&gt;
Platform    Complete MVC framework for building web pages and applications  JavaScript Library for developing single page&lt;br&gt;
Templates   HTML templates  JSX, XML templates&lt;br&gt;
Data Binding    Uses two-way data binding   Uses one-way data binding&lt;br&gt;
DOM Regular DOM Virtual DOM&lt;br&gt;
Language Used   Typescript  JavaScript and JSX&lt;br&gt;
Flexibility Only Angular tools can be used  Provides option to choose any templates&lt;br&gt;
State Management    No need of Redux until the requirement is high enough   Redux is used for state management&lt;br&gt;
Google Trends&lt;br&gt;
According to google search trends React is more popular than Angular. The does not mean Angular is not good, both have there own advantages and disadvantages.&lt;/p&gt;

&lt;p&gt;Final Thoughts&lt;/p&gt;

&lt;p&gt;Both Angular and React are widely used by professional developers, businesses, and various other companies worldwide. Angular is a complete framework and has always gained popularity since its release. And same applies on React too, but its not a framework rather it’s just a library to view.&lt;/p&gt;

&lt;p&gt;React and Angular are two different things, but still they both are compared because they are the most widely used technology for developing web pages and applications. React has some amazing features, that’s the reason it is compared to Angular.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>8 React Application Deployment and Hosting Solutions for 2020</title>
      <dc:creator>deveshprojectwork</dc:creator>
      <pubDate>Mon, 31 Aug 2020 10:21:18 +0000</pubDate>
      <link>https://dev.to/deveshprojectwork/8-react-application-deployment-and-hosting-solutions-for-2019-4eb</link>
      <guid>https://dev.to/deveshprojectwork/8-react-application-deployment-and-hosting-solutions-for-2019-4eb</guid>
      <description>&lt;h2&gt;
  
  
  Table Of Contents
&lt;/h2&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    * 1. Firebase Hosting
    * 2. Github Pages
    * 3. Netlify
    * 4. Heroku
    * 5. Now
    * 6. Surge
    * 7. AWS S3
    * 8. Roast
    * Conclusion
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Useful solutions for deploying and hosting your React applications in After working in your development environment and playing around with localhost, you most likely would need to build out your react application to become production ready and deploy it for everyone to experience the react goodness in their local machines too. In this article, we would look at a number of options to developers quickly pick from to deploy their react applications.&lt;br&gt;
Useful tip: Bit helps your team collaborate on shared components. Each component can be independently developed, tested and used across your apps. Bit handles the entire lifecycle of each shared component so you can focus on building great apps.&lt;br&gt;
Share reusable code components as a team · Bit&lt;br&gt;
Easily share reusable components between projects and applications to build faster as a team. Collaborate to develop…&lt;br&gt;
bit.dev&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Firebase Hosting &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Firebase Hosting is part of the many services Google’s firebase offers like authentication, storage, cloud functions and even database. This is basically a static site hosting that would be perfect for any frontend react application, it also supports SSL, CDN and custom domains.&lt;br&gt;
To use firebase hosting:&lt;br&gt;
    § Ensure you have a google account&lt;br&gt;
    § Login to Firebase Console&lt;br&gt;
    § Create a project&lt;br&gt;
    § Navigate to the hosting tab and click get started.&lt;br&gt;
After this, you proceed to install firebase cli on your terminal with this line of command:&lt;br&gt;
npm install -g firebase-tools&lt;br&gt;
This would install firebase tools globally and you can now deploy using these commands sequentially in your terminal:&lt;br&gt;
// cd to your project folder&lt;br&gt;
firebase init firebase deploy&lt;br&gt;
Firebase would deploy your application to yourProjectName.firebaseapp.com&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Github Pages&lt;br&gt;
React applications by default when you build out for production gives you github pages as a great deployment option. Github pages is a deployment service by github that builds and deploys your react application straight from the application repository with a smooth git integration, it is such a breeze to use. When you run:&lt;br&gt;
yarn build &lt;br&gt;
React builds out your application for production and afterward shows you a suggestion if you choose to use github pages. Copy the homepage description given, it would look like this:&lt;br&gt;
“homepage” : “&lt;a href="https://yourgithubname.github.io/yourreponame"&gt;https://yourgithubname.github.io/yourreponame&lt;/a&gt;",&lt;br&gt;
Add it to your package.json file, then re-run the build command:&lt;br&gt;
yarn build&lt;br&gt;
Go to the package.json and add a new line under scripts&lt;br&gt;
“deploy”: “gh-pages -d build”&lt;br&gt;
Then deploy with oneline of command:&lt;br&gt;
npm run deploy&lt;br&gt;
Open the homepage on your browser and see the react application is live.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Netlify&lt;br&gt;
Deploying with Netlify is one of the the trendiest ways to put your react application out in the universe. Netlify provides a very stress-free and easy-to-use interface where you literally just click and select options and configure deployments and build your app from a development environment from a repository like github, you can even test deploys and also get support for A/B testing from the same user interface.&lt;br&gt;
To get started:&lt;br&gt;
§ create a netlify account&lt;br&gt;
§ login to the created account&lt;br&gt;
§ click new site from git on the top right corner.&lt;br&gt;
§ choose github (if that’s where your project is)&lt;br&gt;
§ follow the prompt to add navigation and test deploy&lt;br&gt;
§ hit deploy site button&lt;br&gt;
This can be achieved manually too in your terminal with a few commands&lt;br&gt;
npm install netlify-cli -g netlify deploy&lt;br&gt;
And you would have a netlify.com project deployed successfully.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Heroku&lt;br&gt;
Heroku, an industry leading cloud-platform-as-a-service that handles a number of cloud based operations which includes building, managing and deployment of applications is a great place to start deploying your react application. If you wish to use create-react-app to build out your react application, here is an easy way to deploy it on heroku:&lt;br&gt;
§ create a heroku account&lt;br&gt;
§ login to the created account&lt;br&gt;
You can now open your terminal and run the following commands below:&lt;br&gt;
npm install -g create-react-app&lt;br&gt;
create-react-app my-app&lt;br&gt;
cd my-app&lt;br&gt;
git init&lt;br&gt;
heroku create -b &lt;a href="https://github.com/mars/create-react-app-buildpack.git"&gt;https://github.com/mars/create-react-app-buildpack.git&lt;/a&gt;&lt;br&gt;
git add .&lt;br&gt;
git commit -m "react-create-app on Heroku"&lt;br&gt;
git push heroku master&lt;br&gt;
heroku open&lt;br&gt;
After this, you have successfully deployed your react application, check your dashboard for the application link.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now&lt;br&gt;
Ziet’s Now is a revolutionary serverless deployment service for various kinds of applications including react applications all the way to node applications. It provides a very robust support for the CLI also and it is smoothly integrated with github. To get started:&lt;br&gt;
§ install now desktop here (it ships with the cli tool)&lt;br&gt;
alternatively use npm:&lt;br&gt;
npm install -g now&lt;br&gt;
§ Create a new account on now&lt;br&gt;
§ Login with the newly created account.&lt;br&gt;
To deploy a react application, navigate to the root folder of your built project and run the now command in the terminal:&lt;br&gt;
now --name your-project-name&lt;br&gt;
A now.json file should appear in the root folder looking like this:&lt;br&gt;
{&lt;br&gt;
"version": 1,&lt;br&gt;
"type": "static",&lt;br&gt;
"static": {&lt;br&gt;
"rewrites": [&lt;br&gt;
{&lt;br&gt;
"source": "**",&lt;br&gt;
"destination": "/index.html"&lt;br&gt;
}&lt;br&gt;
]&lt;br&gt;
}&lt;br&gt;
}&lt;br&gt;
Follow the prompt and you will successfully deploy your application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Surge&lt;br&gt;
Surge is a very popular hosting service for static applications like react applications tastefully targeted at frontend web developers. The free plan supports custom domains, making it a really great option for deploying react applications. To get started:&lt;br&gt;
§ install surge using npm&lt;br&gt;
npm install -g surge&lt;br&gt;
§ build out your react application&lt;br&gt;
cd your-react-project npm run build&lt;br&gt;
§ navigate to build folder&lt;br&gt;
cd build&lt;br&gt;
§ run surge&lt;br&gt;
surge&lt;br&gt;
Follow the prompt and you will be given a surge url where your react application is live at.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AWS S3&lt;br&gt;
Amazon web services has a suite of cloud services to support every single part of software development cycle. They have a couple of services for deployment of web applications and S3 is one of the less complicated one to use. It is often said that a lot of amazon web services sacrificed simplicity of getting started for flexibility of usage. There is however a cli tool built by a community member for easily deploying your react application to the amazon s3 service called s3cmd. To get started:&lt;br&gt;
§ sign up to aws services&lt;br&gt;
§ login to the created account&lt;br&gt;
§ open an s3 bucket according to your preferable data point/center&lt;br&gt;
§ Download s3cmd here&lt;br&gt;
Note: Amazon web services has an AWS CLI tool but we are using the s3cmd tool in this article&lt;br&gt;
Alternatively, if you have homebrew, you can install with this line of command:&lt;br&gt;
brew install s3cmd&lt;br&gt;
You need the access keys of the bucket for the next step. To get the keys lookup this guide.&lt;br&gt;
When you have gotten the keys, run this line of command to use them:&lt;br&gt;
s3cmd --configure&lt;br&gt;
when prompted, paste in the keys you already got. We go ahead to list all our buckets with this command:&lt;br&gt;
s3cmd ls&lt;br&gt;
Now let us build out ur react application&lt;br&gt;
yarn build&lt;br&gt;
To synchronise the build folder with our s3 bucket, we run this:&lt;br&gt;
s3cmd sync LOCAL_DIR s3://BUCKET[/PREFIX]&lt;br&gt;
And your react application would be automatically deployed to your s3 bucket successfully. After making any changes, just re-run the following commands:&lt;br&gt;
yarn builds3cmd sync build/* s3://reactApp&lt;br&gt;
To make it even a little easier, you can add these commands to your package.json file so that you can run it all like a yarn command&lt;br&gt;
"build-deploy":"yarn build &amp;amp;&amp;amp; s3cmd sync build/* s3://reactApp &amp;amp;&amp;amp; echo 'Deployed Successfully' "&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Roast&lt;br&gt;
Roast is a content delivery network static web host you can use to deploy your react applications. It is built with speed and simplicity in mind with provisions for https and full-page server-side render. To get started:&lt;br&gt;
§ Create an account on roast here&lt;br&gt;
§ login with your new account.&lt;br&gt;
§ Install the Roast CLI tool&lt;br&gt;
npm install -g roast&lt;br&gt;
Then build out your react application:&lt;br&gt;
yarn build&lt;br&gt;
Add a _redirects file. See a guide here. When that is done, you can deploy your react application by running a line of command:&lt;br&gt;
roast deploy&lt;br&gt;
You would see your react application live with a roast url.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Conclusion&lt;br&gt;
In this article we took a good look at some easy options react developers should know they have when it comes to deployment of their react applications. You can finally just take that new step of stepping out of the localhost comfort zone and deploy your application for the world to see too. Happy Coding! 👏&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Rail Setup</title>
      <dc:creator>deveshprojectwork</dc:creator>
      <pubDate>Thu, 30 Apr 2020 19:26:02 +0000</pubDate>
      <link>https://dev.to/deveshprojectwork/rail-setup-jab</link>
      <guid>https://dev.to/deveshprojectwork/rail-setup-jab</guid>
      <description>&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  ## Rail Setup
    $ rails new &amp;lt;app&amp;gt;
    * $ bundle update - this will update the GEM, already created in first command
    $ rails generate scaffold username:string password:string
           1. $ rails generate scaffold recipe
    $ rake db:migrate RAILS_ENV=development
    $ rails db:migrate - run the script on the local server
    $ rails new &amp;lt;app&amp;gt;
    $ bundle update - this will update the GEM, already created in first command
    $ rails generate scaffold username:string password:string
    $ rails generate scaffold recipe
    $ rake db:migrate RAILS_ENV=development
    $ rails db:migrate - run the script on the local server

    $ Inside HTML
      &amp;lt;% tweet = Tweet.fin(1) %&amp;gt;  this will not be shown on the HTML
      &amp;lt;h1&amp;gt;&amp;lt;%= tweet.status %&amp;gt;&amp;lt;/h1&amp;gt;  this will print on the HTML screen

    $ layout 
      to the /app/views/layouts/application.html.erb/
      &amp;lt;html&amp;gt;
          &amp;lt;body&amp;gt;
            &amp;lt;%= yield %&amp;gt;   {this will take all the other page &amp;amp;rest layout }
          &amp;lt;/body&amp;gt;
      &amp;lt;/html&amp;gt;


  ### Chapter 1 &amp;lt;a name="chapter-1"&amp;gt;&amp;lt;/a&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;
  
  
  Scaffold
&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    * $ rails new &amp;lt;app&amp;gt;
    * $ bundle update - this will update the GEM, already created in first command
    * $ rails generate scaffold username:string password:string
    * $ rails generate scaffold recipe
    * $ rake db:migrate RAILS_ENV=development
    * $ rails db:migrate - run the script on the local server
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Change to Config/routes.rb by -: &lt;/p&gt;

&lt;h2&gt;
  
  
  Destroy Scaffold &amp;amp; Text Genration
&lt;/h2&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    $ root to: 'users#index'
    $ get 'about', to:'pages#about'
    $ $ rails -s -: run the application

    $ rails destroy scaffold &amp;lt;app&amp;gt; or rails d scaffold books - Destroy
    $ rails generate controller pages index contact about -: generate the controller
    $ rails new myapp --database=postgresql
    $ render plain: 'hello'
    $ puts 'hello'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;
  
  
  Calling the Gem for rest-client(API)
&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    $ gem install rest-client
    $ bundle update

    $ rails routes
    $ rails generate model book title:string author:string
    $ rails generate controller book
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;
  
  
  Debug
&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. &amp;lt;%= debug(params) %&amp;gt;
2. &amp;lt;%= debug(@data) %&amp;gt;
3. rails c
4. Google Developer
5. buy bug
6. Pry Gem 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Error :uninitialized constant LoginController Did you mean? LoginsController&lt;br&gt;
Change delete 'logout', to: 'login#destroy' to delete 'logout', to: 'logins#destroy&lt;/p&gt;

&lt;p&gt;rails new myApp --skip-active-record&lt;br&gt;
&lt;a href="https://codeburst.io/how-to-build-a-good-api-using-rubyonrails-ef7eadfa3078"&gt;https://codeburst.io/how-to-build-a-good-api-using-rubyonrails-ef7eadfa3078&lt;/a&gt;&lt;/p&gt;

</description>
      <category>rail</category>
    </item>
    <item>
      <title>JavaScript Cheat Sheet</title>
      <dc:creator>deveshprojectwork</dc:creator>
      <pubDate>Mon, 27 Apr 2020 05:35:10 +0000</pubDate>
      <link>https://dev.to/deveshprojectwork/javascript-cheat-sheet-b44</link>
      <guid>https://dev.to/deveshprojectwork/javascript-cheat-sheet-b44</guid>
      <description>&lt;p&gt;&lt;strong&gt;Variable Declaration&lt;/strong&gt;&lt;br&gt;
var x = 5;&lt;br&gt;
var y = 10;&lt;br&gt;
var length = 16;&lt;br&gt;&lt;br&gt;
var lastName = "Johnson";&lt;br&gt;&lt;br&gt;
var x = {&lt;br&gt;
  firstName: "Bean",&lt;br&gt;
  lastName: "Cam"&lt;br&gt;
};&lt;br&gt;&lt;br&gt;
document.getElementById("demo").innerHTML = x + y;&lt;br&gt;
document.getElementById('demo').innerHTML = 'Hello JavaScript';&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WRITE AND ALERT&lt;/strong&gt;&lt;br&gt;
document.write('hello world');&lt;br&gt;
window.alert('Hello World'); or alert('Hello World');&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Calling function&lt;/strong&gt;&lt;br&gt;
myFunction(){&lt;br&gt;
  alert('Hello World')&lt;br&gt;
}&lt;br&gt;
&amp;lt;'button onclick="myFunction()"&amp;gt;Click me.&lt;/p&gt;

&lt;p&gt;function toCelsius(fahrenheit) {&lt;br&gt;
  return (5/9) * (fahrenheit-32);&lt;br&gt;
}&lt;br&gt;
&amp;lt;'p id='demo'&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;br&gt;
document.getElementById("demo").innerHTML = toCelsius(77);&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Array&lt;/strong&gt;&lt;br&gt;
var cars = ["Saab", "Volvo", "BMW"];&lt;br&gt;
var x = cars[1];&lt;br&gt;
cars.sort()&lt;/p&gt;

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