Gravity
  • Welcome to Gravity
  • Getting Started
  • Stack
  • Updates
  • Rules For AI
  • Troubleshooting
  • Gravity Server
    • Introduction
    • Installation
      • Install Node.js
      • Database Setup
      • Stripe Setup
      • Mailgun Setup
      • Install Gravity
    • Application Structure
    • REST API
      • API Scopes
      • Webhooks
    • Authentication
      • Email Verification
      • Social Sign On
      • Two-Factor Authentication
    • Authorization
      • Feature Access and Plan Restrictions
      • Permissions (Roles)
    • Config
    • Environment Variables
    • Database Queries
    • Handling Errors
    • Logging
    • Localization
    • Push Notifications
    • Email Notifications
    • User Feedback
    • User Onboarding
    • File Uploads
    • Billing
      • Seat Billing
      • Usage Billing
    • Free Accounts
    • CLI Toolbelt
    • Testing
    • AI Tools
    • Background Jobs
    • Deployment
  • Gravity Web
    • Introduction
    • Tailwind & SCSS
    • Routing
    • Events
    • Authentication
    • Localization
    • Hooks
      • useAPI
      • usePlans
      • usePermissions
    • Components
      • Alert
      • Animate
      • Avatar
      • Badge
      • Breadcrumb
      • Button
      • Calendar
      • Card
      • Chart
      • Checklist
      • Credit Card
      • Detail
      • Dialog
      • Dropdown
      • Feedback
      • Form
      • Grid
      • Header
      • Helper
      • Icon
      • Image
      • Layout
      • Link
      • List
      • Loader
      • Logo
      • Nav
      • Onboarding
      • Pagination
      • Popover
      • Progress
      • Row
      • Search
      • Separator
      • Sheet
      • Social
      • Stat
      • Table
      • Tabs
      • Toast (Notification)
      • Tooltip
      • User
      • View
    • Views
    • Handling Errors
    • Deployment
  • Gravity Native
    • Introduction
    • Prerequisites
    • Installation
    • App Context
    • Authentication
    • Localisation
    • External Linking
    • Handling Errors
    • Navigation
    • Config
    • Events
    • Views
    • Components
      • Badge
      • Blankslate
      • Button
      • Card
      • Chart
      • Form
      • Global
      • Grid
      • Icon
      • List
      • Logo
      • Message
      • Modal
      • Nav
      • Notification
      • Progress Bar
      • Search
      • Separator
      • Social
      • Stat
      • View
    • Push Notifications
    • Payments
    • Building Your App
  • Mission Control
    • Introduction
    • Installation
    • User Management
    • Feedback
    • Events
    • Logs
  • Website Template
    • Introduction
    • Environment Variables
    • Styling
    • Components
      • Article
      • Feature List
      • Footer
      • Hero
      • Layout
      • Pricing
      • Meta Data
      • Nav
      • Testimonial
    • Build and Deploy
Powered by GitBook
On this page
  • Controllers
  • Models
  • Helpers
  • Views

Was this helpful?

  1. Gravity Server

Application Structure

PreviousInstall GravityNextREST API

Last updated 1 year ago

Was this helpful?

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

Gravity is updated weekly, so the files and structure in the video below will have changed and improved.

Controllers

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

  • accountController

  • aiController

  • authController

  • demoController

  • eventController

  • feedbackController

  • inviteController

  • jobController

  • keyController

  • pushtokenController

  • setupController

  • socialController

  • userController

  • utilityController

Models

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

  • account

  • auth

  • demo

  • email

  • feedback

  • invite

  • key

  • knex

  • log

  • login

  • mongo

  • openai

  • pushtoken

  • setup

  • stripe

  • token

  • user

Helpers

Helpers are located in the /helper directory, and the following are included for you:

  • chart

  • file

  • mail

  • notification

  • s3

  • utility

Views

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

Gravity Web
Gravity Native
REST API
api