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,6 +1,6 @@
{ {
"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",
@ -16,6 +16,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/fire": "~5.1.2",
"@angular/forms": "~7.2.0", "@angular/forms": "~7.2.0",
"@angular/material": "^7.3.7", "@angular/material": "^7.3.7",
"@angular/platform-browser": "~7.2.0", "@angular/platform-browser": "~7.2.0",
@ -23,6 +24,8 @@
"@angular/router": "~7.2.0", "@angular/router": "~7.2.0",
"core-js": "^2.5.4", "core-js": "^2.5.4",
"hammerjs": "^2.0.8", "hammerjs": "^2.0.8",
"firebase": "^5.1.0",
"firebase-tools": "^6.0.1",
"rxjs": "~6.3.3", "rxjs": "~6.3.3",
"tslib": "^1.9.0", "tslib": "^1.9.0",
"zone.js": "~0.8.26" "zone.js": "~0.8.26"

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