|
1 |
| -# Angularfire2DemoApp |
| 1 | +# Angular Firebase Demo App |
2 | 2 |
|
3 |
| -This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.0.8. |
| 3 | +Mini [angularfire2][af2] API showcase of `angularfire2/auth`, `angularfire2/database`, `angularfire2/firestore` and `angularfire2/storage`, tutorials, snippet compilations and [demo][demo] app. |
4 | 4 |
|
5 |
| -## Development server |
| 5 | +### Getting started |
6 | 6 |
|
7 |
| -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. |
| 7 | +Download [firebase][fb] and [angularfire2][af2] packages `npm i firebase angularfire2 --save` Import these in your `app.module.ts` and setup environments folder. see how to setup environments folder in Usage header below. |
8 | 8 |
|
9 |
| -## Code scaffolding |
| 9 | +``` javascript |
| 10 | +import { AngularFireModule } from 'angularfire2'; |
| 11 | +import { AngularFireAuthModule } from 'angularfire2/auth'; |
| 12 | +import { AngularFirestoreModule } from 'angularfire2/firestore'; |
| 13 | +import { AngularFireDatabaseModule } from 'angularfire2/database'; |
| 14 | +import { AngularFireStorageModule } from 'angularfire2/storage'; |
| 15 | +``` |
10 | 16 |
|
11 |
| -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`. |
| 17 | +``` javascript |
| 18 | +@NgModule({ |
| 19 | + ... |
| 20 | + imports: [ |
| 21 | + ... |
| 22 | + AngularFireModule, |
| 23 | + AngularFirestoreModule, |
| 24 | + AngularFireAuthModule, |
| 25 | + AngularFireDatabaseModule, |
| 26 | + AngularFireStorageModule, |
12 | 27 |
|
13 |
| -## Build |
| 28 | + ], |
14 | 29 |
|
15 |
| -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. |
| 30 | +}) |
| 31 | +``` |
16 | 32 |
|
17 |
| -## Running unit tests |
| 33 | +### Authentication |
18 | 34 |
|
19 |
| -Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). |
| 35 | +[Snippets][auth] / [Demo][auth-demo] / [firebase docs][fb-doc] / [angularfire2 docs][af2-doc] |
20 | 36 |
|
21 |
| -## Running end-to-end tests |
| 37 | +> For `angularfire2/auth` mini API showcase and snippet collection, go [here][auth]. |
22 | 38 |
|
23 |
| -Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). |
| 39 | +* Sign up / Sign in with Email and Password |
| 40 | +* Sign in Anonymously |
| 41 | +* Sign out |
| 42 | +* Authenticate using Social Media accounts |
| 43 | +* Update Email |
| 44 | +* Update Password |
| 45 | +* Update Profile |
24 | 46 |
|
25 |
| -## Further help |
| 47 | +##### APIs used |
26 | 48 |
|
27 |
| -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). |
| 49 | +| | API | |
| 50 | +|------------------------------|------------------------------------| |
| 51 | +| Sign up (Email and password) | `createUserWithEmailAndPassword()` | |
| 52 | +| Sign in (Email and password) | `signInWithEmailAndPassword()` | |
| 53 | +| Sign out | `signOut()` | |
| 54 | +| Social Media | `signInWithPopup()` | |
| 55 | +| Update email address | `updateEmail()` | |
| 56 | +| Update password | `updatePassword()` | |
| 57 | +| Update profile | `updateProfile()` | |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | +### Realtime Database |
| 63 | + |
| 64 | +[Snippets][rtdb] / [Demo][rtdb-demo] / [firebase docs][fb-doc] / [angularfire2 docs][af2-doc] |
| 65 | + |
| 66 | +CRUD Operations in both **List** & **Object** |
| 67 | + |
| 68 | +> For `angularfire2/database` mini API showcase and snippet collection, go [here][rtdb]. |
| 69 | +
|
| 70 | + |
| 71 | +##### APIs used |
| 72 | + |
| 73 | +| | Object | List | |
| 74 | +|--------|---------------------------------------|---------------------------------------| |
| 75 | +| Create | `set()` / `update()` | `push()` | |
| 76 | +| Read | `valueChanges()`, `snapshotChanges()` | `valueChanges()`, `snapshotChanges()` | |
| 77 | +| Update | `set()` / `update()` | `set()` / `update()` | |
| 78 | +| Delete | `remove()` | `remove()` | |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | +### Cloud Firestore |
| 85 | + |
| 86 | +[Snippets][firestore] / [Demo][firestore-demo] / [firebase docs][fb-doc] / [angularfire2 docs][af2-doc] |
| 87 | + |
| 88 | +> For `angularfire2/firestore` mini API showcase and snippet collection, go [here][firestore]. |
| 89 | +
|
| 90 | +##### APIs used |
| 91 | + |
| 92 | +| | API | |
| 93 | +|--------|---------------------------------------| |
| 94 | +| Create | `add()` | |
| 95 | +| Read | `valueChanges()`, `snapshotChanges()` | |
| 96 | +| Update | `update()` | |
| 97 | +| Delete | `remove()` | |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | +### Firebase Storage |
| 104 | + |
| 105 | +[Snippets][storage] / [Demo][storage-demo] / [firebase docs][fb-doc] / [angularfire2 docs][af2-doc] |
| 106 | + |
| 107 | +> For `angularfire2/storage` mini API showcase and snippet collection, go [here][storage]. |
| 108 | +
|
| 109 | +* Upload file |
| 110 | +* Download file |
| 111 | +* Remove file |
| 112 | + |
| 113 | +##### APIs used |
| 114 | + |
| 115 | +| | API | |
| 116 | +|----------|--------------------| |
| 117 | +| Upload | `put()` | |
| 118 | +| Download | `getDownloadURL()` | |
| 119 | +| Delete | `delete()` | |
| 120 | + |
| 121 | + |
| 122 | +## Usage |
| 123 | + |
| 124 | +* `git clone https://github.com/ElecTreeFrying/angularfire2-demo-app.git` |
| 125 | +* `cd angularfire2-demo-app` |
| 126 | +* `npm install` |
| 127 | + |
| 128 | +Create your own [firebase app](https://console.firebase.google.com). |
| 129 | + |
| 130 | +1. Select _Add Project_ |
| 131 | +1. Select Authentications |
| 132 | +1. Click copy **WEB SETUP** |
| 133 | +1. Create the environment files below in `src/environments/`. |
| 134 | + |
| 135 | + **environment.prod.ts** |
| 136 | + |
| 137 | + ``` javascript |
| 138 | + export const environment = { |
| 139 | + production: true, |
| 140 | + firebaseConfig: { **PASTE WEB SETUP** } |
| 141 | + }; |
| 142 | + |
| 143 | + ``` |
| 144 | + |
| 145 | + **environment.ts** |
| 146 | + |
| 147 | + ``` javascript |
| 148 | + export const environment = { |
| 149 | + production: false, |
| 150 | + firebaseConfig: { **PASTE WEB SETUP** } |
| 151 | + }; |
| 152 | +
|
| 153 | + ``` |
| 154 | + |
| 155 | +## Version |
| 156 | + |
| 157 | +* [x] @angular/cli: `6.1.1` |
| 158 | +* [x] firebase: `5.3.0` |
| 159 | +* [x] angularfire2: `5.0.0-rc.11` |
| 160 | + |
| 161 | +#### star and fork 🙏🙌 or contribute ❤️ |
| 162 | + |
| 163 | +[contact me](https://.com) |
| 164 | + |
| 165 | +## License |
| 166 | + |
| 167 | +MIT |
| 168 | + |
| 169 | + |
| 170 | +[af2]: https://github.com/angular/angularfire2/ |
| 171 | +[af2-doc]: https://github.com/angular/angularfire2/tree/master |
| 172 | + |
| 173 | + |
| 174 | +[fb]: https://github.com/firebase/firebase-js-sdk/ |
| 175 | +[fb-doc]: https://firebase.google.com/docs/web/setup |
| 176 | + |
| 177 | + |
| 178 | +[demo]: https://angularfire2-demo-app.firebaseapp.com/ |
| 179 | + |
| 180 | +[rtdb]: https://github.com/ElecTreeFrying/angularfire2-demo-app/tree/master/src/app/rtdb/rtdb.md |
| 181 | +[rtdb-demo]: https://angularfire2-demo-app.firebaseapp.com/rtdb |
| 182 | + |
| 183 | +[firestore]: https://github.com/ElecTreeFrying/angularfire2-demo-app/tree/master/src/app/firestore/firestore.md |
| 184 | +[firestore-demo]: https://angularfire2-demo-app.firebaseapp.com/firestore |
| 185 | + |
| 186 | +[auth]: https://github.com/ElecTreeFrying/angularfire2-demo-app/tree/master/src/app/auth/auth.md |
| 187 | +[auth-demo]: https://angularfire2-demo-app.firebaseapp.com/auth |
| 188 | + |
| 189 | +[storage]: https://github.com/ElecTreeFrying/angularfire2-demo-app/tree/master/src/app/storage/storage.md |
| 190 | +[storage-demo]: https://angularfire2-demo-app.firebaseapp.com/storage |
0 commit comments