![Stories in in progress](https://badge.waffle.io/eventoL/eventoL-frontend.svg?label=in progress&title=In Progress)
To get you started you can simply clone the eventoL-frontend repository and install the dependencies:
You need git to clone the eventoL-frontend repository. You can get git from http://git-scm.com/.
We also use a number of node.js tools to initialize and test eventoL-frontend. You must have node.js and its package manager (npm) installed. You can get them from http://nodejs.org/.
Clone the angular-seed repository using git:
git clone https://github.com/eventoL/eventoL-frontend.git
cd eventoL-frontend
We have two kinds of dependencies in this project: tools and angular framework code. The tools help us manage and test the application.
- We get the tools we depend upon via
npm
, the node package manager. - We get the angular code via
bower
, a client-side code package manager.
We have preconfigured npm
to automatically run bower
so we can simply do:
npm install
Behind the scenes this will also call bower install
. You should find that you have two new
folders in your project.
node_modules
- contains the npm packages for the tools we needapp/bower_components
- contains the angular framework files
Note that the bower_components
folder would normally be installed in the root folder but
eventoL-frontend changes this location through the .bowerrc
file. Putting it in the app folder makes
it easier to serve the files by a webserver.
app/ --> all of the source files for the application
app.css --> default stylesheet
src/ --> all app specific modules
app.js --> main application module
index.html --> app layout file (the main html template file of the app)
karma.conf.js --> config file for running unit tests with Karma
e2e-tests/ --> end-to-end tests
protractor-conf.js --> Protractor config file
scenarios.js --> end-to-end scenarios to be run by Protractor
While angular is client-side-only technology and it's possible to create angular webapps that
don't require a backend server at all, we recommend serving the project files using a local
webserver during development to avoid issues with security restrictions (sandbox) in browsers. The
sandbox implementation varies between browsers, but quite often prevents things like cookies, xhr,
etc. to function properly when an html page is opened via file://
scheme instead of http://
.
The eventoL-frontend project comes preconfigured with a local development webserver. It is a node.js tool called http-server. You can install http-server globally:
sudo npm install -g http-server
Then you can start your own development web server to serve static files from a folder by running:
cd app
http-server -a localhost -p 8000
Alternatively, you can choose to configure your own webserver, such as apache or nginx. Just
configure your server to serve the files under the app/
directory.
This really depends on how complex your app is and the overall infrastructure of your system, but
the general rule is that all you need in production are all the files under the app/
directory.
Everything else should be omitted.
Angular apps are really just a bunch of static html, css and js files that just need to be hosted somewhere they can be accessed by browsers.
If your Angular app is talking to the backend server via xhr or other means, you need to figure out what is the best way to host the static files to comply with the same origin policy if applicable. Usually this is done by hosting the files by the backend server or through reverse-proxying the backend server(s) and webserver(s).
For more information on AngularJS please check out http://angularjs.org/ For more information on Angular Material, check out https://material.angularjs.org/