applibook v1.4.0
Book Boilerplate
Overview
Using this Repo you'll be able to create a new gitbook and host it in heroku.
Setup
- Install the applibook cli globally
$ npm install -g applibookCreate a new book
- create a new directory and
cdto it - run
applibook create - Process may take a minute or two
- Publish the newly created repo to github
Write the book
Your book content is located ad the book folder.
TO find out more on how to arrange your content read the following:
See book locally
You can view your compiled book by running.
$ yarn run serveChanges you do in the book content will show app immediately in the book
Test Authorization locally
If you want to test how Applicaster Accounts authorization works add a .env file to the root of the repo and add the environment variables listed bellow - environment variables e.g.:
PORT=4001
USE_ACCOUNTS_AUTH=1
CLIENT_ID=<CLIENT_ID_TAKEN_FROM_APPLICATER_ACCOUNTS>
CLIENT_SECRET=<CLIENT_SECRET_TAKEN_FROM_APPLICATER_ACCOUNTS>Then run
$ yarn build
$ yarn startPublish to Heroku
- Login to Heroku using Applicaster Account
- Create a new Heroku app and give it a name
NOTE: If you want to make your book to have restricted login make sure your create the environment variables before proceeding Restricting book access
- Go to the app
Deploytab and chooseGithubas the deployment method - Search and connect your created repo
- Click on the
Enable Automatic Deploysto enable book recompile when the repo's content is updated. - Click on the
Deploy Brunchto deploy the book for the first time.
Restrict book access
In case you want to restrict access of the book to only Applicaster logged in members do the following
Create a new Application in Applicaster accounts
- Go to - https://accounts.applicaster.com/admin/applications
- Create a new Application and for the
Redirect uriput your heroku app URL with the following suffix/bell/doore.g. if your App heroku url ishttps://book-b1.herokuapp.com/so sethttps://book-b1.herokuapp.com/bell/dooras theRedirect uri
Add the following environment variables
USE_ACCOUNTS_AUTH- Should the book be restricted using Applicaster Accounts oAuth (0 - no restriected, 1 -restricted)
CLIENT_ID- Applicaster Accounts CLIENT_IDCLIENT_SECRET- Applicaster Accounts CLIENT_SECRET