Wednesday, December 28, 2016

MEAN Setup and Start with @ Mac OSX..!


Dear Viewer,

This post will help and take you with the following possible steps in regard of installing stack tools associated with the MEAN development platform into your Mac OSX machine. I have seen there are plenty of posts available online for setting up work environment on various cross-platforms. My focus is also quite similar over here; but this write-up is only targeted for Mac OSX  users. Due to large volume API up-gradation and changes in technology cycles frequently many things might not go right in one short of your MEAN development set-up at Mac machine. With having said that, thought to write a post should be meaningful and helpful for target audience. I have been done setup implementation successfully in my Mac OS (i.e., macOS Sierra version 10.12.2). Lets start with the step of set-up implementation after getting bit idea/purpose of MEAN: 

MEAN (Mongo, Express, Angular, Node) - A simple, scalable and easy starting point for full stack JavaScript web development. The MEAN stack represents a thoroughly modern approach to web development: one in which a single language (JavaScript) runs on every tier of your application, from client to server to persistence.

Here understand the short purpose and definition of all stacks:

MongoDB is the leading NoSQL database, empowering businesses to be more agile and scalable. 

Express is a minimal and flexible node.js web application framework, providing a robust set of features for building single and multi-page, and hybrid web applications.

AngularJS lets you extend HTML vocabulary for your application. The resulting environment is extraordinarily expressive, readable, and quick to develop.

Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications.


Before you begin, you should make sure you have installed all these prerequisites on your development machine.

The first is to change the owner of “/usr/local” to the with the following command:
$ sudo chown -R $USER /usr/local

It is not recommended to use the npm command with sudo.

The second would be to install the Apple command line developer tools. I think, the best way to do it is by installing XCode. Yes you then have another big IDE, but it installs much more. But this way, you don’t need to have a developer account. I did it by Installing XCode; you can just install the command line tools. XCode can be installed from the Apple AppStore.

Step 1:
Install either Macports or HomeBrew in your Mac machine for easy installation of tools and their dependencies.

The third is to install homebrew. Homebrew is the package manager for MAC. The installation is pretty easy, type the following in you command line:
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Then run the homebrew doctor like this:

$ brew doctor

After this, you can install tools like this:

$ brew install wget


Step 2: Installing Node.js / Nodes.js Package Manager (NPM)

Download & Install Node.js and the npm package manager, if you encounter any problems, you can also use this Github Gist to install Node.js. Again, we'll let HomeBrew do the heavy lifting:

$ brew install node

The npm executable is already included in the Node.js package.
Before continuing, let's make sure Node.js modules can be found by others (Caution: it's best to copy and paste these commands, as you'd lose the original contents of your .bashrc file if you typed > in place of >>):

$ echo 'export NODE_PATH="./node_modules:/usr/local/lib/node_modules"' >> ~/.bashrc && source ~/.bashrc

To check if the configuration is in effect, execute:

$ echo $NODE_PATH

You should see ./node_modules:/usr/local/lib/node_modules printed out below your command. If you use a different shell than Bash, simply replace ~/.bashrc with your shell configuration file.

Step 3: Installing MongoDB


If you haven't used HomeBrew before, simply execute the following command in a Terminal window:


We will install MongoDB through howebrew. Make sure homebrew is up-to-date by executing this command:

$ brew update

Then lets install MongoDB with the following command:

$ brew install mongodb

To run MongoDB, we have to create de default data directory for our MongoDB by:

$ mkdir -p /data/db

The user monogd must have write access.

Run MongoDB on the default port (27017) with:

$ mongod

Also you can use below command:

$ brew update && brew install mongodb

Homebrew will automatically install all the dependencies for you.

Also install some other package managers:

Install Bower

You’re going to use the Bower Package Manager to manage your front-end packages, in order to install it make sure you’ve installed Node.js and npm, then install bower globally using npm:

$ npm install -g bower

Install Grunt

You’re going to use the Grunt Task Runner to automate your development process, in order to install it make sure you’ve installed Node.js and npm, then install grunt globally using npm:

$ npm install -g grunt-cli

Install Yeoman

MeanJS uses Yeoman, the web’s scaffolding tool for modern web apps.

Install Yeoman globally with:

$ npm install -g yo

Install MeanJS generator for Yeoman

$ npm install -g generator-meanjs

You are now ready to get started with the MEAN.JS generator. The generator will help you create a MEAN.JS application, a CRUD module, Angular Module, and other AngularJS/Express entities. We’ll begin with the application generator.


Step 4: Generating a Fullstack app

Make a directory for your Back End Project projects. Assuming your desktop is your de facto workspace:

$ mkdir ~/Desktop/Back End Projects && cd ~/Desktop/Back End Projects

Now that all the preparations are in place, it's time for the main event:

$ yo angular-fullstack

Step 5: Initializing local Git repository

Tell Git not to track your database:

$ echo "data" >> .gitignore

Turn the directory in which your application is located into a Git repository by running the following commands:

$ git init && git add . && git commit -am 'initial commit'

Step 6: Starting MongoDB

To start MongoDB for the first time in your app's directory, run the following commands in your terminal:

$ mkdir data && echo 'mongod --config /usr/local/etc/mongod.conf --dbpath=data --rest "$@" --httpinterface' > mongod.sh && chmod a+x mongod.sh && ./mongod.sh

From this point on you can simply start MongoDB by executing ./mongod.sh. A few things to note:
        The .conf file directs mongod to write messages to a log file instead of stdout. To view the log, run the following in a separate Terminal tab: less /usr/local/var/log/mongodb/mongo.log.
        Since we're not on Cloud9, we don't need the --nojournal option. Journaling lets you recover the database in case of a mongod crash.
        You have to make a clean database for each project. If you copied the data directory over from an earlier project, mongod will fail to start. If that's the case, just rm -rf data && mkdir data && ./mongod.sh.

Step 7: Application Generator

Installing full stack tools

$ npm install -g express yo grunt grunt-cli generator-angular-fullstack bower

The application generator will help you create a fresh copy of a MEAN.JS application in your working folder. To create your MEAN application, navigate to a new project folder, and then use yo to generate your application:

$ yo meanjs

The generator will ask you a few questions about your new application and will generate it for you. When the installation process is over, you will be able to use grunt to run your new MEAN application:

Open a new Terminal tab by pressing T, and run the following command:

$ grunt serve

Grunt should automatically open your new Angular site's index page as soon as it finishes starting up.
Now you should be able to follow the rest of the Challenge instructions to push to GitHub and Heroku. Just ignore the part about SSH key (#33-36) and replace ~/workspace with your app directory's path.

Tuesday, November 1, 2016

HTS - High Throughput Satellite [Adoption in Mobility Startegy]

Today world is lying on mobile and Internet ecosystems together. The proliferation of web-based mobile applications necessitated mobile broadband access to the Internet, which rapidly became widely and sufficiently available to users of mobile devices, as long as they stayed within the service range of their appropriate terrestrial networks. 

Lets think on the situation from consumer stand point when mobile users got on planes, ships and land-mobiles, the bandwidth frequency, communication and Internet experience was quite different. How consumer and enterprise industry approach and dealt with the situation? HTS (High Throughput Satellite) is one of the approaching solution, which could be considered to become a game changer for Internet users in the aeronautical, maritime, and land-mobile market segments. HTS are primarily deployed to provide broadband Internet access service (point-to-point) to regions un-served or under served by terrestrial technologies where they can deliver services comparable to terrestrial services in terms of pricing and bandwidth. Let's understand what's HTS first? As per Wikipedia, HTS is a classification for communications satellites that provide at least twice, though usually by a factor of 20 or more, the total throughput of a classic FSS satellite for the same amount of allocated orbital spectrum thus significantly reducing cost-per-bit. 
 
The advent of high-throughput satellites (HTS) enables network service providers to offer a new generation of communications solutions. HTS systems combine the exceptional spectrum efficiency and performance of spot-beam antennas with ultra-wideband transponders to enable unprecedented levels of bandwidth and throughput. Each spot beam reuses frequencies in multiple carriers so that a single HTS spacecraft can provide five to ten times the capacity of traditional satellites. For the customer, this provides the potential to dramatically increase data rates, upwards of 100Mbps to a single site and improve application performance compared to traditional satellite based communications.

While many current HTS platforms were designed to serve the consumer broadband market, some are also offering services to government and enterprise markets, as well as to terrestrial cellular network operators who face growing demand for broadband backhaul to rural cell sites. For cellular backhaul, the reduced cost per bit of many HTS platforms creates a significantly more favorable economic model for wireless operators to use satellite for cellular voice and data backhaul. Some HTS platforms are designed primarily for the enterprise, telecom or maritime sectors. HTS can furthermore support point-to-multipoint applications and even broadcast services such as DTH distribution to relatively small geographic areas served by a single spot beam. However, in simple terms, HTS is making broadband access better, cheaper and faster.

Here we look at five main important components of HTS design strategy are:
  1. Throughput - total transmitted per seconds
  2. Efficiency - actually interdependent of throughput requirements
  3. Coverage - the region being served in spacecraft and geographically
  4. Architecture - network architecture {Star, Mesh, Loopback…}
  5. Spectrum/Efficiency - frequency in consideration into the available bandwidth network and characteristics of the spectrum 


In business terms, HTS will significantly reduce the Total Cost of Ownership (TCO) compared to yesteryear’s satellite broadband solutions in the mobile platforms space. More importantly, HTS broadband access is finally becoming competitive with its terrestrial counterparts in terms of cost and performance. But the good news is that HTS does not have to compete with terrestrial solutions in the air, sea and land mobile segments, it just needs to become as widely available as its terrestrial cousins and support comparable broadband connectivity in terms of throughput and cost. 

Takeaway from experts based on experimental outcome result and existing case-study report:
·     Next generation High Throughput Satellites include both Ku and Ka [Refer - below comparison image table].
·         There are many different variations of technologies using the Ka-band frequencies.
·         Ka is an appropriate technology for mass markets and non-industrial markets.
·      Side-by-side technical and cost comparison of Ka and Ku HTS solutions shows significant technical and cost challenges with most Ka solutions for customers with high reliability and availability needs.
·      HTS Ku platforms offer the best overall performance and value for operations for mission critical, maximum uptime networks. 



Important links to explore the purpose and needs of HTS are in detail, such as:
  1. https://www.linkedin.com/pulse/hts-game-changer-bandwidth-run-mobile-platforms-jack-nargundkar
  2. https://en.wikipedia.org/wiki/High-throughput_satellite
  3. http://www.thedigitalship.com/conferences/presentations/2014rotterdam/10_Claude_Rousseau-Research_Director-NSR-France.pdf
  4. http://www.harriscaprock.com/downloads/HarrisCapRock_WhitePaper-Ka-Ku_Analysis.pdf
  5. https://www.youtube.com/watch?v=XrN4dtcpO8k  


Thanks you for your time on staying at this page. Please be free to advise/contribute/suggest below in comment section. Will add all valuable relevant input quickly. Thanks again and look forward!

Monday, February 8, 2016

MVC, MVP & MVVM - Architectural Patterns.



MVC - Model–View–Controller (MVC) is a software architectural pattern mostly (but not exclusively) for implementing user interfaces on computers. Traditionally used for desktop graphical user interfaces (GUIs), this architecture has become extremely popular for designing web applications.
MVC - Framework Library: Early web MVC frameworks took a thin client approach that placed almost the entire model, view and controller logic on the server. This is still reflected in popular frameworks such as Ruby on Rails, Django, ASP.NET MVC, Spring MVC and Express. Client technologies have matured; frameworks such as AngularJS, EmberJS, JavaScriptMVC, SpineJS and Backbone have been created that allow the MVC components to execute partly on the client.

MVP - Model-View-Presenter (MVP) is a derivation of the model–view–controller (MVC) architectural pattern, and is used mostly for building user interfaces. MVP is a user interface architectural pattern engineered to facilitate automated unit testing and improve the separation of concerns in presentation logic:

  • the view is a passive interface that displays data (the model) and routes user commands (events) to the presenter to act upon that data.  
  • the model is an interface defining the data to be displayed or otherwise acted upon in the user interface.
  • the presenter acts upon the model and the view. It retrieves data from repositories (the model), and formats it for display in the view.
 
MVP - Framework Library: Client Side- Riot.js, GWT   whereas Server Side - Classic ASP.NET, JSP Servlets. In general implementation of MVP: 
  • .Net Framework - Claymore, MVC# Framework, Web Client Software Factory, Evolution.Net MVP Framework, ASP.NET Web Forms Model-View-Presenter (MVP), Nucleo.NET, WinForms MVP
  •  Java Framework - JavaFX, MVP4J, Echo2, Google Web Toolkit, GWT-Platform, JFace, Swing, Vaadin, ZK
  •  PHP Framework - Nette Framework

MVVM - Model–View–ViewModel (MVVM) is a software architectural pattern. MVVM and Presentation Model both derive from the model–view–controller pattern (MVC). MVVM facilitates a separation of development of the graphical user interface (either as markup language or GUI code) from development of the business logic or back-end logic (the data model). Model–view–viewmodel is called model–view–binder, especially in implementations not involving the .NET platform. ZK (a web application framework written in Java) and KnockoutJS (a JavaScript library) use model–view–binder. The MVVM pattern includes three key parts:
  1. Model (Business rule, data access, model classes)
  2. View (User interface (XAML))
  3. ViewModel (Agent or middle man between view and model)
 
MVVM - Framework Library: Client side - Knockout.js, Kendo (MVVM) whereas Server side - WPF (Desk­top) or Sil­verlight, Win­dows Phone apps (XAML), Adobe Flex.  
When to use which?   
  • MVC - Use in situations where the connection between the view and the rest of theprogram is not always available (and you can’t effectively employ MVVM or MVP)
  • MVP - Use in situations where binding via a datacontext is not possible. 
  • MVVM - Use in situations where binding via a datacontext is possible. 
 
Both MVP and MVVM are deriv­a­tives of MVC (see time­lines and how these have evolved). The key dif­fer­ence between them is the depen­dency each layer has on other lay­ers as well as how tightly bound they are to each other.