# Application Structure

Below I will list the general API layout. I will not list all functions just a few to give you an understanding of what you will find in each file.&#x20;

* App.js (Entry Point)&#x20;
* nodemon.json (environmental variables used for debugging)
  * Controllers
    * stripe-controller.js (Stripe middleware functions)&#x20;
      * Get Plan Options &#x20;
      * Get Subscription Status...&#x20;
    * users-controller.js (User  middleware functions)&#x20;
      * Get Users
      * Get Permissions...
  * Middleware
    * passport.js&#x20;
      * Facebook Authentication Strategy
      * Google Authentication Strategy&#x20;
      * JWT Authentication Strategy...&#x20;
  * Models
    * http-error.js&#x20;
      * Wrapper for error responses.&#x20;
    * tenant.js
      * Mongoose Model for Tenants
    * users.js
      * Mongoose Model for Users
  * Routes
    * stripe-routes.js
      * routes to controller methods starting with /api/stripe
    * users-routes.js
      * routes to controller methods starting with /api/users
  * Shared
    * email.js
      * wrapper methods for mailgun transactional emails
    * helper.js
      * method to handle potential tenant name collisions
    * stripe.js
      * wrapper methods for strip operations
        * Cancel Subscription
        * Update Subscription...
