Application Structure

Gravity uses a simple Model-View-Controller (MVC) pattern with a REST API. The structure of Gravity Sever is a server.js file, with an api.js file routing requests from the client to the various controllers.


Controllers are located inside the /controller directory, the following come as standard:

  • accountController

  • authController

  • demoController

  • masterController

  • metricsController

  • setupController

  • userController


Models are located in the /model directory, and the following are included for you:

  • account

  • auth

  • chart

  • database

  • demo

  • mail

  • master

  • metrics

  • notification

  • setup

  • stripe

  • user

  • utilities


Views will either be located inside the /client/src/views directory if you're using Gravity Web as your front-end client, or else in the /app/views directory inside your Gravity Native installation folder.