begin global domination with angularjs and firebase - initial setup (part 1)
the full source is on github
So you want to take over the world, but you don't want to build a pesky server? I hear you. No one wants to maintain a pesky database whilst you have other concerns. Enter firebase
We're going to use generator-angular to begin our domination strategy, so like any good mastermind you need nodejs installed.
Once that's taken care of we'll get batman's utility belt setup:
npm install -g yo bower grunt-cli generator-angular
mkdir appToTakeOverTheWorld
cd appToTakeOverTheWorld
yo angular
Mr. yeoman will ask some questions. I usually say yes to everything but compass, just cuz. If you want to speed ahead to build an app with boilerplate prebuilt try generator-angularfire
So now you have a client side app, no database but all sorts of angular magic. Go to firebase.com, create an account then create a new firebase:
Once that's done you can see your data (it's empty, big suprise). We can also enable all sorts of different types of login. The code will be really easy. Let's enable twitter.
Then create a twitter app. Follow the link, sign in then select "Create New App". Put any valid url for the website link. We'll come back to it.
Once done, you'll get an API key and a secret key. Enter those into firebase. Authentication handled.
Install the angularfire module.
bower install angularfire --save
Angularfire's built and maintained by the firebase team for the specific purpose of kicking butt with angular (it's science. check out the documentation)
Add the firebase module as a dependency of our global domination app.
app/scripts/app.js
angular.module('appToTakeOverTheWorldApp', [
'ngCookies',
'ngResource',
'ngSanitize',
'ngRoute',
'firebase'
])
Then get everything running:
grunt serve
set up a controller and service in part 2
Written by Connor Leech
Related protips
1 Response
hey realize the source code github link was broken for a while. The code is here: https://github.com/jasonshark/angular-firebase-tutorials