Backend API server for ATLauncher NEXT.
Before you begin you need to make sure you have NodeJS (4.x) installed on your computer
Clone the repository and run the following commands under your project root:
npm install
Once done you need to run the migrations. In development mode (which is default) the application will use a sqlite database at /db/development.sqlite3
.
To run the migrations simply run:
npm run migrate
Once done you can start the development server by running:
npm run dev
To run the tests simply run the following command:
npm test
This will run npm run test:clean
before running the tests which will remove the test database, run the migrations as well as the seeds.
Please make sure you run all your code through the linter before creating a pull request as all pull requests are automatically checked by the CI process and will cause delays if not linted properly.
To run the linter:
npm run lint
All configuration files can be found in the /config
folder.
They're divided up into 3 main files:
base.json
: This file is the very base file and contains configuration that is used in both production and development.test.json
: This file contains setting overrides for when in test.development.json
: This file contains setting overrides for when in development.production.json
: This file contains setting overrides for when in prodution.
To run in production you should use some tool such as NodeMon of Forever to keep your server up and running all the time.
First thing you need to do is run the migrations for the production environment:
NODE_ENV=production npm run migrate
This will run the migrations on the defined production database specified in /knexfile.js
which by default is set to use MySQL using the credentials in the production config.
Then once ready to run simply run:
NODE_ENV=production npm start
This will compile all the src files with babel and then run the server.
If you wish to contribute to this repository in any way, take a look at CONTRIBUTING.md.