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 )
Download and install as described on the websites.
- 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.gitTo be able to sync with Midburn repository you should add it as a remote:
git remote add midburn https://github.com/Midburn/Spark.gitOptional - It is recommended to use nvm to get the correct node version. If you are not planning to use nvm or running Windows and having trouble setup things, just skip these section.
We have a .nvmrc file which will be detected automatically, so you will get the correct node version.
cd spark
nvm install
nvm usecd spark
npm install
npm install -g nodemon knex bowerBower provides web static files dependencies
bower installLocal development environment uses MySQL by default.
We use Knex to run and manage the migrations.
knex migrate:latestSee /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.jsand 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