Tuesday, April 9, 2019

React

React is a JavaScript library for building user interfaces created by Facebook.
It is maintained by Facebook and a community of individual developers and companies.
React is a tool for building UI components

What is Babel?

  • Babel is a JavaScript compiler that can translate markup or programming languages into JavaScript.
  • Babel is available for different conversions. React uses Babel to convert JSX into JavaScript.

What is JSX?

  • JSX stands for JavaScript XML.
  • JSX is an XML/HTML like extension to JavaScript.


    What are components?

    • Components are the building blocks of any React app and a typical React app will have many of these. Simply put, a component is a JavaScript class or function that optionally accepts inputs i.e. properties(props) and returns a React element that describes how a section of the UI (User Interface) should appear.
      • Sample
        • const Greeting = () =>  <h1>Hello World today!</h1> ;
          • Out put is Hello World Today!
    <p>Referance : https://www.fiverr.com/muhammad_sarmad/develop-and-fix-reactjs-web-application </p>
    <p>react.js </p>







    What is Express?

    Express is a minimal and flexible Node.js web application framework that provides a robust set of features to develop web and mobile applications. It facilitates the rapid development of Node based Web applications. 

    •  Features of Express framework
      • Allows to set up middlewares to respond to HTTP Requests.
      • Defines a routing table which is used to perform different actions based on HTTP Method and URL.
      • Allows to dynamically render HTML Pages based on passing arguments to templates.
    •  How to install Express in ubuntu
      • $ npm install express --save
    • body-parser
      • This is a node.js middleware for handling JSON, Raw, Text and URL encoded form data.
      • $ npm install body-parser –save
    • cookie-parser
      •  Parse Cookie header and populate req.cookies with an object keyed by the cookie names.
      • $ npm install cookie-parser –save
    • multer
      • This is a node.js middleware for handling multipart/form-data.
      • $ npm install multer --save
    Reference: https://www.tutorialspoint.com/expressjs/ 
               https://blog.vanila.io/setup-basic-server-with-express-framework-37b

    Sunday, February 17, 2019

    AJAX

    What is AJAX?

    • AJAX = Asynchronous JavaScript And XML.
    • AJAX is not a programming language.
    • AJAX just uses a combination of:
      • A browser built-in XMLHttpRequest object (to request data from a web server)
      • JavaScript and HTML DOM (to display or use the data)

    How AJAX Works


    The XMLHttpRequest Object

    • All modern browsers support the XMLHttpRequest object.
    • Create an XMLHttpRequest Object

    ER diagram

    What is an ER diagram?

    An Entity Relationship (ER) Diagram is a type of flowchart that illustrates how “entities” such as people, objects or concepts relate to each other within a system. ER Diagrams are most often used to design or debug relational databases in the fields of software engineering, business information systems, education and research. Also known as ERDs or ER Models, they use a defined set of symbols such as rectangles, diamonds, ovals and connecting lines to depict the interconnectedness of entities, relationships and their attributes. They mirror grammatical structure, with entities as nouns and relationships as verbs.

    Uses of entity relationship diagrams

    • Database design
    • Database troubleshooting

    The components and features of an ER diagram

    • Entity
    • Relationship
    • Attribute
    • Cardinality

    ERD symbols and notations

     Referance: image :- https://www.smartdraw.com/entity-relationship-diagram/
                         https://stackoverflow.com/questions/1154382/anyone-have-an-erd-symbols-quick-reference 
     More Informations : https://www.lucidchart.com/pages/er-diagrams?a=0

    Monday, February 4, 2019

    Node.js MongoDB

    Now a days all web based application has some database to store the data at the back end.
    Nodejs frame work have the ability to work with both relational and non relational database.

    Node.js MongoDB 

    NoSQL database mongodb quite fame because of its ability to store the any sort of data at any format.In order work we have to download required module.Mongodb required the module to be installed is mongoose.And also with these modules we can perform many operations.Before that we have to get start mongodb in nodejs.
    1.Install MongoDB Driver
    * We can download from official mongodb driver or open in terminal and execute it
        npm install mongodb

    * Node.js used this module to manipulate mongodb database.
      var mongo = require('mongodb');

    2.Node.js MongoDB Create Database

    To create a database:
    1.Create the Mongoclient object
    2.Specify the url connection (correct ip address and name of the database want to created)
      i)The first is 'mongodb' which specifies that we are connecting to a mongoDB database.
     ii)The next is 'localhost' which means we are connecting to a database on the local   machine.
     iii)The next is 'EmployeeDB' which is the name of the database defined in our MongoDB database.
    3.Connect to our database 
    4.Connection established





    5.Closing the connection.
    To run the database: node EmployeeDB.js
    Important:In MongoDB, a database is not created until it gets content!
    3.Node.js MongoDB Create Collection
    var MongoClient = require('mongodb').MongoClient;
    var url = "mongodb://localhost:27017/";
    MongoClient.connect(url, function(err, db) {
      if (err) throw err;
      var dbo = db.db("mydb");
      //Create a collection name "customers":
      dbo.createCollection("customers"function(err, res) {
        if (err) throw err;
        console.log("Collection created!");
        db.close();
      });
    });
    Important: In MongoDB, a collection is not created until it gets content!

    4.Node.js MongoDB Insert













    By adding console we can check whether that data was inserted or not.
    or
    To check that the data has been properly inserted in the database, you need to execute the following commands in MongoDB
    1.Use EmployeeDB
    2.db.Employee.find({Employeeid :4 })
    5.Node.js MongoDB Query










    Output:









    6.Node.js MongoDB Insert












    7.Node.js MongoDB Update






    8.Delete Document
















    Wednesday, January 23, 2019

    node.js







    Node.js is open source, completely free, and used by thousands of developers around the world. It is used to develop I/O intensive web applications like video streaming sites, single-page applications, and other web applications.
    Node.js is a very powerful JavaScript-based framework/platform built on Google Chrome's JavaScript V8 Engine. It is used to develop I/O intensive web applications like video streaming sites, single-page applications, and other web applications. Node.js is open source, completely free, and used by thousands of developers around the world.Node.js is an open source, cross-platform runtime environment for developing server-side and networking applications. Node.js applications are written in JavaScript, and can be run within the Node.js runtime on OS X, Microsoft Windows, and Linux.
    Node.js also provides a rich library of various JavaScript modules which simplifies the development of web applications using Node.js to a great extent.

    Features of Node.js

     ➤Asynchronous and Event Driven
     ➤Very Fast
     ➤Single Threaded but Highly Scalable
     ➤No Buffering 
     
    Where to Use Node.js?

    Following are the areas where Node.js is proving itself as a perfect technology partner.

        ➤I/O bound Applications
        ➤Data Streaming Applications
        ➤Data Intensive Real-time Applications (DIRT)
        ➤JSON APIs based Applications
        ➤Single Page Applications



    Node JS code have the following three important keyword..


    ➤Import required modules − We use the require directive to load Node.js modules.

    ➤Creating server − A server which will listen to client's requests

    ➤Read request and return response − The server created in an earlier step will read the HTTP request made by the client which can be a browser or a console and return the response.



    Node Package Manager

    ➤Node Package Manager (NPM) provides two main functionalities −

    • 1.Online repositories for node.js packages/modules which are searchable on search.nodejs.org
    • 2.Command line utility to install Node.js packages, do version management and dependency management of Node.js packages.

    React React  is a JavaScript library for building user interfaces created by Facebook. It is maintained by Facebook and a community of...