# 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...


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mernkit.com/back-end/application-structure.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
