Skip to content

topcoderinc/panalpina_shipment_tracker

Repository files navigation

Panalpina Shipping App

Prerequisite

node >= 9.11 and npm >= 5.6 angular-cli >= 6.2

!!! Note: this project uses the node-sass npm package, which, on windows machines requires the node-gyp prerequisites.

Install all dependencies by running npm install in project's root folder.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the -prod flag for a production build. To run the files in the dist folder you can use either apache, nginx. You can also install http-server and use it to run the project:

$ npm i -g http-server
$ http-server dist/panalpina

See https://www.npmjs.com/package/http-server for more details on http-server.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

Deploying to heroku

Make sure you have latest Heroku CLI installed:

$ npm install -g heroku-cli

Login to heroku:

$ heroku login

Create the heroku application:

$ heroku apps:create <application-name>

Replace <application-name> with the name of the application you'd like. eg:

$ heroku apps:create pan-app-tc

Build the application:

$ ng build -prod

Add the code to your heroku instance:

$ git add .
$ git add -f dist
$ git commit -m "init"

Finally, deploy to your heroku instance:

$ git push heroku master

See your running app at https://<application-name>.heroku.com, in the given example it would be: https://pan-app-tc.herokuapp.com/, or simply open it by running:

$ heroku open

!!!NOTE: the server.js file is only for serving files on heroku. do not use it on localhost!

Environment configuration files

Please find the env configuration files located in src/environments/, as follows:

environment.ts config file for development environment environment.prod.ts config file for production environment

The available configurations are:

production sets current environment as production or not api Mock urls for the api (locations to json files, as of this moment) gMap.apiKey The google maps api key to use in the application. It is required in api v3. Check here to see how to get one. gmap Config the default center & zoom level for the map

3rd Party libraries

d3js