Skip to content

Commit 07b3bf1

Browse files
committed
initial commit
initial commit
1 parent d136983 commit 07b3bf1

File tree

32,775 files changed

+3819835
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

32,775 files changed

+3819835
-2
lines changed

.DS_Store

6 KB
Binary file not shown.

README.md

100644100755
Lines changed: 103 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,103 @@
1-
# panalpina_shipment_tracker
2-
The code for Panalpina's Shipment tracker
1+
# Panalpina Shipping App Design-to-Prototype
2+
3+
### HEROKU URL & DEMO
4+
https://pan-app-tc.herokuapp.com/
5+
To test out the application, please use these tracking numbers:
6+
PNH009736, LKHBA-004459, TKY001234, BRRIO-006783, 157-48197836, 220-12345678
7+
8+
## Prerequisite
9+
> [node >= 9.11 and npm >= 5.6](https://nodejs.org/en/download/)
10+
> [angular-cli >= 6.2](https://github.com/angular/angular-cli#installation)
11+
12+
!!! Note: this project uses the `node-sass` npm package, which, on windows machines requires the [`node-gyp` prerequisites](https://github.com/nodejs/node-gyp#on-windows).
13+
14+
Install all dependencies by running `npm install` in project's root folder.
15+
16+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.2.3.
17+
18+
## Development server
19+
20+
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.
21+
22+
## Code scaffolding
23+
24+
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`.
25+
26+
## Build
27+
28+
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.
29+
To run the files in the `dist` folder you can use either apache, nginx.
30+
You can also install [http-server](https://www.npmjs.com/package/http-server) and use it to run the project:
31+
```sh
32+
$ npm i -g http-server
33+
$ http-server dist/panalpina
34+
```
35+
36+
See https://www.npmjs.com/package/http-server for more details on `http-server`.
37+
38+
## Further help
39+
40+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
41+
42+
## Deploying to heroku
43+
Make sure you have latest Heroku CLI installed:
44+
``` sh
45+
$ npm install -g heroku-cli
46+
```
47+
48+
Login to heroku:
49+
``` sh
50+
$ heroku login
51+
```
52+
53+
Create the heroku application:
54+
``` sh
55+
$ heroku apps:create <application-name>
56+
```
57+
Replace `<application-name>` with the name of the application you'd like. eg:
58+
``` sh
59+
$ heroku apps:create pan-app-tc
60+
```
61+
62+
Build the application:
63+
``` sh
64+
$ ng build -prod
65+
```
66+
67+
Add the code to your heroku instance:
68+
``` sh
69+
$ git add .
70+
$ git add -f dist
71+
$ git commit -m "init"
72+
```
73+
74+
Finally, deploy to your heroku instance:
75+
``` sh
76+
$ git push heroku master
77+
```
78+
79+
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:
80+
``` sh
81+
$ heroku open
82+
```
83+
!!!NOTE: the `server.js` file is only for serving files on heroku. do not use it on localhost!
84+
85+
### Environment configuration files
86+
Please find the env configuration files located in `src/environments/`, as follows:
87+
> `environment.ts` config file for development environment
88+
> `environment.prod.ts` config file for production environment
89+
90+
The available configurations are:
91+
> `production` sets current environment as production or not
92+
> `api` Mock urls for the api (locations to json files, as of this moment)
93+
> `gMap.apiKey` The google maps api key to use in the application. It is required in api v3. Check [here](https://developers.google.com/maps/documentation/javascript/get-api-key) to see how to get one.
94+
> `gmap` Config the default center & zoom level for the map
95+
96+
97+
## 3rd Party libraries
98+
> [d3js](https://d3js.org/)
99+
100+
101+
### Mock data
102+
All data can be found in `.json` files under `/assets/data/` folder.
103+
The JSON structure is normalized, as well as the properties are (no white space, just camelCase properties).

angular.json

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"panalpina": {
7+
"root": "",
8+
"sourceRoot": "src",
9+
"projectType": "application",
10+
"prefix": "app",
11+
"schematics": {
12+
"@schematics/angular:component": {
13+
"styleext": "scss",
14+
"spec": false
15+
},
16+
"@schematics/angular:class": {
17+
"spec": false
18+
},
19+
"@schematics/angular:directive": {
20+
"spec": false
21+
},
22+
"@schematics/angular:guard": {
23+
"spec": false
24+
},
25+
"@schematics/angular:module": {
26+
"spec": false
27+
},
28+
"@schematics/angular:pipe": {
29+
"spec": false
30+
},
31+
"@schematics/angular:service": {
32+
"spec": false
33+
}
34+
},
35+
"architect": {
36+
"build": {
37+
"builder": "@angular-devkit/build-angular:browser",
38+
"options": {
39+
"outputPath": "dist/panalpina",
40+
"index": "src/index.html",
41+
"main": "src/main.ts",
42+
"polyfills": "src/polyfills.ts",
43+
"tsConfig": "src/tsconfig.app.json",
44+
"assets": [
45+
"src/favicon.ico",
46+
"src/assets"
47+
],
48+
"styles": [
49+
"node_modules/normalize.css/normalize.css",
50+
"src/styles/index.scss"
51+
],
52+
"stylePreprocessorOptions": {
53+
"includePaths": [
54+
"./src/styles"
55+
]
56+
},
57+
"scripts": []
58+
},
59+
"configurations": {
60+
"production": {
61+
"fileReplacements": [
62+
{
63+
"replace": "src/environments/environment.ts",
64+
"with": "src/environments/environment.prod.ts"
65+
}
66+
],
67+
"optimization": true,
68+
"outputHashing": "all",
69+
"sourceMap": false,
70+
"extractCss": true,
71+
"namedChunks": false,
72+
"aot": true,
73+
"extractLicenses": true,
74+
"vendorChunk": false,
75+
"buildOptimizer": true
76+
}
77+
}
78+
},
79+
"serve": {
80+
"builder": "@angular-devkit/build-angular:dev-server",
81+
"options": {
82+
"browserTarget": "panalpina:build"
83+
},
84+
"configurations": {
85+
"production": {
86+
"browserTarget": "panalpina:build:production"
87+
}
88+
}
89+
},
90+
"extract-i18n": {
91+
"builder": "@angular-devkit/build-angular:extract-i18n",
92+
"options": {
93+
"browserTarget": "panalpina:build"
94+
}
95+
},
96+
"test": {
97+
"builder": "@angular-devkit/build-angular:karma",
98+
"options": {
99+
"main": "src/test.ts",
100+
"polyfills": "src/polyfills.ts",
101+
"tsConfig": "src/tsconfig.spec.json",
102+
"karmaConfig": "src/karma.conf.js",
103+
"styles": [
104+
"src/styles/index.scss"
105+
],
106+
"scripts": [],
107+
"assets": [
108+
"src/favicon.ico",
109+
"src/assets"
110+
]
111+
}
112+
},
113+
"lint": {
114+
"builder": "@angular-devkit/build-angular:tslint",
115+
"options": {
116+
"tsConfig": [
117+
"src/tsconfig.app.json",
118+
"src/tsconfig.spec.json"
119+
],
120+
"exclude": [
121+
"**/node_modules/**"
122+
]
123+
}
124+
}
125+
}
126+
},
127+
"panalpina-e2e": {
128+
"root": "e2e/",
129+
"projectType": "application",
130+
"architect": {
131+
"e2e": {
132+
"builder": "@angular-devkit/build-angular:protractor",
133+
"options": {
134+
"protractorConfig": "e2e/protractor.conf.js",
135+
"devServerTarget": "panalpina:serve"
136+
},
137+
"configurations": {
138+
"production": {
139+
"devServerTarget": "panalpina:serve:production"
140+
}
141+
}
142+
},
143+
"lint": {
144+
"builder": "@angular-devkit/build-angular:tslint",
145+
"options": {
146+
"tsConfig": "e2e/tsconfig.e2e.json",
147+
"exclude": [
148+
"**/node_modules/**"
149+
]
150+
}
151+
}
152+
}
153+
}
154+
},
155+
"defaultProject": "panalpina"
156+
}

e2e/protractor.conf.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Protractor configuration file, see link for more information
2+
// https://github.com/angular/protractor/blob/master/lib/config.ts
3+
4+
const { SpecReporter } = require('jasmine-spec-reporter');
5+
6+
exports.config = {
7+
allScriptsTimeout: 11000,
8+
specs: [
9+
'./src/**/*.e2e-spec.ts'
10+
],
11+
capabilities: {
12+
'browserName': 'chrome'
13+
},
14+
directConnect: true,
15+
baseUrl: 'http://localhost:4200/',
16+
framework: 'jasmine',
17+
jasmineNodeOpts: {
18+
showColors: true,
19+
defaultTimeoutInterval: 30000,
20+
print: function() {}
21+
},
22+
onPrepare() {
23+
require('ts-node').register({
24+
project: require('path').join(__dirname, './tsconfig.e2e.json')
25+
});
26+
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27+
}
28+
};

e2e/src/app.e2e-spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { AppPage } from './app.po';
2+
3+
describe('workspace-project App', () => {
4+
let page: AppPage;
5+
6+
beforeEach(() => {
7+
page = new AppPage();
8+
});
9+
10+
it('should display welcome message', () => {
11+
page.navigateTo();
12+
expect(page.getParagraphText()).toEqual('Welcome to panalpina!');
13+
});
14+
});

e2e/src/app.po.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { browser, by, element } from 'protractor';
2+
3+
export class AppPage {
4+
navigateTo() {
5+
return browser.get('/');
6+
}
7+
8+
getParagraphText() {
9+
return element(by.css('app-root h1')).getText();
10+
}
11+
}

e2e/tsconfig.e2e.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/app",
5+
"module": "commonjs",
6+
"target": "es5",
7+
"types": [
8+
"jasmine",
9+
"jasminewd2",
10+
"node"
11+
]
12+
}
13+
}

node_modules/.bin/acorn

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/ansi-html

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/atob

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/autoprefixer

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/babylon

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/blocking-proxy

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/browserslist

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/build-optimizer

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/cssesc

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/csv2json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/csv2tsv

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/dsv2dsv

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/dsv2json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/errno

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/escodegen

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/esgenerate

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/esparse

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/esvalidate

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/handlebars

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/he

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/html-minifier

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)