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.ymlto./electricbook-0.ymland 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 installto install the rest of the dependencies. -
Generate the production-ready CSS by running:
gulp scssIf you’re going to make changes to the SCSS in the
srcdirectory, rungulp watchto watch for changes. -
If you’re going to make changes to the JS in the
srcdirectory, install DTemplate, then rundtemplate -dir src/ts -lang ts -logtostderr -out src/ts/Templates.ts -watchand
rollup -c --watchto watch for changes.
-
To build, enter in the Terminal:
make allThis 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
publicdirectory, to some other directories it will create on the fly, and to theelectricbook.ymlconfiguration 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.