Accern web development task
This page is a replica of www.accern.com. The website is a single page web application made in Angular Js. The server is created in Node JS with Express. It also has Zendesk widget embadded in it.
- Client side library manager - Bower.
- UI framework - ZURB Foundation 5.5.3 (Dependency - jquery-placeholder, jquery.cookie, fastclick).
- Fonts - Google fonts Poppins|Roboto.
- Font icons - Fontawesome.
- Javascript library - Jquery 3.1.1.
- Javascript framework - Angular 1.6.1.
- Routing module - angular-route 1.6.1, angular-ui-router 0.4.2.
- Script manager/ dependency manager - Require JS 2.3.2.
- Zendesk widget.
- node_modules
- public
- bower_components
- app-styles
- master.css
- app-scripts
- config
- appConfig.js
- controllers
- mainController.js
- directives
- appDirective.js
- appReferences.js
- coreModule.js
- views
- home.html
- company.html
- resource.html
- contact.html
- img
- bower.json
- main.js
- index.html
- package.json
- README.md
- server.js
The public folder contains bower_components, app-styles, app-scripts, views and img folders.
bower_components has got all the client side libraries.
app-styles has got the custom CSS files.
views has the partial HTML pages for different routes.
app-scripts has all the angular components in different folders config, controllers and directives.
config has got the config file for ui-routes.
controllers has got the angular controllers.
directives has got the angular directives.
The entry point to the client application is index.html which acts as the master page for our application. It has got the navigation bar, ui-view (to include the partial templates) and the footer.
The index.html has got the script for Zendesk widget in the header and reference to the require.js with data-main as main.js file (main.js holds configuration for require.js).
main.js is the entry point for Angular coreModule, holds reference to the script files and define the dependencies.
require.config({
waitSeconds: 200,
paths : {
'jquery': 'bower_components/foundation/js/vendor/jquery',
'fastclick': 'bower_components/fastclick/lib/fastclick',
'jquery-placeholder': 'bower_components/jquery-placeholder/jquery.placeholder',
'jquery.cookie': 'bower_components/jquery.cookie/jquery.cookie',
'foundation': 'bower_components/foundation/js/foundation',
'angular': 'bower_components/angular/angular',
'angular-route': 'bower_components/angular-route/angular-route',
'angular-ui-router': 'bower_components/angular-ui-router/release/angular-ui-router',
'coreModule': 'app-scripts/coreModule'
},
shim : {
'foundation': {
deps : ['fastclick', 'jquery-placeholder', 'jquery.cookie']
},
'angular' : {
deps : ['jquery']
},
'angular-route' : {
deps : ['angular']
},
'angular-ui-router' : {
deps : ['angular']
},
'coreModule' : {
deps : ['angular-route' , 'angular-ui-router']
}
}
});
require(['coreModule'], function(){
});
The coreModule.js defines the angular module and bootstraps angular to the document taking the angular componets referenced in public/app-scripts/appReferences.js.
define(function(){
//Core Module
var coreModule = angular.module("coreModule",["ngRoute", "ui.router"]);
//Loading all angular components defined in appReferences file
require(['app-scripts/appReferences'], function(references) {
require(references, function(){
//Bootstraping angular to the document
angular.bootstrap(document, ["coreModule"]);
});
});
})
//Path to the angular components are referenced here
define(function(){
return [
'app-scripts/config/appConfig',
'app-scripts/controllers/mainController',
'app-scripts/directives/appDirective'
];
});