Build Your Application

Expanding on Gravity to develop your own application is as simple as adding your own models and connecting them up to a controller.

Defining New Routes

You can create new pages within /router.js and API calls inside /api.js

Performing Database Queries

Database queries are executed with:

db.query(query).then(callback);

User Interface

Creating your user interface is as easy as copy and paste. You can find examples of most UI elements you will need within the UI section of this documentation.

Simply copy the examples and paste them into a view within your application.

Gulp

SCSS and Javascript files are automatically compiled for you inside gulpfile.js.

Files are not minified with Gulp so you can debug your application in the browser console. You can download Gulp Uglify to minify your files before shipping your application.

To monitor changes and compile your code, just run the following command in a terminal window and leave it open:

gulp watch

Settings

You can manage your application settings at /config, or by editing the settings.json file.

Deploying Your Application

When switching to your live domain, you will need to update the domain flag inside settings.json