Build and run locally
Build the app
Once you’re all set up, to build and run the app you will simply run:
make all
make run
Here are more detailed instructions.
-
Make a copy of
./electricbook.yml
to./electricbook-0.yml
and configure the parameters as needed. You must set the Client ID and Client Secret of your own GitHub OAuth application:github: client: "-clientID from github oauth application configuration-" secret: "-secret from github oauth application configuration-"
Do not commit this file to version control.
-
Get a personal access token from GitHub (Settings > Developer Settings > Personal access tokens. At “Select scopes”, you currently only need to select
repo
.Place the token and your GitHub username in
~/.ebw.yml
:users: - token: - name:
-
Run
npm install
to install the rest of the dependencies. -
Generate the production-ready CSS by running:
gulp scss
If you’re going to make changes to the SCSS in the
src
directory, rungulp watch
to watch for changes. -
If you’re going to make changes to the JS in the
src
directory, install DTemplate, then rundtemplate -dir src/ts -lang ts -logtostderr -out src/ts/Templates.ts -watch
and
rollup -c --watch
to watch for changes.
-
To build, enter in the Terminal:
make all
This will create two binaries in
bin
:electricbook
, which is the EBM web app, andebw
, which is a CLI app. -
Start the app with:
make run
(This make command simply does
bin/electricbook -logtostderr web
.)This must be run from the repo directory, since it needs access to the
public
directory, to some other directories it will create on the fly, and to theelectricbook.yml
configuration file.You can then open the EBM in your browser at http://localhost:16101/.
For convenience, run make dev
to start the app and watch the Sass, Typescript and dTemplates all at once. Note that this runs the processes in parallel, and you may need to kill processes manually when you’re done.