Added firebase

This commit is contained in:
Zakary Timson 2019-04-21 16:59:20 -04:00
parent 214b590e8b
commit a0951f8242
13 changed files with 2420 additions and 186 deletions

View File

@ -26,7 +26,7 @@ jobs:
- run: - run:
name: Build name: Build
command: yarn build -c ${CIRCLE_BRANCH} command: yarn build
- persist_to_workspace: - persist_to_workspace:
root: ./ root: ./
@ -38,7 +38,7 @@ jobs:
deploy: deploy:
docker: docker:
- image: google/cloud-sdk:latest - image: circleci/node:10.4-browsers
working_directory: ~/repo working_directory: ~/repo
@ -48,15 +48,9 @@ jobs:
- attach_workspace: - attach_workspace:
at: ./ at: ./
- run:
name: Authenticate GCP
command: |
echo $GCLOUD_SERVICE_KEY > key.json
gcloud auth activate-service-account --key-file key.json
- run: - run:
name: Deploy name: Deploy
command: gsutil cp -r dist/ZaksCode/* gs://www.zakscode.com command: yarn firebase deploy --token "${FIREBASE_TOKEN}"
workflows: workflows:
version: 2 version: 2

5
.firebaserc Normal file
View File

@ -0,0 +1,5 @@
{
"projects": {
"default": "zaks-code"
}
}

View File

@ -29,30 +29,6 @@
"es5BrowserSupport": true "es5BrowserSupport": true
}, },
"configurations": { "configurations": {
"master": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.staging.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": true,
"extractCss": true,
"namedChunks": false,
"aot": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": false,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
},
"production": { "production": {
"fileReplacements": [ "fileReplacements": [
{ {

23
firebase.json Normal file
View File

@ -0,0 +1,23 @@
{
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"hosting": {
"public": "dist/ZaksCode",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
"storage": {
"rules": "storage.rules"
}
}

4
firestore.indexes.json Normal file
View File

@ -0,0 +1,4 @@
{
"indexes": [],
"fieldOverrides": []
}

8
firestore.rules Normal file
View File

@ -0,0 +1,8 @@
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read;
allow write: if request.auth != null;
}
}
}

View File

@ -1,51 +1,54 @@
{ {
"name": "zaks-code", "name": "zaks-code",
"version": "0.0.0", "version": "1.0.0",
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
"start": "ng serve", "start": "ng serve",
"build": "ng build", "build": "ng build",
"test": "ng test", "test": "ng test",
"lint": "ng lint", "lint": "ng lint",
"e2e": "ng e2e" "e2e": "ng e2e"
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular/animations": "~7.2.0", "@angular/animations": "~7.2.0",
"@angular/cdk": "~7.3.7", "@angular/cdk": "~7.3.7",
"@angular/common": "~7.2.0", "@angular/common": "~7.2.0",
"@angular/compiler": "~7.2.0", "@angular/compiler": "~7.2.0",
"@angular/core": "~7.2.0", "@angular/core": "~7.2.0",
"@angular/forms": "~7.2.0", "@angular/fire": "~5.1.2",
"@angular/material": "^7.3.7", "@angular/forms": "~7.2.0",
"@angular/platform-browser": "~7.2.0", "@angular/material": "^7.3.7",
"@angular/platform-browser-dynamic": "~7.2.0", "@angular/platform-browser": "~7.2.0",
"@angular/router": "~7.2.0", "@angular/platform-browser-dynamic": "~7.2.0",
"core-js": "^2.5.4", "@angular/router": "~7.2.0",
"hammerjs": "^2.0.8", "core-js": "^2.5.4",
"rxjs": "~6.3.3", "hammerjs": "^2.0.8",
"tslib": "^1.9.0", "firebase": "^5.1.0",
"zone.js": "~0.8.26" "firebase-tools": "^6.0.1",
}, "rxjs": "~6.3.3",
"devDependencies": { "tslib": "^1.9.0",
"@angular-devkit/build-angular": "~0.13.0", "zone.js": "~0.8.26"
"@angular/cli": "~7.3.8", },
"@angular/compiler-cli": "~7.2.0", "devDependencies": {
"@angular/language-service": "~7.2.0", "@angular-devkit/build-angular": "~0.13.0",
"@types/jasmine": "~2.8.8", "@angular/cli": "~7.3.8",
"@types/jasminewd2": "~2.0.3", "@angular/compiler-cli": "~7.2.0",
"@types/node": "~8.9.4", "@angular/language-service": "~7.2.0",
"codelyzer": "~4.5.0", "@types/jasmine": "~2.8.8",
"jasmine-core": "~2.99.1", "@types/jasminewd2": "~2.0.3",
"jasmine-spec-reporter": "~4.2.1", "@types/node": "~8.9.4",
"karma": "~4.0.0", "codelyzer": "~4.5.0",
"karma-chrome-launcher": "~2.2.0", "jasmine-core": "~2.99.1",
"karma-coverage-istanbul-reporter": "~2.0.1", "jasmine-spec-reporter": "~4.2.1",
"karma-jasmine": "~1.1.2", "karma": "~4.0.0",
"karma-jasmine-html-reporter": "^0.2.2", "karma-chrome-launcher": "~2.2.0",
"protractor": "~5.4.0", "karma-coverage-istanbul-reporter": "~2.0.1",
"ts-node": "~7.0.0", "karma-jasmine": "~1.1.2",
"tslint": "~5.11.0", "karma-jasmine-html-reporter": "^0.2.2",
"typescript": "~3.2.2" "protractor": "~5.4.0",
} "ts-node": "~7.0.0",
} "tslint": "~5.11.0",
"typescript": "~3.2.2"
}
}

View File

@ -1,5 +1,7 @@
import {BrowserModule} from '@angular/platform-browser'; import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core'; import {NgModule} from '@angular/core';
import {AngularFireModule} from '@angular/fire';
import {AngularFirestoreModule} from '@angular/fire/firestore';
import {AppComponent} from './app.component'; import {AppComponent} from './app.component';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
@ -7,6 +9,7 @@ import {MaterialModule} from './material.module';
import {FormsModule} from '@angular/forms'; import {FormsModule} from '@angular/forms';
import {TypewriterComponent} from './components/typewriter/typewriter.component'; import {TypewriterComponent} from './components/typewriter/typewriter.component';
import {SlideShowComponent} from './components/slideShow/slideShow.component'; import {SlideShowComponent} from './components/slideShow/slideShow.component';
import {environment} from '../environments/environment';
@NgModule({ @NgModule({
declarations: [ declarations: [
@ -15,6 +18,8 @@ import {SlideShowComponent} from './components/slideShow/slideShow.component';
TypewriterComponent TypewriterComponent
], ],
imports: [ imports: [
AngularFireModule.initializeApp(environment.firebase),
AngularFirestoreModule,
BrowserModule, BrowserModule,
BrowserAnimationsModule, BrowserAnimationsModule,
FormsModule, FormsModule,
@ -23,5 +28,4 @@ import {SlideShowComponent} from './components/slideShow/slideShow.component';
providers: [], providers: [],
bootstrap: [AppComponent] bootstrap: [AppComponent]
}) })
export class AppModule { export class AppModule { }
}

View File

@ -1,3 +1,11 @@
export const environment = { export const environment = {
production: true production: true,
firebase: {
apiKey: "AIzaSyC1vKmDDzRR85DnOowPZvAkZEyzJ1EmjGI",
authDomain: "zaks-code.firebaseapp.com",
databaseURL: "https://zaks-code.firebaseio.com",
projectId: "zaks-code",
storageBucket: "zaks-code.appspot.com",
messagingSenderId: "430075133237"
}
}; };

View File

@ -1,16 +0,0 @@
// This file can be replaced during build by using the `fileReplacements` array.
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.
export const environment = {
production: false
};
/*
* For easier debugging in development mode, you can import the following file
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
*
* This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown.
*/
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.

View File

@ -1,16 +1,11 @@
// This file can be replaced during build by using the `fileReplacements` array.
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.
export const environment = { export const environment = {
production: false production: false,
firebase: {
apiKey: 'AIzaSyC1vKmDDzRR85DnOowPZvAkZEyzJ1EmjGI',
authDomain: 'zaks-code.firebaseapp.com',
databaseURL: 'https://zaks-code.firebaseio.com',
projectId: 'zaks-code',
storageBucket: 'zaks-code.appspot.com',
messagingSenderId: '430075133237'
}
}; };
/*
* For easier debugging in development mode, you can import the following file
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
*
* This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown.
*/
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.

8
storage.rules Normal file
View File

@ -0,0 +1,8 @@
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read;
allow write: if request.auth != null;
}
}
}

2362
yarn.lock

File diff suppressed because it is too large Load Diff