Royalties
Bitcentive uses DoneJS and Feathers, two open source web frameworks for building modern real-time applications.
Getting up and running is as easy as 1, 2, 3.
On a Mac, the easiest way to install and configure MongoDB is using the brew utility:
brew install mongodb
Pay special attention to the end of the brew command's
output, which includes instructions on how to start mongodb
:
To have launchd start mongodb now and restart at login:
brew services start mongodb
Or, if you don't want/need a background service you can just run:
mongod --config /usr/local/etc/mongod.conf
We recommend the brew services
option. If desired, mongodb
can be
stopped and uninstalled by running:
brew uninstall mongodb
Install your dependencies
cd path/to/bitcentive; npm install
Start your app
npm run develop
Please read the migration docs.
Simply run npm test
and all your tests in the test/
directory will be run.
Feathers has a powerful command line interface. Here are a few things it can do:
$ npm install -g feathers-cli # Install Feathers CLI
$ feathers generate service # Generate a new Service
$ feathers generate hook # Generate a new Hook
$ feathers generate model # Generate a new Model
$ feathers help # Show all commands
The bitcentive demo app allows Authenticated login using GitHubs OAuth api.
When you run your demo locally, there are some steps you are going to need to take, so that you can log in to the app using your github account.
Go to the GitHub application registration form and fill out the form.
You can fill out every piece of information however you like, except the Authorization callback URL. This is easily the most important piece to setting up your application. It's the callback URL that GitHub returns the user to after successful authentication. Assuming you are using all the config from the repo unchanged, you should set this to http://localhost:3030/auth/github/callback
.
After registering your application with GitHub, you will be provided a Client ID and a Client Secret token. You will need to set these values in your configuration for your app to work properly.
Open the json file at /config/default.json
and find the github.clientID
property and put your Client ID as the value there.
The GitHub Client Secret you want to be a little more careful with, and it should never be committed to the repo or published anywhere else.
You have two options for setting your Client Secret, you can:
GITHUB_CLIENT_SECRET
on your system with a value equal to your systemlocal.json
file to the config
directory in the project, and put some content like this in there:{
"auth": {
"github": {
"clientSecret": "REPLACE THIS WITH YOUR GITHUB_CLIENT_SECRET"
}
}
}
This file is ignored by git (.gitignore
), and will not be commited to the repo, but will be read by the app when running locally.
With one of these two options in place you should now be able to "Login with Github" in the app.
We must not commit our secrets to our repository, so to store our secrets we use either Environment Variables or a "git ignored" local config file at config/local.json
.
For deployments or if you prefer for development you can just set the value of the Environment Variables GITHUB_CLIENT_SECRET
and FEATHERS_AUTH_SECRET
to the client secret provided by GitHub and your particular feathers secret respectively.
Alternatively create a local.json
file and stick it in the root config
directory and any values here will override the corresponding values in the configuration as per feathers-configuration.
For more information on all the things you can do with Feathers visit docs.feathersjs.com.
0.1.0
Copyright (c) 2016
Licensed under the MIT license.