The SmartCitizen front-end. Working together with SmartCitizen API.
Using nvm
(recommended but optional) do:
nvm install
nvm use
npm i
gulp serve
To be able to login from localhost:8080 with our real username:password
connected to the SC API, we need to comment out the following lines in app.route.js
:
/* Allow cookies across *.smartcitizen.me Apps */
$cookiesProvider.defaults.path = '/';
$cookiesProvider.defaults.domain = '.smartcitizen.me';
(We are looking for a better solution).
You need git to clone the repository. You can get git from http://git-scm.com/.
We also use a number of node.js tools to initialize and test the Web App. You must have node.js and its package manager (npm) installed. You can get them from http://nodejs.org/.
Also gulp: npm install -g gulp
(with sudo
if you are using Mac).
Clone the repository using:
git clone https://github.com/fablabbcn/smartcitizen-web.git
cd smartcitizen-web
npm install.
bower install
, npm install
will take care of it.If you want to use Docker in development mode, you should enable the volume:
in docker-compose.yml so you won't need to rebuild after every file change.
The image needs you to do npm install
locally before running the container.
It needs the node_modules/
to exist.
docker-compose up
gulp
or gulp build
to build an optimized version of your application in /dist
npm run dev
(or gulp serve
) to launch a browser sync server on your source filesgulp serve:dist
to launch a server on your optimized applicationgulp test
to launch your unit tests with Karmagulp test:auto
to launch your unit tests with Karma in watch modegulp protractor
to launch your e2e tests with Protractor. Tests are in the ./e2e/ folder.gulp protractor:dist
to launch your e2e tests with Protractor on the dist filesnpm run deploy
to publish the project to Github pages (gh-pages branch).Note: in case you see something like:
Error: Command failed: fatal: unable to read c6a8d370f3e95d9110eca4a03b704bd8940ca40b
Run:
rm -Rf $(node -e "console.log(require('path').join(require('os').tmpdir(), 'tmpRepo'))")
In app.route.js
the app can be configured to talk to another API:
RestangularProvider.setBaseUrl('http://localhost:3000/v0');
Best Practice Recommendations for Angular App Structure
Visit https://github.com/ajoslin/conventional-changelog/blob/master/CONVENTIONS.md
Same for all types of components: