This is a step-by-step guide to getting you up and running with Spark so you can start developing as soon as possible.
- NodeJS ( https://nodejs.org/en/ ) (use latest version 6.9+, we use ECMAScript 2015)
- GIT ( https://git-scm.com/downloads )
- Fork the project on GitHub (this can be done in the GitHub web interface)
- clone your forked repo
git clone https://github.com/<YOUR_GITHUB_USER>/Spark.git
To be able to sync with Midburn repository you should add it as a remote:
git remote add midburn https://github.com/Midburn/Spark.git
Optional - It is recommended to use nvm to get the correct node version. (If you are not planning to use nvm, just skip these commands).
We have a .nvmrc file which will be detected automatically, so you will get the correct node version.
cd spark
nvm install
nvm use
cd spark
npm install
npm install -g nodemon knex bower
Bower provides web static files dependencies
bower install
Local development environment uses Sqlite do doesn't require any special DB setup.
The database file is located (by default) at spark/dev.sqlite3
We use Knex to run and manage the migrations.
knex migrate:latest
See /docs/database.md for more details about our database setup.
Fire up the server after installation, with nodemon
to monitor changes and re-run the server:
nodemon server.js
and navigate to http://localhost:3000.
Note nodemon should take care of refreshing the server when you make changes.
After lighting the spark, if this is the first time or if you have recreated the DB browse to the development console at http://localhost:3000/dev and select Create admin user.
This will create a user: a, password: a
All the configurations are set in the config file in the /config
folder.
To override this configurations to match your development environment:
- Create a file named
/config/local-evelopment.json
- Open the file and copy all the settings you wish to override from
/config/default.json
Notes:
- You only need to copy the settings you need to override, not all the settings.
- The file format should be the same as
/config/default.json