this incarnation of kick-off template is a progressive web app built with angular2 + firebase + google material design
- kick-off-ng2-fire-md
kick-off-ng2-fire-md is an incarnation of kick-off-template-project. this time it is a template for a progressive web app built with angular2 + firebase + google material design
currently it contains following features:
- social media login (facebook, twitter, google+ and github)
- personal 'todo' item list
- chat with other users
the project was generated with angular-cli version 1.0.0-beta.21 and is a clone of angular2-firebase-material-demo by tarleoo
currently the application lives at https://kick-off-ng2-fire-md-4cc50.firebaseapp.com/
while the demo of the seed application can be found at https://fir-todo-v3.firebaseapp.com/
first of all you have to install npm
and node.js
to your box. installation instructions can
be found here.
note that node.js 6.x
is required.
$ git clone https://github.com/projekt-kreatywa/kick-off-ng2-fire-md.git
$ cd kick-off-ng2-fire-md
# install the project's dependencies with npm
$ npm install
# fast install (via yarn, https://yarnpkg.com)
$ yarn install # or yarn
see /src/app/config/config.ts_example
file and copy it to /src/app/config/config.ts
file and make necessary changes to it. note that you need a firebase account to get all necessary config values.
if you are not familiar with firebase and/or don't have a firebase developer account, sign up quickly with your google id here: https://firebase.google.com/.
after you have created new application you will need to make some security rules for the used data storage. below is configuration that this demo application uses, so you can use the same within your application.
{
"rules": {
"messages": {
".write": "auth !== null",
".read": "auth !== null"
},
"todos": {
"$uid": {
// grants write access to the owner of this user account whose uid must exactly match the key ($uid)
".write": "auth !== null && auth.uid === $uid",
// grants read access to any user who is logged in with facebook
".read": "auth !== null && auth.uid === $uid"
}
}
}
}
these rules ensure that 'todo' items are show only to user who made those. also chat messages requires that user is logged in to read / write those.
to start developing in the project run:
$ npm start
# or
$ ng serve
then head to http://localhost:4200
in your browser.
run ng generate component component-name
to generate a new component. you can also use ng generate directive/pipe/service/class
.
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.
to run tests run:
$ npm test
# or
$ ng test
to run tests run:
$ npm run e2e
# or
$ ng e2e
run ng github-pages:deploy
to deploy to github pages.
to get more help on the angular-cli
use ng --help
or check out the angular-cli readme.
this will require a bit of footwork until npm install of @angular/flex-layout is available via standard npm i @angular/flex-layout
which will be after the the flex-layout v1.0.0-beta.1 release (week of december 20, 2016).
installing flex-layout with npm is not yet available. developers can easily install this @angular/flex-layout
library using a local build and directory copy:
gulp build:release
ditto ./dist/@angular/flex-layout <your project>/node_modules/@angular/flex-layout
the expected deployment process to npm (and the standardized use of npm i @angular/flex-layout
) is not yet available. npm installs will be available after the the flex-layout v1.0.0-beta.1 release (week of december 20, 2016).
in their application module, developers import the global layout api directives (as shown below):
// demo-app-module.ts
import { flexlayoutmodule } from '@angular/flex-layout';
@ngmodule({
imports: [
browsermodule, commonmodule, formsmodule, httpmodule, // import ng2 core modules
flexlayoutmodule.forroot(), // import dependency on flex-layout
],
)}
export class demoappmodule { }
in their component templates, developers easily use the layout api to build complex, dynamic layouts:
<div fx-layout="row">
<div [fx-layout]="firstcol" [fx-flex]="firstcolwidth" >
<div fx-flex="27%"> first item in row </div>
<div fx-flex > second item in row </div>
</div>
<div [fx-layout]="secondcol" flex >
<div fx-flex > first item in column </div>
<div fx-flex="33px"> second item in column </div>
</div>
</div>
to get more help on the installation and use of @angular/flex-layout check out flex-layout readme
- rafszul for projekt:kreatywa
- tarmo leppänen - author of the seed repo