Giter VIP home page Giter VIP logo

basic-web-app's Introduction

Basic Web App

This is a basic web app whose purpose is to illustrate the speed advantages of using automation and automation tools, such as Yeoman, Grunt and Bower, over the manual approach used here.

Required Steps

To create this app, several steps are needed which are time consuming an error prone (human factor).

  • Download Bootstrap
  • Download jQuery
  • Use NPM to globally install UglifyJS2, CSSO and Minify-HTML
  • Link HTML files to CSS and JS files
  • Write HTML, CSS and JS boilerplate
  • Test the app in a Browser to ensure that all the pieces are working and playing nice
  • Add your own custom HTML, CSS and JS
  • Uglify the JS
  • Minify and optimize the CSS
  • Minify the HTML
  • Set up a dist folder
  • Copy uglified and minified HTML, JS and CSS to dist folder
  • Update the links in the HTML so that they point at the minified JS and CSS
  • Make sure that all other necessary assets (e.g. images, scripts) exist in dist folder

In all of the above steps, there is only one that truly interests us as developers, and that is:

  • Add your own custom HTML, CSS and JS

All of the above take a lot of time to do, and when performed manually, understandable human error obfuscates the process and introduces small mistakes that take even more time to deal with. Specifically syntax errors, wrong path errors, and others.

Why can we see a dist folder?

Usually, a dist folder would not be pushed to your repo, as it should be generated by the User manually or by automation tools. I have chosen to include it to show what state the code needs to be in at the end of the Required Steps above. This serves to illustrate the complex transformations that need to occur, hopefully strengthening my argument for automation.

Uglify and Minify Commands

Minify HTML

html-minifier index.html --remove-comments --collapse-whitespace --remove-empty-attributes --remove-style-link-type-attributes --lint --case-sensitive --output index.min.html

Minify CSS

csso style.css style2.css -o style.min.css

Uglify and Minify JS

uglifyjs main.js main2.js --compress --mangle --output main.min.js

Solution

We will use Yeoman, Grunt, Bower and NPM to automate all of the above steps besides writing our own custom HTML, CSS and JS, which is all developers should be interested in. That said, developers should have a thorough understanding of the automation process happening in the background.

basic-web-app's People

Contributors

bengrunfeld avatar

Watchers

 avatar  avatar  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.