Skip to content

Commit c8e56b5

Browse files
devversionkara
authored andcommitted
build: initial dashboard project (#5148)
1 parent f579ea1 commit c8e56b5

19 files changed

+193
-24
lines changed

scripts/deploy/deploy-dashboard-functions.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

scripts/deploy/deploy-dashboard.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
# This script deploys the Dashboard App and their Cloud Functions to Firebase.
4+
# Before the script installs all dependencies and builds the dashboard app in production.
5+
6+
# Go to the project root directory
7+
cd $(dirname ${0})/../..
8+
9+
# Paths to the dashboard and functions directories.
10+
dashboardFolder=tools/dashboard
11+
12+
# Go to the dashboard folder because otherwise the Firebase CLI tries to deploy the wrong project.
13+
cd ${dashboardFolder}
14+
15+
# Install node_modules for the dashboard and afterwards build the dashboard app in production.
16+
(npm install; $(npm bin)/ng build --aot -prod) &
17+
18+
# Install node modules for dashboard functions. Firebase CLI needs to execute the functions
19+
# to collect all function names before it can deploy them.
20+
(cd functions; npm install) &
21+
22+
# The dashboard and function dependencies are installed concurrently. Also the dashboard app is
23+
# build in production afterwards. Wait for all async tasks to finish before proceeding.
24+
wait
25+
26+
if [ -z ${MATERIAL2_BOARD_FIREBASE_DEPLOY_KEY} ]; then
27+
echo "Error: No access token for firebase specified." \
28+
"Please set the environment variable 'MATERIAL2_DASHBOARD_ACCESS_TOKEN'."
29+
exit 1
30+
fi
31+
32+
# Deploy the dashboard to Firebase. Based on the current configuration hosting and functions
33+
# will be deployed.
34+
$(npm bin)/firebase deploy --token ${MATERIAL2_BOARD_FIREBASE_DEPLOY_KEY} --project material2-board

tools/dashboard/.angular-cli.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"project": {
4+
"name": "material2-board"
5+
},
6+
"apps": [
7+
{
8+
"root": "src",
9+
"outDir": "./dist",
10+
"assets": [
11+
"assets",
12+
"favicon.ico"
13+
],
14+
"index": "index.html",
15+
"main": "main.ts",
16+
"polyfills": "polyfills.ts",
17+
"tsconfig": "tsconfig.json",
18+
"prefix": "app",
19+
"styles": [
20+
"styles.css"
21+
],
22+
"scripts": [],
23+
"environmentSource": "environments/environment.ts",
24+
"environments": {
25+
"dev": "environments/environment.ts",
26+
"prod": "environments/environment.prod.ts"
27+
}
28+
}
29+
],
30+
"e2e": {},
31+
"lint": [],
32+
"test": {},
33+
"defaults": {
34+
"styleExt": "css",
35+
"component": {}
36+
}
37+
}

tools/dashboard/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Sub Gitignore file for the Dashboard project.
2+
dist/
3+
node_modules/
4+
package-lock.json

tools/dashboard/package.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "material2-board",
3+
"version": "0.0.0",
4+
"license": "MIT",
5+
"scripts": {
6+
"ng": "ng",
7+
"start": "ng serve",
8+
"build": "ng build",
9+
"build-production": "ng build --aot -prod"
10+
},
11+
"private": true,
12+
"dependencies": {
13+
"@angular/animations": "^4.2.2",
14+
"@angular/common": "^4.2.2",
15+
"@angular/compiler": "^4.2.2",
16+
"@angular/core": "^4.2.2",
17+
"@angular/forms": "^4.2.2",
18+
"@angular/http": "^4.2.2",
19+
"@angular/platform-browser": "^4.2.2",
20+
"@angular/platform-browser-dynamic": "^4.2.2",
21+
"@angular/router": "^4.2.2",
22+
"core-js": "^2.4.1",
23+
"rxjs": "^5.1.0",
24+
"zone.js": "^0.8.12"
25+
},
26+
"devDependencies": {
27+
"@angular/cli": "1.1.1",
28+
"@angular/compiler-cli": "^4.2.2",
29+
"@angular/language-service": "^4.2.2",
30+
"@types/jasmine": "2.5.45",
31+
"@types/node": "~6.0.60",
32+
"firebase-tools": "^3.9.1",
33+
"ts-node": "~3.0.4",
34+
"tslint": "~5.3.2",
35+
"typescript": "~2.3.3"
36+
}
37+
}

tools/dashboard/src/app/dashboard-app.css

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<h1>Angular Material - Board</h1>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import {Component} from '@angular/core';
2+
3+
@Component({
4+
selector: 'dashboard-app',
5+
templateUrl: './dashboard-app.html',
6+
styleUrls: ['./dashboard-app.css']
7+
})
8+
export class DashboardApp {}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import {BrowserModule} from '@angular/platform-browser';
2+
import {NgModule} from '@angular/core';
3+
import {DashboardApp} from './dashboard-app';
4+
5+
@NgModule({
6+
declarations: [
7+
DashboardApp
8+
],
9+
imports: [
10+
BrowserModule
11+
],
12+
providers: [],
13+
bootstrap: [DashboardApp]
14+
})
15+
export class DashboardModule {}

tools/dashboard/src/assets/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)