Skip to content

Commit

Permalink
Merge pull request #16 from iobodianskyi/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
iobodianskyi authored Feb 4, 2019
2 parents 938df94 + 60a252b commit 062c057
Show file tree
Hide file tree
Showing 27 changed files with 1,190 additions and 909 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ testem.log
.DS_Store
Thumbs.db
.firebase
src/environments/environment.prod.ts
src/environments/environment.ts
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,34 @@ Run `ng generate component component-name` to generate a new component. You can

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.

## Further help
## Deployment

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).
Firebase Hosting uses for hosting the app.

### Building the Production Code

Run `ng build --prod`

### Deploying to Firebase

First, make sure you have the firebase tools package installed.

`npm install -g firebase-tools`

Second, log into your existing firebase account

`firebase login`

Third, initialize the project

`firebase init`

For the most part, you can stick with the default settings, except for the following questions:
1. Choose hosting on the first question.
2. Change public folder to dist/notes when asked (it defaults to public).
3. Configure as single page app? - Yes
4. If firebase asks to overwrite your index.html file, just say NO.

### Deploy

`firebase deploy`
28 changes: 0 additions & 28 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,34 +125,6 @@
}
}
}
},
"notes-e2e": {
"root": "e2e/",
"projectType": "application",
"prefix": "",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "notes:serve"
},
"configurations": {
"production": {
"devServerTarget": "notes:serve:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "notes"
Expand Down
14 changes: 14 additions & 0 deletions database.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
function isSignedIn() { return request.auth != null; }
function isCurrentUser() { return isSignedIn() && request.auth.uid == userId; }

allow get, create, update: if isCurrentUser();

match /notes/{noteId} {
allow read, write: if isCurrentUser();
}
}
}
}
Loading

0 comments on commit 062c057

Please sign in to comment.